python-poetry / python-poetry/poetry

Poetry removes numpy for some versions of python and pandas

Open
#5,102 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug status/triage
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

  • 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).
  • OS version and name:
System
Platform: darwin
OS:       posix
Python:   /usr/local/opt/python@3.10/Frameworks/Python.framework/Versions/3.10
  • Poetry version: Poetry version 1.1.12

Issue

pyproject.toml:

[tool.poetry]
name = "test"
version = "0.1.0"
description = ""
authors = [""]

[tool.poetry.dependencies]
python = "^3.9"
pandas = "^1.3.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

If I run poetry update with the pyproject.toml shown above, the correct dependencies are installed. If I change the Python version to python = "~3.9" and run poetry update again, poetry shows:

Updating dependencies
Resolving dependencies... (0.1s)

Writing lock file

Package operations: 0 installs, 0 updates, 1 removal

  • Removing numpy (1.22.1)

This seems wrong, since pandas won't run without numpy. What's going on here?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with the supplied pyproject.toml, first using python = "^3.9" and then python = "~3.9", and run poetry update. Trace the dependency-resolution path responsible for removing numpy even though pandas is installed; done means the resolver handles this constraint consistently and the scenario has regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.