<#23040 `generate-lockfiles` goal fails when contr...
# github-notifications
q
#23040 `generate-lockfiles` goal fails when contraints file includes VCS link Issue created by alextremblay with the following in `pants.toml`: [python.resolves_to_constraints_file] # pants lockfile generation has no mechanisms to only update a # specific package and its dependencies, it updates every package # to the latest version always. # Our workaround is to manage dependencies with uv, export # uv's lockfile as a pip-compatible contraints file, and tell pants # to use that constraints file when generating the pants lockfile. python-default = "uv.lock.txt" and this in the
uv.lock.txt
constraints file:
Copy code
nautobot @ git+<https://github.com/utsc-networking/nautobot@b8ec0a65737f3d61615ccdeb4a1aad7a85795cd7>
pants generate-lockfiles --resolve=python-default
fails with the following:
Copy code
$ pants generate-lockfiles --resolve=python-default
16:58:22.96 [WARN] /home/atremblay/.cache/nce/5c54a0c25255df2afb0525da856d49eb81b48cff0e32a9c868f77a296af24319/bindings/venvs/2.30.0/lib/python3.11/site-packages/pants/init/options_initializer.py:14: UserWarning: pkg_resources is deprecated as an API. See <https://setuptools.pypa.io/en/latest/pkg_resources.html>. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  import pkg_resources

16:58:24.44 [INFO] Completed: Scheduling: Test binary /bin/bash.
16:58:24.44 [INFO] Completed: Scheduling: Test binary /usr/bin/bash.
16:58:24.45 [INFO] Completed: Scheduling: Resolving plugins: robotpajamas.pants.scie, setuptools_scm
16:58:24.48 [INFO] Completed: Scheduling: Extracting plugin locations
16:58:25.15 [INFO] Generating synthetic targets for SyntheticPythonAppTargetsRequest(path='src/apps') at src/apps
16:58:25.41 [INFO] Completed: Scheduling: Test binary /bin/tar.
16:58:25.41 [INFO] Completed: Scheduling: Test binary /usr/bin/tar.
16:58:25.45 [INFO] Completed: Scheduling: Extract cpython-3.10.19%2B20251014-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz
16:58:25.77 [INFO] Completed: Scheduling: Install Python 3.10.19
16:58:27.26 [INFO] Completed: Generate lockfile for python-default
16:58:27.26 [INFO] Completed: Scheduling: Generate lockfile for python-default
16:58:27.26 [ERROR] 1 Exception encountered:

Engine traceback:
  in `generate-lockfiles` goal

ProcessExecutionFailure: Process 'Generate lockfile for python-default' failed with exit code 1.
stdout:

stderr:
/tmp/pants-sandbox-yZkr5n/uv.lock.txt line 865:
nautobot @ git+<https://github.com/utsc-networking/nautobot@b8ec0a65737f3d61615ccdeb4a1aad7a85795cd7>

Constraint files do not support VCS, URL or local project requirementsand they do not support requirements with extras. Search for 'We are also changing our support for Constraints Files' here: <https://pip.pypa.io/en/stable/user_guide/#changes-to-the-pip-dependency-resolver-in-20-3-2020>.


Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.
I don't know where this error message is coming from, but it's operating on outdated information. pip removed support for URL links inside constraint files in 2020, and then re-added support in 2021 with PR#9673 AFAIK, this error message should not be occuring Pants version 2.30.0 OS Linux Additional info Add any other information about the problem here, such as attachments or links to gists, if relevant. pantsbuild/pants