plain-engine-91215
05/27/2025, 9:04 AM[source]
marker_filenames = ["pyproject.toml"]
[python]
interpreter_constraints = ["==3.11.*"]
enable_resolves = true
default_resolve = "poetry"
[python.resolves]
poetry = "pyproject.toml"
pyproject.toml
[project]
name = "abc"
version = "0.1.0"
description = ""
authors = []
readme = "README.md"
requires-python = ">=3.11"
When I run
pants check ::
I get the error
ValueError: Invalid requirement '[project]' in pyproject.toml at line 1: Parse error at "'[project'": Expected W:(0-9A-Za-z)
Which indicates that pants is unable to parse the pyproject.toml file poetry generated. Pants version is 2.24.0 and poetry version is 2.1.3. Thanks in advance for any help.gorgeous-winter-99296
05/27/2025, 9:09 AM[python.resolves]
to point at the pyproject.toml, it should point at your lockfile. You then create a python_requirements
or poetry_requirements
to use the pyproject.toml for generating that lockfile.plain-engine-91215
05/27/2025, 3:24 PMValueError: Invalid requirement '[[package]]' in poetry.lock at line 3: Parse error at "'[[packag'": Expected W:(0-9A-Za-z)
With this configuration in pants.toml
[source]
marker_filenames = ["pyproject.toml"]
[python]
interpreter_constraints = ["==3.11.*"]
enable_resolves = true
default_resolve = "poetry"
[python.resolves]
poetry = "poetry.lock"
And poetry.lock
# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand.
[[package]]
name = "aiohappyeyeballs"
version = "2.6.1"
description = "Happy Eyeballs for asyncio"
optional = false
python-versions = ">=3.9"
groups = ["main"]
files = [
{file = "aiohappyeyeballs-2.6.1-py3-none-any.whl", hash = "sha256:f349ba8f4b75cb25c99c5c2d84e997e485204d2902a9597802b0371f09331fb8"},
{file = "aiohappyeyeballs-2.6.1.tar.gz", hash = "sha256:c3f9d0113123803ccadfdf3f0faa505bc78e6a72d1cc4806cbd719826e943558"},
]
gorgeous-winter-99296
05/27/2025, 6:15 PMpants.lock
instead, or just remove the poetry lock.