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

Do not set extra in default_environment() #554

Merged
merged 1 commit into from Jun 4, 2022

Conversation

sbidoul
Copy link
Member

@sbidoul sbidoul commented Jun 4, 2022

PEP 508 says explicitly that the presence of the extra key in an environment is an error except in special cases.

This PR tweaks #550. cc/ @MrMino @uranusjr @pradyunsg

PEP 508 says explicitly that the presence of extra in an environment
except in special cases.
@pradyunsg
Copy link
Member

The specific section:

The “extra” variable is special. It is used by wheels to signal which specifications apply to a given extra in the wheel METADATA file, but since the METADATA file is based on a draft version of PEP 426, there is no current specification for this. Regardless, outside of a context where this special handling is taking place, the “extra” variable should result in an error like all other unknown variables.

In other words, the extra key is only for dependency metadata evaluation, which is the only context that markers get evaluated in?

@sbidoul
Copy link
Member Author

sbidoul commented Jun 4, 2022

In other words, the extra key is only for dependency metadata evaluation, which is the only context that markers get evaluated in?

Yes exactly. That is why I think it is better to set it in evaluate() rather than default_environment() which could be used in other contexts than marker evaluation (as in, "just give me the environment of the running interpreter").

Also, #550 did change the expected result in the test of default_environment() (which I revert here). I think that might cause issues downstream and that was not necessary to achieve the goal of that PR.

@sbidoul sbidoul changed the title Do not set extra in default_environment Do not set extra in default_environment() Jun 4, 2022
@pradyunsg pradyunsg merged commit 33255b7 into pypa:main Jun 4, 2022
@sbidoul sbidoul deleted the no-extra-in-default_environment-sbi branch June 4, 2022 20:56
hrnciar pushed a commit to hrnciar/packaging that referenced this pull request Jul 1, 2022
PEP 508 says explicitly that the presence of extra in an environment
except in special cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants