python-poetry / python-poetry/poetry
Enhance development/debugging support
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
Can poetry support development/debugging in a better way, especially for consumers who use pyc wheels for deployment and source code for development?
Consider the below examples/pyproject.toml:
The current behavior of poetry install --no-dev is to error out with a conflict. If deps is has a caret i.e., ^2.1.0, it installs from the source code.
It would have been more sensible for --no-dev to ignore the tool.poetry.dependencies.So, in scenario 1 and 2 it should have just installed Flask 2.1.0 and 2.1.2 (the latest available as on date) respectively.
The current behavior or poetry install is to error out with the same conflict as above. With caret, it installs Flask from source code; but without deps. When the section is removed from tool.dependencies, it installs from source code with deps.
It would have been more sensible to override the Flask key in tool.poetry.dev-dependencies over tool.poetry.dependencies. So, in scenario 1, 2 and 3 it should have just installed Flask from source code with all its deps.
This is quite similar to https://github.com/python-poetry/poetry/issues/2837; but I thought I will explain why it is good to have that feature.
Also, is it possible to activate a package that I am interested in (like mr.developer and pip install -e)? This is similar to https://github.com/python-poetry/poetry/issues/34, but I am trying to reuse an existing deployment environment for development/debugging. It should activate the package in development mode, using poetry.lock wherever possible.
Eventual goal is to have a single pyproject.toml file that can be used for development/deployment/debugging without much hassle.
Note: pip install -e . seems to works, but is there a recommended way?
[tool.poetry]
name = "poetry"
version = "0.1.0"
description = "Poetry"
authors = ["Nishant Varma"]
[tool.poetry.dependencies]
python = "^3.9"
flask = "2.1.0"
[tool.poetry.dev-dependencies]
flask = { git = "https://github.com/pallets/flask.git", branch = "main", develop = true }
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
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 described scenarios with the provided pyproject.toml and the poetry install --no-dev and poetry install commands. Read the existing documentation and the related issues #2837 and #34 to clarify the intended dependency override and development-mode behavior. Done should include an agreed, testable design covering deployment, development, and debugging workflows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100