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

All extra names must be converted to lower case. use pkg_resources.sa… #1225

Closed

Conversation

GabrielC101
Copy link

Fixes pypa/pip#4617. Supposedly.

@benoit-pierre
Copy link
Member

This patch is mangling the environment markers.

@GabrielC101
Copy link
Author

I'll have to come back to this later.

@GabrielC101
Copy link
Author

Note: setuptools makes the extras safe when parsing the Requirement object args. https://github.com/pypa/setuptools/blob/master/pkg_resources/__init__.py#L3006

@GabrielC101
Copy link
Author

GabrielC101 commented Dec 4, 2017

setuptools.pkg_resources.evaluate_marker at https://github.com/pypa/setuptools/blob/master/pkg_resources/__init__.py#L1449 claims to determine if a string is a valid marker. Yet the string ':python_version=="2.7"' is considered invalid.

Is evaluate_marker reliable? Ultimately the decision is made by the pyparsing grammer. I'm having difficulty deciphering it.

@benoit-pierre
Copy link
Member

':python_version=="2.7"' is not a valid marker, 'python_version=="2.7"' is.

@GabrielC101
Copy link
Author

GabrielC101 commented Dec 5, 2017

This commit uses the same process used in _check_extra to separate an extra name from the environment markers. It then uses the safe_extras method to convert the extra name before recreating the section.

This ensures setuptools views extra names as case insensitive.

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.

2 participants