python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.7k stars 2.27k forks source link

Poetry update in private repo removes secondary dependencis #9649

Closed martgra closed 2 months ago

martgra commented 2 months ago

Description

I'm adding a private repo as source poetry source add --priority=primary artrepo https:<MYREPO>//pypi/pypi-external/simple

Running poetry update removes a lot of secondary dependencies:

Package operations: 0 installs, 0 updates, 17 removals

  - Removing aiohappyeyeballs (2.4.0)
  - Removing aiohttp (3.10.5)
  - Removing aiosignal (1.3.1)
  - Removing annotated-types (0.7.0)
  - Removing attrs (24.2.0)
  - Removing distlib (0.3.8)
  - Removing distro (1.9.0)
  - Removing elastic-transport (8.15.0)
  - Removing filelock (3.15.4)
  - Removing frozenlist (1.4.1)
  - Removing httpcore (1.0.5)
  - Removing httpx (0.27.0)
  - Removing jiter (0.5.0)
  - Removing multidict (6.0.5)
  - Removing pydantic-core (2.20.1)
  - Removing tqdm (4.66.5)
  - Removing yarl (1.9.4)

Looking at my dependency tree it seems like dependencies of some explicitly added dependencies disappear with my private source.

An example is:

With pypi repo after updating.

pre-commit 2.21.0 A framework for managing and maintaining multi-language pre-commit hooks.
├── cfgv >=2.0.0
├── identify >=1.0.0
├── nodeenv >=0.11.1
├── pyyaml >=5.1
└── virtualenv >=20.10.0
    ├── distlib >=0.3.7,<1 
    ├── filelock >=3.12.2,<4 
    └── platformdirs >=3.9.1,<5 
pydantic 2.8.2 Data validation using Python type hints
├── annotated-types >=0.4.0
├── pydantic-core 2.20.1
│   └── typing-extensions >=4.6.0,<4.7.0 || >4.7.0 
├── typing-extensions >=4.12.2
└── typing-extensions >=4.6.1

with private repo after updating.

pre-commit 2.21.0 A framework for managing and maintaining multi-language pre-commit hooks.
├── cfgv >=2.0.0
├── identify >=1.0.0
├── nodeenv >=0.11.1
├── pyyaml >=5.1
└── virtualenv >=20.10.0
pydantic 2.8.2
pydantic-settings 2.4.0
pyjwt 2.9.0 JSON Web Token implementation in Python

I am unsure whether this is poetry or JFrog (which is my source) fault.

Workarounds

Using pypi directly or not updating.

Poetry Installation Method

pipx

Operating System

Ubuntu

Poetry Version

1.8.3

Poetry Configuration

cache-dir = "/home/user/.cache/pypoetry"
experimental.system-git-client = false
installer.max-workers = null
installer.modern-installation = true
installer.no-binary = null
installer.parallel = true
keyring.enabled = true
repositories.artrepo.url = "https://myrepo/artifactory/api/pypi/pypi-external/simple"
solver.lazy-wheel = true
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.no-setuptools = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"  # /home/user/.cache/pypoetry/virtualenvs
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{project_name}-py{python_version}"
warnings.export = true

Python Sysconfig

No response

Example pyproject.toml

No response

Poetry Runtime Logs

NA. To long. contact me for output file
dimbleby commented 2 months ago

if you don't provide a way to reproduce, it is unlikely anyone can help

maybe try clearing your poetry cache

martgra commented 2 months ago

if you don't provide a way to reproduce, it is unlikely anyone can help

maybe try clearing your poetry cache

Sure. But unclear how - I see there are some similar issues on JFrog. Seems like deleting poetry cache some difference. Would appreciate a pointer to this in the official doc if this is a known unstability or bug.

dimbleby commented 2 months ago

this smells of #9419 and its thousand duplicates

did clearing your cache solve the problem or not? if yes, please close the issue report

github-actions[bot] commented 1 month ago

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.