<#22886 Unable to run pants lock when using both p...
# github-notifications
q
#22886 Unable to run pants lock when using both python-repos.indexes and pants_requirements Issue created by bobthemighty Describe the bug We use a custom index for installing Torch across architectures, with the following stanza in pants.toml
Copy code
[python-repos]
indexes = [
    "<https://pypi.org/simple/>",
    "pytorch_cpu=<https://download.pytorch.org/whl/cpu>"
]
We also use pants_requirements to set up the deps for our internal plugins. We have recently updated to take advantage of the PR we raised for multi-arch lockfiles, but we are now unable to run
pants lock
. The root cause, per the error message, seems to be that in this commit the pants_requirements target added an index for pants, which has no alias, and that conflicts with the "pypi.org/simple" index that we have added in pants.toml. It's possible that I'm just holding it wrong, but this smells like a bug. Pants version 2.30 OS Both Additional info
Copy code
❯ pants generate-lockfiles --resolve=inference
10:49:16.36 [WARN] /home/bob/.cache/nce/5c54a0c25255df2afb0525da856d49eb81b48cff0e32a9c868f77a296af24319/bindings/venvs/2.30.0a0/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

/home/bob/.cache/nce/5c54a0c25255df2afb0525da856d49eb81b48cff0e32a9c868f77a296af24319/bindings/venvs/2.30.0a0/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
10:49:18.10 [INFO] Initializing scheduler...
10:49:18.20 [INFO] Scheduler initialized.
10:49:19.83 [INFO] Completed: Scheduling: Find interpreter for constraints: CPython<3.12,>=3.11
10:49:20.68 [INFO] Completed: Generate lockfile for inference
10:49:20.68 [INFO] Completed: Scheduling: Generate lockfile for inference
10:49:20.68 [ERROR] 1 Exception encountered:

Engine traceback:
  in root
    ..
  in pants.core.goals.generate_lockfiles.generate_lockfiles_goal
    `generate-lockfiles` goal

Traceback (most recent call last):
  File "/home/bob/.cache/nce/5c54a0c25255df2afb0525da856d49eb81b48cff0e32a9c868f77a296af24319/bindings/venvs/2.30.0a0/lib/python3.11/site-packages/pants/core/goals/generate_lockfiles.py", line 569, in generate_lockfiles_goal
    results = await concurrently(
              ^^^^^^^^^^^^^^^^^^^
... <SNIP>
pants.engine.process.ProcessExecutionFailure: Process 'Generate lockfile for inference' failed with exit code 1.
stdout:

stderr:
The following names are being re-used across indexes and find links repos:
Package repository names must be unique.
Repro is here: https://github.com/carbon-re/pants-resolve-issue pantsbuild/pants
🙋 1