cold-cricket-31243
01/09/2025, 7:58 PMcold-cricket-31243
01/09/2025, 8:17 PMpants.toml
[python-repos]
indexes = [
"<https://test.pypi.org/simple/>"
]
ref: https://www.pantsbuild.org/dev/reference/subsystems/python-repos#indexescold-cricket-31243
01/09/2025, 9:24 PMpants help goals
. I have the package installed as a local plugin and it works as expected. I'm having a hard time figuring out what I'm missing from the documentation. Does anyone have any ideas for what I'm doing wrong?happy-kitchen-89482
01/10/2025, 1:04 AMhappy-kitchen-89482
01/10/2025, 1:04 AMcold-cricket-31243
01/10/2025, 1:36 PMhappy-kitchen-89482
01/10/2025, 3:44 PMhappy-kitchen-89482
01/10/2025, 3:45 PMpants help goals
in one or both cases?happy-kitchen-89482
01/10/2025, 3:56 PMhappy-kitchen-89482
01/10/2025, 3:56 PMEngine traceback:
in `generate-lockfiles` goal
UnrecognizedResolveNamesError: Unrecognized resolve name from the field `resolve` in the target example-uv-project:reqs#numpy: python-default
All valid resolve names: ['pants-uv-lifecycle-plugin']
happy-kitchen-89482
01/10/2025, 3:57 PMhappy-kitchen-89482
01/10/2025, 3:58 PMhappy-kitchen-89482
01/10/2025, 3:58 PMcold-cricket-31243
01/10/2025, 4:20 PMpants test ::
doesn't work. Working to resolve that now.
Re: the problem mentioned at the top of the thread...
Within pants-uv-lifecycle-plugin
repo, you can run pants goals help
and you'll see uv-sync
listed.
Goals
-----
uv-sync Run `uv sync`.
When you run pants uv-sync
from the project root, the last line of the output should be the following.
`uv sync` successfully completed for all pyproject.toml-based projects.
The reason the plugin is working in the repo is because I've got the pants.toml
to reference the plugin locally. Relevant info from `pants.toml`:
[GLOBAL]
pants_version = "2.23.0"
pythonpath=["%(buildroot)s/src"]
backend_packages = [
# This will activate `src/pants-uv-lifecycle-plugin/register.py`.
"pants_uv_lifecycle_plugin",
...
]
[source]
root_patterns = [
"src",
...
]
I've published the plugin on Test PyPi: https://test.pypi.org/project/pants-uv-lifecycle-plugin/. The wheel file only contains the contents of the pants-uv-lifecycle-plugin/src
directory. I've created a separate pants project that has the following pants.toml
file.
[GLOBAL]
pants_version = "2.23.0"
backend_packages = [
# This will build the custom plugin code
"pants.backend.python",
]
plugins = [
"pants-uv-lifecycle-plugin==0.1.2",
]
[python]
enable_resolves = true
interpreter_constraints = [ ">=3.9"]
[python-repos]
indexes = [
"<https://test.pypi.org/simple/>",
"<https://pypi.org/simple/>"
]
I am able to run pants tailor ::
and it runs successfully, but when I run pants goals help
the uv-sync
plugin is not present.happy-kitchen-89482
01/10/2025, 4:49 PMpants uv-sync
also does not work in that case?cold-cricket-31243
01/10/2025, 4:50 PMmargaretblack pants-uv-lifecycle-plugin-test % pants uv-sync
Unknown goal: uv-sync
Use `pants help` to get help.
Use `pants help goals` to list goals.
happy-kitchen-89482
01/10/2025, 4:53 PMhappy-kitchen-89482
01/11/2025, 4:29 PMbackend_packages
?happy-kitchen-89482
01/11/2025, 4:30 PMhappy-kitchen-89482
01/11/2025, 4:30 PMhappy-kitchen-89482
01/11/2025, 4:30 PMcold-cricket-31243
01/13/2025, 1:27 PMbackend_packages
. Adding it there resolved the issue. Thank you!happy-kitchen-89482
01/13/2025, 3:26 PM