Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement name normalization from PEP 503 #60

Merged
merged 1 commit into from
Feb 9, 2016

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