Skip to content

'project.license-files' is defined already. Remove 'tool.setuptools.license-files' #10290

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

Closed
jeromehmu opened this issue Mar 20, 2025 · 1 comment · Fixed by #10289
Closed
Labels
Maintenance Discussion or action around maintaining pylint or the dev workflow
Milestone

Comments

@jeromehmu
Copy link

jeromehmu commented Mar 20, 2025

Bug description

I started randomly running into this issue in CI without any code changes and I'm confused as to why. I run pylint as part of pre-commit and during instantiation of pre-commit, I ran into the problem below. If this is better served in the pre-commit repo, please let me know.

Sure enough, going into the temporary repo in /home/jerome/.cache/pre-commit/repoyqo4j89l and modifying the pyproject.toml to remove that license line seems to fix it. I guess I'm also trying to sort out why it randomly broke in CI. We use python 3.11.3 and pip 23.3.2.

Configuration

Command used

pre-commit run

Pylint output

@potato-14:~/dev/potatoes$ pre-commit run
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /home/jerome/.cache/pre-commit/patch1742444585-2322408.
[INFO] Installing environment for https://github.com/PyCQA/pylint.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Restored changes from /home/jerome/.cache/pre-commit/patch1742444585-2322408.
An unexpected error has occurred: CalledProcessError: command: ('/home/jerome/.cache/pre-commit/repoyqo4j89l/py_env-python3.11/bin/python', '-mpip', 'install', '.')
return code: 1
stdout:
    Processing /home/jerome/.cache/pre-commit/repoyqo4j89l
      Installing build dependencies: started
      Installing build dependencies: finished with status 'done'
      Getting requirements to build wheel: started
      Getting requirements to build wheel: finished with status 'error'
stderr:
      error: subprocess-exited-with-error
      
      × Getting requirements to build wheel did not run successfully.
      │ exit code: 1
      ╰─> [49 lines of output]
          /tmp/pip-build-env-629gr4cw/overlay/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`.
          
                  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)
          Traceback (most recent call last):
            File "/home/jerome/.cache/pre-commit/repoyqo4j89l/py_env-python3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
              main()
            File "/home/jerome/.cache/pre-commit/repoyqo4j89l/py_env-python3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
              json_out["return_val"] = hook(**hook_input["kwargs"])
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/home/jerome/.cache/pre-commit/repoyqo4j89l/py_env-python3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
              return hook(config_settings)
                     ^^^^^^^^^^^^^^^^^^^^^
            File "/tmp/pip-build-env-629gr4cw/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
              return self._get_build_requires(config_settings, requirements=[])
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/tmp/pip-build-env-629gr4cw/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
              self.run_setup()
            File "/tmp/pip-build-env-629gr4cw/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 320, in run_setup
              exec(code, locals())
            File "<string>", line 1, in <module>
            File "/tmp/pip-build-env-629gr4cw/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 117, in setup
              return distutils.core.setup(**attrs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/tmp/pip-build-env-629gr4cw/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 160, in setup
              dist.parse_config_files()
            File "/home/jerome/.cache/pre-commit/repoyqo4j89l/py_env-python3.11/lib/python3.11/site-packages/_virtualenv.py", line 22, in parse_config_files
              result = old_parse_config_files(self, *args, **kwargs)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/tmp/pip-build-env-629gr4cw/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 748, in parse_config_files
              pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
            File "/tmp/pip-build-env-629gr4cw/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 73, in apply_configuration
              return _apply(dist, config, filepath)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/tmp/pip-build-env-629gr4cw/overlay/lib/python3.11/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 55, in apply
              _apply_tool_table(dist, config, filename)
            File "/tmp/pip-build-env-629gr4cw/overlay/lib/python3.11/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 94, in _apply_tool_table
              raise InvalidConfigError(
          setuptools.errors.InvalidConfigError: 'project.license-files' is defined already. Remove 'tool.setuptools.license-files'.
          [end of output]
      
      note: This error originates from a subprocess, and is likely not a problem with pip.
    error: subprocess-exited-with-error
    
    × Getting requirements to build wheel did not run successfully.
    │ exit code: 1
    ╰─> See above for output.
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
Check the log at /home/jerome/.cache/pre-commit/pre-commit.log

Expected behavior

pre-commit installs correctly

Pylint version

pylint 3.3.3
astroid 3.3.8
Python 3.11.3 | packaged by conda-forge | (main, Apr  6 2023, 08:57:19) [GCC 11.3.0]

OS / Environment

Ubuntu 24.04

Additional dependencies

pre-commit 4.2.0
@jeromehmu jeromehmu added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Mar 20, 2025
@jeromehmu
Copy link
Author

#10289 seems to fix the exact same issue. I guess I opened this issue 7 minutes too late

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining pylint or the dev workflow
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants