astral-sh / rye

a Hassle-Free Python Experience
https://rye.astral.sh
MIT License
13.6k stars 466 forks source link

Improve adding SSH git dependency #1195

Open niowniow opened 2 months ago

niowniow commented 2 months ago

Steps to Reproduce

1. Create empty project

rye init bugtest
cd bugtest

2. Add git dependency by copy URL from Github

image

rye add pandas --git git@github.com:pandas-dev/pandas.git
error: unable to interpret 'git@github.com:pandas-dev/pandas.git' as git reference

Caused by:
    relative URL without a base

3. Add ssh:// to URL

rye add pandas --git ssh://git@github.com:pandas-dev/pandas.git
error: unable to interpret 'ssh://git@github.com:pandas-dev/pandas.git' as git reference

Caused by:
    invalid port number

4. Modify URL by changing : to /

rye add pandas --git ssh://git@github.com/pandas-dev/pandas.git

This should work now!

Expected Result

Best case: I'm able to add a git SSH dependency using the copied link from Github/Gitlab Second best case: I can download from the link without having to change : to /

If that is undesired, I at least get infos on how to change the copied URL and/or it is documented in the documentation how to download using git SSH.

Actual Result

See above in "Steps to Reproduce"

Version Info

rye 0.35.0 commit: 0.35.0 (a1dbc56d4 2024-06-24) platform: linux (x86_64) self-python: cpython@3.12.0 symlink support: true uv enabled: true

Stacktrace

No response