All jobs

Fix "SetuptoolsDeprecationWarning: License classifiers are deprecated" and "project.license as a TOML table is deprecated"

Yes. An agent rewrites project.license as an SPDX expression, drops the License classifier, raises the setuptools floor, and compares the wheel metadata.

Run this on RushOpens the console with this prompt ready to send, in a Project that has your repository.

What the agent does

The agent reads the packaging metadata and the pipelines that build it, because the fix changes what every published wheel declares. In a tool like nickdiego/compiledb, pyproject.toml has [build-system] requires = ["setuptools>=64", "setuptools-scm>=8", "wheel"], license = {text = "GPL-3.0-or-later"} as a table, and a classifier License :: OSI Approved :: GNU General Public License v3 (GPLv3) beside requires-python = ">=3.3". .github/workflows/test.yml installs .[dev] on Python 3.8 through 3.11 on Ubuntu and macOS and runs flake8 and pytest; publish.yml runs python3 -m build on a tag push and uploads with the PyPI publish action. tox.ini carries the pytest configuration.

Then it builds. With a current setuptools, 84.2.1 on the day of the run, python -m build --wheel prints two blocks, each twice: WARNING project.license as a TOML table is deprecated, telling you to use a simple string containing an SPDX expression and project.license-files, both available on setuptools 77.0.0 and later, with a deadline of 2027-Feb-18 after which such builds will no longer be supported; and WARNING License classifiers are deprecated., asking you to remove the GPLv3 classifier in favour of an SPDX expression. The old wheel's METADATA reads License: GPL-3.0-or-later plus the classifier line.

The fix is three edits in pyproject.toml: license = "GPL-3.0-or-later" as a string, the License :: classifier removed, and setuptools>=77 in build-system.requires, the first release that understands the string form. The wheel entry can go too; the build ran without it. The rebuilt wheel's METADATA carries License-Expression: GPL-3.0-or-later and no license classifier, with License-File: LICENSE still present and Metadata-Version: 2.4 as before. The build prints zero warnings.

Then it checks the matrix, which is where this change has a cost. setuptools 77.0.3 declares Requires-Python: >=3.9, so the 3.8 job in test.yml can no longer satisfy the build requirement, and the newest setuptools needs 3.10. The agent runs the suite on the sandbox's Python 3.11: 15 tests pass and flake8 is clean. Because the shallow checkout has no tags, it sets SETUPTOOLS_SCM_PRETEND_VERSION for the local build and says so, since setuptools-scm reads the version from git.

Start it with one API call

POST https://api.phoenix.so/o/{org}/sessions with this body:

{
  "agent": "claude",
  "input": "Our package build prints \"SetuptoolsDeprecationWarning: License classifiers are deprecated\" and \"project.license as a TOML table is deprecated\". Read pyproject.toml and the workflows that build and publish the package, say which setuptools the build resolves and quote each warning once, then rewrite project.license as an SPDX expression, remove the License classifier, and raise the build-system setuptools floor to the first release that supports the string form. Build the wheel before and after and diff the License lines of its METADATA, run the tests and the linter, and open a pull request that also states which Python versions in CI the new floor drops.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
  1. Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
  2. Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
  3. Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

What comes back

A pull request that edits pyproject.toml only: the license string, the removed classifier and the setuptools>=77 floor. The description quotes both warnings as printed, shows the METADATA lines before (License: plus the classifier) and after (License-Expression:), and reports 15 tests passed and a clean flake8 run on Python 3.11.

A reviewer checks that the SPDX expression matches the LICENSE file, GPL version 3 here, that nothing else in the metadata moved, and reads the note on CI: setuptools 77 needs Python 3.9 or newer, so the 3.8 row of the test matrix cannot build with the new floor and is either dropped or kept on an older setuptools on purpose.

The description names the 2027-Feb-18 date from the warning as the point after which setuptools says such builds stop being supported, and leaves requires-python = ">=3.3" alone as a separate question for the maintainers.

Run it on every tagged release build

The warning shows on the build that publishes, so the trigger is the publish workflow. A step in that workflow posts the build log to a Rush webhook trigger with Authorization: Bearer and the trigger's secret when the log contains SetuptoolsDeprecationWarning, and the run opens the metadata pull request before the next tag.

For an organisation with many packages, your server sends this request once per repository, each with its own UUID as request_id so a retry returns the run already started, and reads each run.completed webhook; a key starts at most max_concurrent runs at once and queues the rest.

The use case this job follows, with its automation and trigger: Fix a bug from an alert.

Why run it on Rush?

The warning is easy to silence and easy to get subtly wrong: the SPDX string must match the licence file, the classifier must go, and the setuptools floor that makes the string legal also drops a Python version from CI. In a Rush sandbox the agent builds the wheel twice and diffs the metadata, so the pull request shows the exact METADATA lines that change rather than a claim that the warning is gone.

Packaging changes land on every future release of the package. The agent reads the publish workflow, reports the deadline the warning names, and spells out the CI consequence, so the reviewer decides about the 3.8 job with the facts in front of them.

Frequently asked questions

Which SPDX expression should I use?

The one that matches the LICENSE file. compiledb ships GPL version 3 with an or-later clause in its headers, so GPL-3.0-or-later is the expression. The agent reads the licence file and the source headers before choosing.

Why raise the setuptools floor at all?

Because setuptools before 77 rejects license as a plain string. Leaving setuptools>=64 would make the build fail on an older setuptools instead of warning. The floor is what makes the new form safe.

Does this drop Python 3.8?

For building from source, yes. setuptools 77.0.3 declares Requires-Python: >=3.9, so a 3.8 job that installs the package from a checkout cannot satisfy the build requirement. Installing the published wheel is unaffected. The pull request names the 3.8 row so the maintainers decide.

Do I need to touch the version or setuptools-scm?

No. The version stays dynamic from git tags. The agent sets SETUPTOOLS_SCM_PRETEND_VERSION only for its own build in a tagless checkout and says so in the description.

More setuptools jobs

More jobs like this: Fix a bug from an alert

Keep reading