python-poetry / python-poetry/poetry
Command `poetry config repositories.PRIVATE_REPO_NAME` does not list if the repo is Default or not
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 34.3k
- Forks
- 2.5k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 30
Description
- I have searched the issues of this repo and believe that this is not a duplicate.
- I have searched the documentation and believe that my question is not covered.
Feature Request
I am writing a CI pipeline for my workplace, where for security requirements I want to ensure that all poetry-managed projects use a private repository as the only package resolver. In particular, I wish to have an easy way to check in a CI pipeline that a pyproject.toml file has the following structure:
[[tool.poetry.source]]
name = "PRIVATE_PYPI_SERVICE"
url = "https://internal.url.com/repository/simple"
default = true
I wished to use the poetry cli to determine this. However, when I run the command poetry config repositories.PRIVATE_PYPI_SERVICE I see the following output (prettified):
{
'url': 'https://internal.url.com/repository/simple'
}
I'd like that the poetry config command be enhanced to provide information if a repository listed is default or not. For the above example, I'd like the result to be:
{
'url': 'https://internal.url.com/repository/simple',
'default': true
}
In cases where the pyproject.toml adds a repository but omits the default selection, the default key would be present but default to false (which I believe is the default setting according to the poetry documentation).
I'm happy to contribute a PR to implement this functionality. Thank you!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the poetry config repositories.PRIVATE_PYPI_SERVICE output with the pyproject.toml source configuration shown in the issue. Trace the poetry config command's handling of repository settings and determine how the default selection is represented. Done means the output includes default: true for the selected repository and default: false when that setting is omitted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100