Skip to content

Fix incorrect build-system requirements #8558

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kurtmckee
Copy link

This change fixes incorrect build-system requirements and resolves deprecation warnings thrown in CI when building using the latest setuptools versions. [recent example]

/tmp/build-env-gfscc8yk/lib/python3.11/site-packages/setuptools/config/_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated
!!

        ********************************************************************************
        Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0).

        By 2026-Feb-18, you need to update your project and remove deprecated calls
        or your builds will no longer be supported.

        See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
        ********************************************************************************

!!
  corresp(dist, value, root_dir)
/tmp/build-env-gfscc8yk/lib/python3.11/site-packages/setuptools/config/_apply_pyprojecttoml.py:61: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!

        ********************************************************************************
        Please consider removing the following classifiers in favor of a SPDX license expression:

        License :: OSI Approved :: MIT License

        See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
        ********************************************************************************

!!
  dist._finalize_license_expression()
/tmp/build-env-gfscc8yk/lib/python3.11/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!

        ********************************************************************************
        Please consider removing the following classifiers in favor of a SPDX license expression:

        License :: OSI Approved :: MIT License

        See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
        ********************************************************************************

!!

Reproducing locally

Verifying the current minimum setuptools version

The current build-system requirements were confirmed to be unusable by running the following commands:

python3.10 -m venv .venv-build
echo '*' > .venv-build/.gitignore
source .venv-build/bin/activate

python -m pip install --upgrade pip
python -m pip install build setuptools==40.8.0

python -m build --no-isolation

This results in a crash from within setuptools.

Testing setuptools v77.0.0

The build-system was updated and retested. (Note that "wheel" is no longer a recommended requirement, and that setuptools v77.0.0 was never actually published.)

python -m pip install setuptools==77.0.1
python -m build --no-isolation

The build succeeded.

Resolving build warnings

Finally, the latest version of setuptools was installed and all warnings were resolved.

python -m pip install --upgrade setuptools
python -m build --no-isolation

The following warnings were displayed:

  • project.license as a TOML table is deprecated!!

    Please use a simple string containing a SPDX expression for project.license. You can also use project.license-files. (Both options available on setuptools>=77.0.0).

  • License classifiers are deprecated.

    Please consider removing the following classifiers in favor of a SPDX license expression:

    License :: OSI Approved :: MIT License

Therefore, the license and classifiers in pyproject.toml were also updated.

In addition, resolve deprecation warnings thrown in CI
when building using the latest setuptools versions.

The current `build-system` requirements were confirmed
to be unusable by running the following commands:

```
python3.10 -m venv .venv-build
echo '*' > .venv-build/.gitignore
source .venv-build/bin/activate

python -m pip install --upgrade pip
python -m pip install build setuptools==40.8.0

python -m build --no-isolation
```

This results in a crash from within setuptools.

Then, the `build-system` was updated and retested.
(Note that "wheel" is no longer a recommended requirement.)

```
python -m pip install setuptools==77.0.1
python -m build --no-isolation
```

The build succeeded.

Finally, the latest version of setuptools was installed
and all warnings were resolved.

```
python -m pip install --upgrade setuptools
python -m build --no-isolation
```

The following warnings were displayed:

* `project.license` as a TOML table is deprecated!!

  Please use a simple string containing a SPDX expression for `project.license`.
  You can also use `project.license-files`.
  (Both options available on setuptools>=77.0.0).

* License classifiers are deprecated.

  Please consider removing the following classifiers
  in favor of a SPDX license expression:

  `License :: OSI Approved :: MIT License`

(Note: setuptools 77.0.0 was never published,
so v77.0.1 is set as the lowest required version.)

Therefore, the `license` and `classifiers` in `pyproject.toml`
were also updated.
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.

1 participant