Open georgieprojie opened 1 month ago
also, i would actually like to know if any backend ever was tested and was specified in the pyproject.toml, and if so, i would really appreciate an example :)
I have experienced the same behavior
Sorry for the trouble.
To help debug this, a minimal reproducing example will make sure we're all looking at the same problem. Can you construct one? I'd hope for a project with only a handful of files, where we can run pants package
and see the error you've encountered.
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
resources(name="pyproject", sources=["pyproject.toml"])
python_distribution(
name="dist",
dependencies=[
":pyproject",
"./pkg",
],
provides=python_artifact(
name="my-pkg",
version="1.0.0",
),
)
Works fine for me on 2.21.
I want to generate a whl file from a package i wrote. to do that i use the python_distribution target. my dependencies contain a resource, which a pyproject.toml file is it's source.
my pyproject.toml contains:
until here everything is great, only that when i actually run
pants package
, i get an error:ValueError: /tmp/{some sandbox dir}/chroot/{mytargetname} does not contain any element.
after some research and debugging poetry itself with pants, i found out that the problem is that the pyproject.toml is copied to the tmp directory, and when poetry api starts trying to build the package, it thinks that the root directory (where the packages should actually be) is in the tmp sandbox dir, which are not (maybe you should copy the package files into the sandbox dir?)
I would really appreciate if you could validate me and check this bug, and maybe upload an example of a project that generates a whl package with poetry as it's backend?
im using pants version 2.21.0 on a wsl platform
thanks in advance!