Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install from local git repo #1583

Open
yggdr opened this issue Dec 3, 2024 · 7 comments
Open

Cannot install from local git repo #1583

yggdr opened this issue Dec 3, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@yggdr
Copy link

yggdr commented Dec 3, 2024

Trying a few variations of pipx install <SPEC> always yields Unable to parse package spec:
I tried
/path/to/repo#<HASH>, git:///path/to/repo#<HASH>, git+file:///path/to/repo#<HASH>, git+files:///path/to/repo#<HASH>, and the same with .git added to end of the path.
Are local git operations unsupported?

@dukecat0 dukecat0 added the enhancement New feature or request label Dec 6, 2024
@huxuan
Copy link
Member

huxuan commented Jan 29, 2025

Instead of installing from local git repo, I would suggest to install from local directory directly. Just pipx install /path/to/repo should work. You can even use pipx install -e /path/to/repo and in this way, pipx will automatically change the installed application according to the commit of the local directory you checked out. I often use this to debug pipx. :-)

Will this resolve your problem?

@huxuan huxuan added the awaiting response Awaiting re-engagement by contributor label Jan 29, 2025
@yggdr
Copy link
Author

yggdr commented Feb 2, 2025

No, I specifically wanted to install from a certain commit in a repository, not from a directory. The repo happens to live in a local directory.

@huxuan
Copy link
Member

huxuan commented Feb 3, 2025

AFAIK, there is no standarized URI format with commit hash for local git repos, so I do not think pipx should (and easy for pipx to) "create" it. Just let me know if I am wrong.

For your use cases, I would suggest to git checkout the certain commit you want locally and pipx install or even pipx install -e as I have mentioned.

I will close this issue and feel free to reopen it if necessary.

@huxuan huxuan closed this as not planned Won't fix, can't repro, duplicate, stale Feb 3, 2025
@yggdr
Copy link
Author

yggdr commented Feb 3, 2025

It's part of PyPA: https://pip.pypa.io/en/latest/topics/vcs-support/

@huxuan
Copy link
Member

huxuan commented Feb 4, 2025

Sorry, I will further look into it. Thanks for the reference. Reopen the issue.

@huxuan huxuan reopened this Feb 4, 2025
@yggdr
Copy link
Author

yggdr commented Feb 4, 2025

Thank you very much :)

@dukecat0
Copy link
Member

dukecat0 commented Feb 4, 2025

It looks like we need to update the logic here:

def _parse_specifier(package_spec: str) -> ParsedPackage:

We should support path to local git repo as well.

@dukecat0 dukecat0 removed the awaiting response Awaiting re-engagement by contributor label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants