poetry-core icon indicating copy to clipboard operation
poetry-core copied to clipboard

Fix PEP508 formatting for subdirectory parameter

Open marink opened this issue 3 years ago • 6 comments

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.

marink avatar Mar 01 '22 05:03 marink

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

thanks for creating a fix for this!

aryarm avatar Mar 10 '22 16:03 aryarm

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

sonarqubecloud[bot] avatar Mar 16 '22 18:03 sonarqubecloud[bot]

@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

AKuederle avatar Jul 04 '22 08:07 AKuederle

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

aryarm avatar Jul 04 '22 15:07 aryarm

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: https://github.com/python-poetry/poetry-core/blob/d9ea915208dceae6ad9bb09b04bcfcb82e83f561/src/poetry/core/packages/vcs_dependency.py#L120

AKuederle avatar Jul 05 '22 07:07 AKuederle

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

sonarqubecloud[bot] avatar Aug 02 '22 15:08 sonarqubecloud[bot]

@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.

AKuederle avatar Aug 29 '22 08:08 AKuederle

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 avatar Aug 29 '22 15:08 radoering

Ah perfect! Thanks for handling that!

AKuederle avatar Aug 29 '22 15:08 AKuederle