You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that the licence file, LICENCE.rst, does not exist in the project directory. With flit-core 3.10, wheels build with python -m build --wheel, and the project is installable with python -m pip install .. Sdist creation fails, but this is not required for pip install ..
Updating to flit-core 3.11, we observe an error noting that the licence file does not exist (flit_core.config.ConfigError: License file LICENCE.rst does not exist). Suppose that the licence file is actually located in the parent directory of the pyproject.toml file (e.g. a multi-language project, or a mono-repo). An initial attempt at using relative paths (licence.file = "../LICENCE.rst" finishes with no errors, but the file is not included in the sdist, and is included directly in .dist-info in the wheel, rather than in the licences directory.
Thus my questions:
Is it possible to preserve flit-core 3.10 behaviour when building wheels if the licence file given in licence.file does not exist? I'm unsure if this is compatible with Metadata 2.4, though.
Are relative paths in license.file (e.g. ../LICENCE.rst) allowed? [1]
If (2), is there a bug with relative file handling in source/built distributions?
[1] PEP 639 forbids such paths in licence-files, but I'm unclear on licence.file. PEP 621 is silent on the matter, and unhelpfully the text and file tables seem to have been removed from the specification, even though they're only deprecated.
P.S. If useful, the project where this came up is https://github.com/AA-Turner/Roman-Numerals. I've tried to minimise the above and make it context-free, though. I'm prevented from updating to the PEP 639 style metadata in this project as the licence expression is 0BSD OR CC-1.0. This is just the first time that a new Flit release has ever caused an error for me, though -- a testament to the project.
The text was updated successfully, but these errors were encountered:
Pointing to a license file that doesn't exist should always have been an error, but it wasn't checked until now, because we didn't really do anything with LICENSE files. I should have anticipated that someone may have accidentally created a file that worked up until now.
I don't think we can allow a license file in the parent directory, because we can't put that into the sdist - the sdist has to have a single top-level directory containing pyproject.toml, and I don't want to try to rewrite pyproject.toml to change paths when we build the sdist. We already forbid parent directories for the sdist include & exclude lists.
Pointing to a license file in a parent directory should raise a clear error; I'm somewhat surprised that it doesn't already do so. Hopefully adding a check for that won't break many more packages. 🤞
Consider an exemplar project,
example
, in a directory containing only a blankexample.py
and the followingpyproject.toml
:Note that the licence file,
LICENCE.rst
, does not exist in the project directory. With flit-core 3.10, wheels build withpython -m build --wheel
, and the project is installable withpython -m pip install .
. Sdist creation fails, but this is not required forpip install .
.Updating to flit-core 3.11, we observe an error noting that the licence file does not exist (
flit_core.config.ConfigError: License file LICENCE.rst does not exist
). Suppose that the licence file is actually located in the parent directory of thepyproject.toml
file (e.g. a multi-language project, or a mono-repo). An initial attempt at using relative paths (licence.file = "../LICENCE.rst"
finishes with no errors, but the file is not included in the sdist, and is included directly in.dist-info
in the wheel, rather than in thelicences
directory.Thus my questions:
licence.file
does not exist? I'm unsure if this is compatible with Metadata 2.4, though.license.file
(e.g.../LICENCE.rst
) allowed? [1]Thanks,
Adam
cc @cdce8p
[1] PEP 639 forbids such paths in
licence-files
, but I'm unclear onlicence.file
. PEP 621 is silent on the matter, and unhelpfully thetext
andfile
tables seem to have been removed from the specification, even though they're only deprecated.P.S. If useful, the project where this came up is https://github.com/AA-Turner/Roman-Numerals. I've tried to minimise the above and make it context-free, though. I'm prevented from updating to the PEP 639 style metadata in this project as the licence expression is
0BSD OR CC-1.0
. This is just the first time that a new Flit release has ever caused an error for me, though -- a testament to the project.The text was updated successfully, but these errors were encountered: