From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: bug#24450: [PATCHv2] Re: pypi importer outputs strange character series in optional dependency case. Date: Mon, 10 Jun 2019 11:12:03 +0200 Message-ID: <87d0jldct8.fsf@mdc-berlin.de> References: <87pnod7ot4.fsf@gmail.com> <87imtd6dtq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:39182) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haGMT-0002wF-At for bug-guix@gnu.org; Mon, 10 Jun 2019 05:13:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1haGMR-0003P1-E2 for bug-guix@gnu.org; Mon, 10 Jun 2019 05:13:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42446) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1haGMP-0003NK-Qc for bug-guix@gnu.org; Mon, 10 Jun 2019 05:13:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1haGMP-0006Wv-Ii for bug-guix@gnu.org; Mon, 10 Jun 2019 05:13:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87imtd6dtq.fsf@gmail.com> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Maxim Cournoyer Cc: 24450@debbugs.gnu.org Maxim Cournoyer writes: > While I agree that a regexp is a bigger hammer than basic string > manipulation, I see some merit to it here: > > 1) We can be assured of conformance with upstream, again, per PEP-0508. > 2) It is easier to extend; we might want to add parsing for the version > spec in order to disregard dependencies specified for Python < 3, for > example. > > The use of the PEP-0508 grammar to define the regexp is useful to detail > in a more human-friendly language the components of the regexp. We > could have otherwise used the more cryptic regexp for Python > distribution names: > > --8<---------------cut here---------------start------------->8--- > ^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$ > --8<---------------cut here---------------end--------------->8--- > > So I guess that what I'm saying is that I prefer this approach to using > string-index with invalid characters, for the reasons above. > > [0] https://www.python.org/dev/peps/pep-0508/ Okay, sounds good. Please make sure to note this in a comment, so that I won=E2=80=99t be asking myself this same question in a year :) -- Ricardo