Skip to content

make support for pixi add --pypi source dependencies. #1078

Description

@ruben-arts

Problem description

It would be nice for the users to add source dependencies from the command line. Like pip and uv do.

e.g.:

pixi add --pypi "SomeProject@git+https://git.repo/[email protected]"
pixi add --pypi  --editable .  
pixi add --pypi path/to/project --editable  

This needs some further ideas!

Activity

  1. tdejager commented on Mar 29, 2024

    @tdejager
    Contributor

    pixi add --pypi -e . should be a no-op when using a pyproject.toml and we merge #1084 because this will be done by default.

  2. ruben-arts commented on May 13, 2024

    @ruben-arts
    ContributorAuthor

    Initial work is done some left over improvements that we would really like to support as well:

    # Relative paths
    pixi add --pypi "bla @ ./../../path/to/package"
    pixi add --pypi "bla @ ./../../path/to/package.whl"
    
    # Git Tags/Branches
    pixi add --pypi "bla @ git+https://github.com/prefix-dev/[email protected]"
    pixi add --pypi "bla @ git+https://github.com/prefix-dev/pixi-py@develop"
    
    # Nameless requirements
    pixi add --pypi ./path/to/package
    pixi add --pypi .
    pixi add --pypi path/to/wheel.whl
    pixi add --pypi https://github.com/prefix-dev/pixi-py@develop
    
  3. rlshuhart commented on Jan 31, 2025

    @rlshuhart

    Just throwing my 2 cents here. At my organization, we have an internal package on github. As with any package, there maybe breaking changes for various reasons. Unfortunately, I feel blocked from using pixi by not being able to use Git Tags/Branches. I certainly appreciate all the effort that has gone into pixi, so thank you @ruben-arts and all the others.

  4. ruben-arts commented on Jan 31, 2025

    @ruben-arts
    ContributorAuthor

    Hi @rlshuhart, thank you! We actually do support Git tag and branch now since last release. Did you try that already?

    Here is more of the documentation: https://pixi.sh/latest/reference/cli/#add

    e.g.:

    pixi add --git https://github.com/repo/user --branch main
    
  5. rlshuhart commented on Jan 31, 2025

    @rlshuhart

    @ruben-arts Completely missed this update. The use of tag is working! This made my week and I can now bring this to my team as something we can use!

    I assumed since this issue was open the features were not implemented. Is it worth keeping this issue open or to close it to avoid confusing people like me?

  6. ruben-arts commented on Feb 1, 2025

    @ruben-arts
    ContributorAuthor

    I'm leaving the issue open as we still have to implement the nameless and path dependencies in pixi add.

  7. bgmeulem commented on May 12, 2025

    @bgmeulem

    Hi

    Unsure what the progress here is, but I may have found a bug that hasn't been mentioned here yet. Do let me know if it's already tracked somewhere else (I couldn't find any mention)

    On the latest pixi (0.46.0), the workflow as described above works, but only for the default environment.

    If I do

    pixi add --pypi "name @ file://path/to/whl"

    It works. It's added to my project.dependencies list, it appears in my pixi list, and I can import it and verify the version number matches the build.

    If I however

    pixi add --pypi "name @ file://path/to/whl" --feature test

    It's added to my dependency-groups.test list. Apart from that, it's like it doesn't exist. It doesn't appear in my pixi list of any corresponding environment that uses the feature test, and I can't import it in an environment that uses the feature test.

    Same behavior when adding a .tar.gz instead of a wheel.

    Other dependencies do not have this issue. My dependency-groups.test list e.g. also has blosc, which does show up in pixi list and is importable in corresponding environments.

  8. samufi commented on Oct 11, 2025

    @samufi

    For me this works with absolute paths, but (why) is there no support for relative paths? This is a very common use case, for example when testing local packages.

  9. tdejager commented on Oct 11, 2025

    @tdejager
    Contributor

    Yeah it's basically a technical limitation for the CLI only, that we should fix at some point, it works fine if you modifying the manifest though.

  10. samufi commented on Oct 11, 2025

    @samufi

    Ah, nice. Could you tell me what I would need to put into the toml or point me to a corresponding source? I found the doc with the absolute path, maybe a small hint about the current limitation and how to circumvent it would be useful until it is fixed...

  11. hunger commented on Jun 30, 2026

    @hunger
    Contributor

    @tdejager :

    Error:   × failed to solve the pypi requirements of environment 'default' for platform 'linux-64'
      ├─▶ Failed to download and build `someproject @ git+https://git.repo/[email protected]`
      ├─▶ Git operation failed
      ├─▶ failed to clone into: /var/home/tobias/.cache/rattler/cache/uv-cache/git-v0/db/4ae564eb4046e32e
      ├─▶ failed to fetch branch or tag `1.3.1`
      ╰─▶ process didn't exit successfully: `/var/home/pixi/.pixi/bin/git fetch --force --update-head-ok 'https://git.repo/some_pkg.git' '+refs/tags/1.3.1:refs/remotes/origin/tags/1.3.1'` (exit
          status: 128)
          --- stderr
          fatal: unable to access 'https://git.repo/some_pkg.git/': Could not resolve host: git.repo
    

    Besides the package not existing, it seems to work. With lockfile-v7 we also support relative paths in the lock file. Can we close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpypi

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions