Skip to content

Git submodule cloning not working when using relative paths #9822

@breuninger-dgrimm

Description

@breuninger-dgrimm

Hey,

I am really enjoying uv because I think it's the best Python package manager around. However, I have one problem which keeps me from using it at the moment.

I might have found a bug or I am doing something wrong.

Let's assume I have a repo mylib with a .gitmodule file that looks like this:

[submodule "helpers"]
   path = helpers
   url = ../../utilities/helpers.git

The repo is hosted on a private Gitlab instance.

I will run

uv pip install 'mylib@git+ssh://git@gitlab.mycompany.de/.../mylib.git'

This fails with the following error:

  ├─▶ Git operation failed
  ╰─▶ process didn't exit successfully: `/usr/bin/git submodule update --recursive --init` (exit status: 1)
      --- stderr
      Submodule 'helpers' (/Users/ebuser/.cache/uv/git-v0/utilities/helpers.git) registered for path 'helpers'
      fatal: repository '/Users/ebuser/.cache/uv/git-v0/utilities/helpers.git' does not exist
      fatal: clone of '/Users/ebuser/.cache/uv/git-v0/utilities/helpers.git' into submodule path '/Users/ebuser/.cache/uv/git-v0/checkouts/9f3d7b05f0eb7565/abd7aca/helpers' failed
      Failed to clone 'helpers'. Retry scheduled
      fatal: repository '/Users/ebuser/.cache/uv/git-v0/utilities/helpers.git' does not exist
      fatal: clone of '/Users/ebuser/.cache/uv/git-v0/utilities/helpers.git' into submodule path '/Users/ebuser/.cache/uv/git-v0/checkouts/9f3d7b05f0eb7565/abd7aca/helpers' failed
      Failed to clone 'helpers' a second time, aborting

I am assuming that uv interprets the .gitmodule references with the relative paths as local references. However, when I clone the library manually and run git submodule update --recursive --init it works fine.

When I run pip install git+ssh://git@gitlab.mycompany.de/.../mylib.git, it works just fine.

I also never had problems with poetry and this library.

I am a bit lost here. Can you give me a hint if I'm doing something wrong and how I can fix it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedContribution especially encouraged

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions