Skip to content

Comments

Implement name normalization from PEP 503#60

Merged
dstufft merged 1 commit intopypa:masterfrom
dstufft:normalize-func
Feb 9, 2016
Merged

Implement name normalization from PEP 503#60
dstufft merged 1 commit intopypa:masterfrom
dstufft:normalize-func

Conversation

@dstufft
Copy link
Member

@dstufft dstufft commented Feb 9, 2016

No description provided.

@dstufft dstufft force-pushed the normalize-func branch 2 times, most recently from 1140d8d to ac90a0f Compare February 9, 2016 22:38
("foo.bar", "foo-bar"),
("Foo.Bar", "foo-bar"),
("foo_bar", "foo-bar"),
("foo-bar", "foo-bar"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe ("foo___bar", "foo-bar") also ?

dstufft added a commit that referenced this pull request Feb 9, 2016
Implement name normalization from PEP 503
@dstufft dstufft merged commit 0468978 into pypa:master Feb 9, 2016
@dstufft dstufft deleted the normalize-func branch February 9, 2016 22:48
@rbtcollins
Copy link

What about illegal names? e.g. ^foo

@dstufft
Copy link
Member Author

dstufft commented Feb 9, 2016

We just pass them through. This function doesn't attempt to limit what names are acceptable, it just implements the canonicalization rules, which are:

  • Lower cased
  • -, _, and . are all canonicalized to -.

Anything else is just passed through unmodified (in PyPI's case, we have something else ensuring the names are valid, in packaging we have that rule encoded into the Requirement, etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants