python-poetry / python-poetry/poetry
Improve semantics of argument terminator ("--") and avoid consuming it unnecessarily
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 34.3k
- Forks
- 2.5k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 30
Description
- Poetry version: Poetry (version 1.2.2)
- Python version: Python: 3.10.7
- OS version and name: Debian bookworm
- pyproject.toml:
- e.g.
streamlit = "^1.15.1"
- I am on the latest stable Poetry version, installed using a recommended method.
- I have searched the issues of this repo and believe that this is not a duplicate.
- I have consulted the FAQ and blog for any relevant entries or release notes.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption) and have included the output below.
Issue
Using poetry run it is possible to run commands which themselves might accept a -- e.g.
poetry run '--' streamlit run demo.py '--' --script-args
However, it can be the case that the first -- is omitted. In this case, poetry run is able to infer from the fact that it is not given a flag to start parsing the program and its arguments, however, it will still eat the first -- rather than passing it on. So if we run:
poetry run streamlit run demo.py '--' --script-args
Then --script-args will be passed to streamlit, which is not what we wanted. Poetry should only eat the -- before it has started parsing the program arguments.
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 with the poetry run command entry point and reproduce both examples from the issue, including the quoted -- arguments. Trace when poetry run begins parsing the program arguments; done means a terminator after parsing has started is passed through, while a terminator before parsing is consumed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100