Skip to content

Support for PEP 639 license specifiers in pyproject.toml #2206

@luziferius

Description

@luziferius

Pip-tools seems incompatible with PEP 639-compatible license specifications in pyproject.toml. Trying to implement that causes pip-tools to fail when parsing the file.

With a pip-tools compatible pyproject.toml file, new setuptools versions say this:

/tmp/build-env-jaz9xswi/lib/python3.13/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.
        ********************************************************************************

!!

So there are about 7 months left, until setuptools becomes incompatible with pip-tools.

Following the link given by setuptools gives a suggested fix:

[project]
license = "GPL-3.0-or-later"
# or
license = "MIT AND (Apache-2.0 OR BSD-2-Clause)"

Trying to apply this by replacing the license table in my project's pyproject.toml file results in the reported failure to run.

Environment Versions

  1. Linux
  2. Python version: Python 3.13.3
  3. pip version: 25.1.1
  4. pip-tools version: 7.4.1

Steps to replicate

  1. Have a PEP 639-compliant license specifier in pyproject.toml
  2. Run pip-compile

Expected result

Compiled requirements generated

Actual result

pip-tools compile outputs:

Backend subprocess exited when trying to invoke get_requires_for_build_wheel
Failed to parse /home/thomas/Projekte/MTGProxyPrinter/pyproject.toml

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidInvalid issue or PRquestionUser question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions