Skip to content

fix --with-credentials export of --extra-index-url lines#117

Merged
radoering merged 6 commits intopython-poetry:mainfrom
ejd:22-fix-index-url-export
Sep 10, 2022
Merged

fix --with-credentials export of --extra-index-url lines#117
radoering merged 6 commits intopython-poetry:mainfrom
ejd:22-fix-index-url-export

Conversation

@ejd
Copy link
Copy Markdown
Contributor

@ejd ejd commented Sep 7, 2022

Resolves: #22.

The fix for this issue is to add a single character: indexes_header = ... becomes indexes_header += ... within the loop that builds the --index-url and --extra-index-url lines of the exported text.

I added a test case to demonstrate the problem and prove to myself that I'd fixed it.

I had to run poetry lock to bump the poetry dependency to 1.2.0. The previously locked version, 1.2.0b3, didn't actually remove the PyPI repository from poetry.pool when my new test called poetry.pool.remove_repository("PyPI"). The implementation of that method changed from 1.2.0b3 to 1.2.0 to address exactly that issue. If it's possible to add a different default repository with 1.2.0b3, I'm happy to revert the poetry lock commit and modify the test case.

ejd added 3 commits September 6, 2022 18:41
Poetry 1.2.0 includes a change to
`poetry.repositories.pool.Pool.remove_repository` that allows actually
removing the PyPI repository.  The test added by this branch needs to
remove the default repository so it can add an alternate, custom
repository.
@ejd
Copy link
Copy Markdown
Contributor Author

ejd commented Sep 9, 2022

Is there anything I can do to help move this PR along? I'm not sure how to fix the security hotspots (or if I need to -- they seem like false positives.)

Comment thread tests/test_exporter.py Outdated
@radoering
Copy link
Copy Markdown
Member

I had to run poetry lock to bump the poetry dependency to 1.2.0.

IMO, it's ok if we depend on the released version of poetry and do not support betas anymore in the next plugin release. Can please revert your lockfile change, update the dependencies in pyproject.toml for poetry and poetry-core to depend on the releases and run poetry lock --no-update using poetry 1.2.

@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 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@radoering radoering merged commit afa3b6b into python-poetry:main Sep 10, 2022
@radoering radoering mentioned this pull request Sep 13, 2022
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.

Exported requirements.txt does not include --extra-index-url

3 participants