Skip to content

Fix PEP508 formatting for subdirectory parameter#300

Closed
marink wants to merge 4 commits intopython-poetry:mainfrom
marink:master
Closed

Fix PEP508 formatting for subdirectory parameter#300
marink wants to merge 4 commits intopython-poetry:mainfrom
marink:master

Conversation

@marink
Copy link
Copy Markdown

@marink marink commented Mar 1, 2022

Resolves: python-poetry#Fix for git subdirectories #288

There is a minor adjustment to fix #288. It was missing the '=' sign when specifying the Git subdirectory to load.

Copy link
Copy Markdown
Member

@finswimmer finswimmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot 👍

Can you please add a test for it?

@aryarm
Copy link
Copy Markdown

aryarm commented Mar 10, 2022

just chiming in to say that I'm encountering this issue, as well

thanks for creating a fix for this!

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@AKuederle
Copy link
Copy Markdown

@marink @finswimmer is there anything I could do to help getting this merged?

As @finswimmer mentioned, this is missing a test. @marink I think the right place to add one would be here: https://github.com/python-poetry/poetry-core/blob/main/tests/packages/test_vcs_dependency.py

And if I understand the structure correctly, a valid test could look something like this:

def test_to_pep_508() -> None:
    dependency = VCSDependency(
        "poetry", "git", "https://github.com/python-poetry/poetry.git", directory="subdir"
    )

    expected = "poetry @ git+https://github.com/python-poetry/poetry.git#subdirectory=subdir"

    assert dependency.to_pep_508() == expected

@aryarm
Copy link
Copy Markdown

aryarm commented Jul 4, 2022

I think this PR can be closed, since #288 has been merged, and I believe it already implements this fix?

@AKuederle
Copy link
Copy Markdown

AKuederle commented Jul 5, 2022

Actually no. #288 fixed parsing URLs that contain the sub-directory syntax. This PR fixes recreating the URL correctly so that other package managers can install a package that is managed by poetry and has a dependency with a sub-directory

The issue fixed here is still in master:

requirement += f"#subdirectory{self._directory}"

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Aug 2, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@AKuederle
Copy link
Copy Markdown

@marink Could you have a look at the example test that I posated a couple of comments up? I think that would be a sufficient test. If you add this we could move this PR forward.

@radoering
Copy link
Copy Markdown
Member

It seems this one has been duplicated by #451, which got merged without a test. (Sorry about that.)

Later I added the missing test (and some more) in #453. Thus, nothing to do here.

@radoering radoering closed this Aug 29, 2022
@AKuederle
Copy link
Copy Markdown

Ah perfect! Thanks for handling that!

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.

5 participants