-
Notifications
You must be signed in to change notification settings - Fork 153
Description
Consider an exemplar project, example, in a directory containing only a blank example.py and the following pyproject.toml:
[build-system]
requires = ["flit_core~=3.10.0"]
build-backend = "flit_core.buildapi"
[project]
name = "example"
version = "1"
description = "example"
license.file = "LICENCE.rst"
requires-python = ">=3.9"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.filedoes 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?
- If not (2), can flit-core raise an error?
Thanks,
Adam
cc @cdce8p
[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.