Skip to content

uv pip install does not install git+ssh:// dependency declared in setup.cfg #1853

Closed
@SnoopJ

Description

@SnoopJ

Platform: Ubuntu 22.04
uv version: 0.1.6 (da3a7ec)

When checking that #1781 resolves the problem with cloning a private repository (and it does seem to), I encountered a new (to me) problem with resolving a git requirement declared in setup.cfg. Installing the requirement given in setup.cfg directly in the pip install invocation does succeed, so it seems likely this is a problem with understanding the project metadata.

Reproduction

Run uv pip install "acmelib @ /path/to/acmelib_repo" to install a package on the local filesystem that declares a git+ssh:// dependency in setup.cfg against a private GitHub repository.

Sharing below the best reproduction details that I can, with some of the names changed to sanitize the private stuff.

$ uv venv
Using Python 3.9.14 interpreter at /home/jgerity/.pyenv/versions/3.9.14/bin/python3.9
Creating virtualenv at: .venv
Activate with: source .venv/bin/activate
$ source .venv/bin/activate
$ uv pip install "acmelib @ /home/jgerity/acme/acmelib_repo"  # attempting a direct install of the parent package fails
error: Package `metrics` attempted to resolve via URL: git+ssh://[email protected]/acme/python-metrics.git@develop. URL dependencies must be expressed as direct requirements or constraints. Consider adding `metrics @ git+ssh://[email protected]/acme/python-metrics.git@develop` to your dependencies or constraints file.
$ grep "python-metrics" /home/jgerity/acme/acmelib_repo/setup.cfg
    metrics @ git+ssh://[email protected]/acme/python-metrics.git@develop
$ uv pip install "acmelib @ /home/jgerity/acme/acmelib_repo"
error: Package `metrics` attempted to resolve via URL: git+ssh://[email protected]/acme/python-metrics.git@develop. URL dependencies must be expressed as direct requirements or constraints. Consider adding `metrics @ git+ssh://[email protected]/acme/python-metrics.git@develop` to your dependencies or constraints file.
$ uv pip install -v "acmelib @ /home/jgerity/acme/acmelib_repo"
 uv::requirements::from_source source=acmelib @ /home/jgerity/acme/acmelib_repo
    0.005665s DEBUG uv_interpreter::virtual_env Found a virtualenv through VIRTUAL_ENV at: /tmp/.venv
    0.005922s DEBUG uv_interpreter::interpreter Using cached markers for: /tmp/.venv/bin/python
    0.005941s DEBUG uv::commands::pip_install Using Python 3.8.10 environment at /tmp/.venv/bin/python
    0.006449s DEBUG uv_client::registry_client Using registry request timeout of 300s
 uv_client::flat_index::from_entries 
 uv_resolver::resolver::solve 
      0.008116s   0ms DEBUG uv_resolver::resolver Solving with target Python version 3.8.10
   uv_resolver::resolver::choose_version package=root
   uv_resolver::resolver::get_dependencies package=root, version=0a0.dev0
        0.008216s   0ms DEBUG uv_resolver::resolver Adding direct dependency: acmelib*
   uv_resolver::resolver::choose_version package=acmelib
        0.008311s   0ms DEBUG uv_resolver::resolver Searching for a compatible version of acmelib @ file:///home/jgerity/acme/acmelib_repo (*)
 uv_resolver::resolver::process_request request=Metadata acmelib @ file:///home/jgerity/acme/acmelib_repo
   uv_distribution::distribution_database::get_or_build_wheel_metadata dist=acmelib @ file:///home/jgerity/acme/acmelib_repo
        0.008882s   0ms DEBUG uv_distribution::source Using cached metadata for acmelib @ file:///home/jgerity/acme/acmelib_repo
   uv_resolver::resolver::get_dependencies package=acmelib, version=2.1.0rc1+10.g83f70bea
     uv_resolver::resolver::distributions_wait package_id=de82c87359640496
error: Package `metrics` attempted to resolve via URL: git+ssh://[email protected]/acme/python-metrics.git@develop. URL dependencies must be expressed as direct requirements or constraints. Consider adding `metrics @ git+ssh://[email protected]/acme/python-metrics.git@develop` to your dependencies or constraints file.
$ uv pip install "metrics @ git+ssh://[email protected]/acme/python-metrics.git@develop"  # installing the requirement directly *does* succeed
 Updated ssh://[email protected]/acme/python-metrics.git (4a3a73f)                                                                                                      Resolved 42 packages in 1.34s
Installed 42 packages in 378ms
... package list ...

Metadata

Metadata

Assignees

Labels

enhancementNew feature or improvement to existing functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions