Skip to content

Update the build-system requirements; resolve warnings and errors #327

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 2 commits into
base: main
Choose a base branch
from

Conversation

kurtmckee
Copy link
Contributor

The current situation

The current build-system requires setuptools 40.8.0 or higher. However, setuptools v40.8.0 doesn't have a build_meta submodule.

To demonstrate the problem, the following commands were run:

python3.13 -m venv venv-3.13
source venv-3.13/bin/activate
python -m pip install setuptools==40.8.0 build
python -m build --no-isolation

This results in the following error message:

$ python -m build --no-isolation
* Getting build dependencies for sdist...

Traceback (most recent call last):
  File ".../lib/python3.13/site-packages/pyproject_hooks/_impl.py", line 402, in _call_hook
    raise BackendUnavailable(
    ...<4 lines>...
    )
pyproject_hooks._impl.BackendUnavailable: Cannot import 'setuptools.build_meta'

ERROR Backend 'setuptools.build_meta' is not available.

Upgrading to the latest version of setuptools, 80.9.0, allows the package to build:

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

However, warnings are emitted:

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.
********************************************************************************
SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!

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

License :: OSI Approved :: Apache Software License

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

The solution

This change addresses the lower setuptools bound based on the warnings: it sets the setuptools minimum version to v77.0.1 (v77.0.0 was not released to PyPI).

In addition, it addresses the license-related warnings by switching to the SPDX short identifier "Apache-2.0" and by removing the License trove classifier.

With this change in place, the package can be built on the lowest supported setuptools version as well as the latest released version.

# The current situation

The current build-system requires setuptools 40.8.0 or higher.
However, setuptools v40.8.0 doesn't have a `build_meta` submodule.

To demonstrate the problem, the following commands were run:

```
python3.13 -m venv venv-3.13
source venv-3.13/bin/activate
python -m pip install setuptools==40.8.0 build
python -m build --no-isolation
```

This results in the following error message:

```
$ python -m build --no-isolation
* Getting build dependencies for sdist...

Traceback (most recent call last):
  File ".../lib/python3.13/site-packages/pyproject_hooks/_impl.py", line 402, in _call_hook
    raise BackendUnavailable(
    ...<4 lines>...
    )
pyproject_hooks._impl.BackendUnavailable: Cannot import 'setuptools.build_meta'

ERROR Backend 'setuptools.build_meta' is not available.
```

Upgrading to the latest version of setuptools, 80.9.0,
allows the package to build:

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

However, warnings are emitted:

```
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.
********************************************************************************
```

```
SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!

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

License :: OSI Approved :: Apache Software License

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

# The solution

This change addresses the lower setuptools bound based on the warnings:
it sets the setuptools minimum version to v77.0.1
(v77.0.0 was not released to PyPI).

In addition, it addresses the license-related warnings
by switching to the SPDX short identifier `"Apache-2.0"`
and by removing the `License` trove classifier.

With this change in place, the package can be built
on the lowest supported setuptools version
as well as the latest released version.
di
di previously approved these changes Jul 24, 2025
Copy link
Member

@di di left a comment

Choose a reason for hiding this comment

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

LGTM -- seems like there are unrelated linting failures on main right now, however.

From the PR comment:

> 77.0.3 fixes known early bugs of the PEP 639 implementation
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