Skip to content

Issues with pyproject.toml #739

@Alexander88207

Description

@Alexander88207

Describe the bug

Hello,

when attempting to build version 1.12.0, I encounter errors related to the formatting of the pyproject.toml file.

While following these suggestions has helped resolve the issues on my end, I am curious whether this might be specific to FreeBSD or something that has never been properly triggered or used by other systems.

Thank you.

Steps to Reproduce

make using portstree.

Operating system

FreeBSD

Version

15.0

Installation method

Other (portstree)

Python version

3.11

Error message

/usr/local/lib/python3.11/site-packages/setuptools_scm/_integration/deprecation.py:7: UserWarning: pyproject.toml: at [tool.setuptools.dynamic]
version = {attr = ...} is forcing setuptools to override the version setuptools-scm did already set
When using setuptools-scm it's invalid to use setuptools dynamic version as well, please remove it.
Setuptools-scm is responsible for setting the version, forcing setuptools to override creates errors.
  warnings.warn(
/usr/local/lib/python3.11/site-packages/setuptools_scm/_integration/version_inference.py:51: UserWarning: version of None already set
  warnings.warn(self.message)
/usr/local/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py:104: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.
  warnings.warn(msg, _BetaConfiguration)
configuration error: `project.license` must be valid exactly by one definition (2 matches found):

    - keys:
        'file': {type: string}
      required: ['file']
    - keys:
        'text': {type: string}
      required: ['text']

DESCRIPTION:
    `Project license <https://www.python.org/dev/peps/pep-0621/#license>`_.

GIVEN VALUE:
    "GPL-3.0-or-later"

OFFENDING RULE: 'oneOf'

DEFINITION:
    {
        "oneOf": [
            {
                "properties": {
                    "file": {
                        "type": "string",
                        "$$description": [
                            "Relative path to the file (UTF-8) which contains the license for the",
                            "project."
                        ]
                    }
                },
                "required": [
                    "file"
                ]
            },
            {
                "properties": {
                    "text": {
                        "type": "string",
                        "$$description": [
                            "The license of the project whose meaning is that of the",
                            "`License field from the core metadata",
                            "<https://packaging.python.org/specifications/core-metadata/#license>`_."
                        ]
                    }
                },
                "required": [
                    "text"
                ]
            }
        ]
    }
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "setup.py", line 9, in <module>
    setup(use_scm_version={"version_scheme": mkversion})
  File "/usr/local/lib/python3.11/site-packages/setuptools/__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 151, in setup
    dist.parse_config_files()
  File "/usr/local/lib/python3.11/site-packages/setuptools/dist.py", line 868, in parse_config_files
    pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
  File "/usr/local/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 58, in apply_configuration
    config = read_configuration(filepath, True, ignore_option_errors, dist)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 122, in read_configuration
    validate(subset, filepath)
  File "/usr/local/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 47, in validate
    raise error from None
ValueError: invalid pyproject.toml config: `project.license`
*** Error code 1

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions