Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poetry update --no-dev removes dev dependencies #5468

Closed
2 of 3 tasks
DMRobertson opened this issue Apr 19, 2022 · 3 comments
Closed
2 of 3 tasks

poetry update --no-dev removes dev dependencies #5468

DMRobertson opened this issue Apr 19, 2022 · 3 comments
Labels
kind/bug Something isn't working as expected

Comments

@DMRobertson
Copy link

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
    • No exception
  • OS version and name: Fedora 35
  • Poetry version:1.1.12
  • Link of a Gist with the contents of your pyproject.toml file: See below

Issue

Suppose we have a project with runtime and development dependencies. We may want to try running the project with the newest version of all runtime dependencies, but without updating development dependencies. For example, in matrix-org/synapse#12472 I wanted to run typecheckers against the latest version of all runtime dependencies, without bumping the version of mypy in use.

One attempt I had to do this was to use poetry update --no-dev. This correctly updated my lockfile but removed all development dependencies---not what I expected!

For a minimal example: given the following pyproject.toml file

$ cat pyproject.toml 
[tool.poetry]
name = "example"
version = "0.1.0"
description = ""
authors = ["David Robertson <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.7"
bottle = "*"

[tool.poetry.dev-dependencies]
black = "^22.3.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
  • poetry install. This should install bottle, black, and black's dependencies.
  • poetry run pip list to confirm the contents of the venv.
  • poetry update --no-dev. This removes black's dependencies, leaving only bottle behind.
  • poetry run pip list to confirm the contents of the venv.
@DMRobertson DMRobertson added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Apr 19, 2022
@DMRobertson
Copy link
Author

I've just tried this on current master and can't reproduce the issue. It even warns me that --no-dev is deprecated. In any case, hopefully having the issue written up makes this behaviour searchable for those of us who don't want to live on the bleeding edge.

#3139 might be related?

@mkniewallner mkniewallner removed the status/triage This issue needs to be triaged label Jun 11, 2022
@DMRobertson
Copy link
Author

Came across this today, but this time with poetry install --no-dev. This comment in particular explains the behaviour in poetry 1.x.

Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants