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

normalize source vcs urls #701

Merged
merged 1 commit into from
Feb 24, 2024

Conversation

abn
Copy link
Member

@abn abn commented Feb 24, 2024

This change ensures when referencing source url for package specifications of source type "git" or for VCS dependencies, a normalized version returned at all times.

Relates-to: python-poetry/poetry#8999

This change should ensure that we write out a valid url for cases where git@github.com:org/project.git us used as source url.

This change ensures when referencing source url for package
specifications of source type "git" or for VCS dependencies, a
normalized version returned at all times.

Relates-to: python-poetry/poetry#8999
@abn abn force-pushed the vcs-normalize-source-url branch from 78ddf35 to 346e6fc Compare February 24, 2024 01:58
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

abn added a commit to abn/poetry that referenced this pull request Feb 24, 2024
@abn
Copy link
Member Author

abn commented Feb 24, 2024

Downstream tests created at python-poetry/poetry#9007

@abn abn requested a review from a team February 24, 2024 02:10
@radoering
Copy link
Member

FYI: According to https://secure.phabricator.com/T11004, git@example.org:demo/demo.git and ssh://git@example.org/demo/demo.git might not be equivalent in general (for other hosts than github), but maybe we can assume it anyway. 🤷 I mentioned this at pypa/packaging.python.org#1506 (comment), too.

@abn
Copy link
Member Author

abn commented Feb 24, 2024

I considered this. While it is a bit unclear how reliably this is true, we already make this assumption in the code elsewhere.

parsed_url = git.ParsedUrl.parse(self._source)
if parsed_url.protocol is not None:
requirement += f" @ {self._vcs}+{self._source}"
else:
requirement += f" @ {self._vcs}+ssh://{parsed_url.format()}"

So, I suspect, for right now this is an alright assumption.

@radoering radoering merged commit 71d26d7 into python-poetry:main Feb 24, 2024
19 checks passed
@abn abn deleted the vcs-normalize-source-url branch February 25, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants