[Distutils] FINAL DRAFT: Dependency specifier PEP

Robert Collins robertc at robertcollins.net
Tue Nov 17 11:40:33 EST 2015


On 18 November 2015 at 02:59, Antoine Pitrou <solipsis at pitrou.net> wrote:
> On Tue, 17 Nov 2015 09:46:21 +1300
> Robert Collins <robertc at robertcollins.net> wrote:
>>
>>     URI_reference = <URI | relative_ref>
>>     URI           = scheme ':' hier_part ('?' query )? ( '#' fragment)?
>>     hier_part     = ('//' authority path_abempty) | path_absolute |
>> path_rootless | path_empty
>>     absolute_URI  = scheme ':' hier_part ( '?' query )?
>>     relative_ref  = relative_part ( '?' query )? ( '#' fragment )?
>>     relative_part = '//' authority path_abempty | path_absolute |
>> path_noscheme | path_empty
>>     scheme        = letter ( letter | digit | '+' | '-' | '.')*
>>     authority     = ( userinfo '@' )? host ( ':' port )?
>>     userinfo      = ( unreserved | pct_encoded | sub_delims | ':')*
>>     host          = IP_literal | IPv4address | reg_name
>>     port          = digit*
>>     IP_literal    = '[' ( IPv6address | IPvFuture) ']'
>>     IPvFuture     = 'v' hexdig+ '.' ( unreserved | sub_delims | ':')+
>>     IPv6address   = (
>>                       ( h16 ':'){6} ls32
>>                       | '::' ( h16 ':'){5} ls32
>>                       | ( h16 )?  '::' ( h16 ':'){4} ls32
>>                       | ( ( h16 ':')? h16 )? '::' ( h16 ':'){3} ls32
>>                       | ( ( h16 ':'){0,2} h16 )? '::' ( h16 ':'){2} ls32
>>                       | ( ( h16 ':'){0,3} h16 )? '::' h16 ':' ls32
>>                       | ( ( h16 ':'){0,4} h16 )? '::' ls32
>>                       | ( ( h16 ':'){0,5} h16 )? '::' h16
>>                       | ( ( h16 ':'){0,6} h16 )? '::' )
>
> It seems weird that the PEP tries to include an entire subgrammar for
> URIs, including even the parsing various kinds of IP addresses.  Why not
> be lenient in their detection and leave actual definition of valid URIs
> to the IETF?
>
> It doesn't seem there is any point to embed/duplicate such knowledge in
> Python packaging tools.

Its included in the complete grammar, otherwise it can't be tested.
Note that that the PEP body refers to the IETF document for the
definition of URIs. e.g. exactly what you suggest.

-Rob
-- 
Robert Collins <rbtcollins at hp.com>
Distinguished Technologist
HP Converged Cloud


More information about the Distutils-SIG mailing list