Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Ensure _apply_pyproject sets field on dist.metadata object not on dist#4834

Merged
abravalheri merged 1 commit into
pypa:feature/pep639from
abravalheri:apply_pyproject
Feb 18, 2025
Merged

Ensure _apply_pyproject sets field on dist.metadata object not on dist#4834
abravalheri merged 1 commit into
pypa:feature/pep639from
abravalheri:apply_pyproject

Conversation

@abravalheri

@abravalheri abravalheri commented Feb 17, 2025

Copy link
Copy Markdown
Contributor

Summary of changes

Not sure why the tests where not failing, but I think this is the way we ensure dist.metadata.license_expression gets set instead of dist.license_expression.

(I guess the test hasattr(dist.metadata, field) is true? Is it always true? If not when it is false?)

Pull Request Checklist

@abravalheri

Copy link
Copy Markdown
Contributor Author

/cc @cdce8p

@abravalheri abravalheri marked this pull request as ready for review February 17, 2025 18:36
@abravalheri abravalheri mentioned this pull request Feb 17, 2025
6 tasks

@cdce8p cdce8p left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(I guess the test hasattr(dist.metadata, field) is true? Is it always true? If not when it is false?)

I did add license_expression to _DISTUTILS_UNSUPPORTED_METADATA so it's always initialized to None on dist.metadata anyway.

_DISTUTILS_UNSUPPORTED_METADATA = {
'long_description_content_type': lambda: None,
'project_urls': dict,
'provides_extras': dict, # behaves like an ordered set
'license_expression': lambda: None,

@abravalheri abravalheri merged commit 0d0d516 into pypa:feature/pep639 Feb 18, 2025
@abravalheri abravalheri deleted the apply_pyproject branch February 18, 2025 10:45
@abravalheri

Copy link
Copy Markdown
Contributor Author

Thank you I will add it just in case.

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