[metadata]
license_files =
../LICENSE.txt
../NOTICE.txt
setuptools does not break software that uses a non-standard layout and reference license files from a parent directory.
Traceback (most recent call last):
File "/home/cheimes/tmp/arrow-apache-arrow-19.0.1/python/setup.py", line 399, in <module>
setup(
File "/home/cheimes/tmp/arrow-apache-arrow-19.0.1/python/venv/lib64/python3.9/site-packages/setuptools/__init__.py", line 116, in setup
_install_setup_requires(attrs)
File "/home/cheimes/tmp/arrow-apache-arrow-19.0.1/python/venv/lib64/python3.9/site-packages/setuptools/__init__.py", line 87, in _install_setup_requires
dist.parse_config_files(ignore_option_errors=True)
File "/home/cheimes/tmp/arrow-apache-arrow-19.0.1/python/venv/lib64/python3.9/site-packages/setuptools/dist.py", line 752, in parse_config_files
self._finalize_license_files()
File "/home/cheimes/tmp/arrow-apache-arrow-19.0.1/python/venv/lib64/python3.9/site-packages/setuptools/dist.py", line 466, in _finalize_license_files
self.metadata.license_files = list(unique_everseen(files))
File "/home/cheimes/tmp/arrow-apache-arrow-19.0.1/python/venv/lib64/python3.9/site-packages/setuptools/_vendor/more_itertools/recipes.py", line 511, in unique_everseen
for element in iterable:
File "/home/cheimes/tmp/arrow-apache-arrow-19.0.1/python/venv/lib64/python3.9/site-packages/setuptools/dist.py", line 483, in <genexpr>
for path in sorted(cls._find_pattern(pattern, enforce_match))
File "/home/cheimes/tmp/arrow-apache-arrow-19.0.1/python/venv/lib64/python3.9/site-packages/setuptools/dist.py", line 506, in _find_pattern
raise InvalidConfigError(f"Pattern {pattern!r} cannot contain '..'")
setuptools.errors.InvalidConfigError: Pattern '../LICENSE.txt' cannot contain '..'
setuptools version
77.0.1
Python version
any
OS
any
Additional environment information
No response
Description
The new license file validation logic from #4838 breaks projects that have a non-standard layout. Projects like Apache Arrow or Triton don't have their Python code in the root directory of the sources. Instead it is in a subdirectory, typically called
python. For example Apache Arrow has apython/setup.cfgwithExpected behavior
setuptools does not break software that uses a non-standard layout and reference license files from a parent directory.
How to Reproduce
cd arrow-apache-arrow-19.0.1/pythonpython3 -m venv venv. venv/bin/activatepip install -U setuptools cythonpython3 setup.pyOutput