Skip to content

pep639: setuptools license and license-files fields #2526

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

Merged
merged 2 commits into from
May 2, 2025

Conversation

bjlittle
Copy link
Member

This pull-request mops up some tech debt to comply with PEP639 for setuptools, also see license and license-files.

Additionally avoids the following setuptools deprecation warning:

!!
          ********************************************************************************
          Please consider removing the following classifiers in favor of a SPDX license expression:
          License :: OSI Approved :: BSD License
          See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
          ********************************************************************************
!!

See Deprecated license classifiers.

@greglucas
Copy link
Contributor

I've run into issues on other projects with uploads to pypi failing due to bad metadata when I've bumped this. Do you know how we can fix that? (I have either pinned to a lower setuptools, or set the flag to ignore the metadata check on upload)

Checking out this branch and building with python -m build . and then running twine check dist/* I get the following error:

Checking dist/cartopy-0.24.2.dev70+g5fc8006f-cp312-cp312-macosx_10_9_universal2.whl: ERROR    InvalidDistribution: Invalid distribution metadata: unrecognized or malformed field 'license-expression';
         unrecognized or malformed field 'license-file'

pyproject.toml Outdated
@@ -10,7 +10,7 @@ requires = [
# redistributors can do this by installing the numpy version they like and
# disabling build isolation.
"numpy>=2.0.0rc1",
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably bump this to be >=2.0.0 without the rc option.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done 👍

@bjlittle
Copy link
Member Author

bjlittle commented May 1, 2025

Checking out this branch and building with python -m build . and then running twine check dist/* I get the following error:

@greglucas Interesting. I can't replicate this 🤔

Checking out this branch, building the wheel and then checking with twine "just works" e.g.,

❯_ twine check dist/*
Checking dist/cartopy-0.24.2.dev71+g16c029f6-cp312-cp312-linux_x86_64.whl: PASSED
Checking dist/cartopy-0.24.2.dev71+g16c029f6.tar.gz: PASSED

In my environment (conda) I have the following top-level packages:

# Name                    Version                   Build  Channel
build                     1.2.2.post1              pypi_0    pypi
pip                       25.1               pyh8b19718_0    conda-forge
twine                     6.1.0              pyh29332c3_0    conda-forge
python                    3.12.10         h9e4cc4f_0_cpython    conda-forge
setuptools                80.1.0             pyhff2d567_0    conda-forge

Am I doing something different to yourself?

Copy link
Contributor

@greglucas greglucas left a comment

Choose a reason for hiding this comment

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

Interesting... I am not sure what happened on my end when testing. Sorry for the noise there! I just created a new environment and it looks good to me now too. Thanks for following up Bill!

@greglucas greglucas merged commit 89abc5b into SciTools:main May 2, 2025
34 of 37 checks passed
@QuLogic QuLogic added this to the 0.25 milestone Aug 10, 2025
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