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

Extra dependencies for package on private repo uninstalled when running poetry install. #3224

Closed
3 tasks done
iksteen opened this issue Oct 16, 2020 · 5 comments
Closed
3 tasks done
Labels
kind/bug Something isn't working as expected

Comments

@iksteen
Copy link

iksteen commented Oct 16, 2020

Issue

After installing a package with extras from a private repository and running poetry install again, the extra dependencies are uninstalled. For easy reproducibility I've created a private repository that's publicly accessible and contains a single package (iksteen-aaa).

$ poetry add iksteen-aaa -E example
Using version ^0.1.0 for iksteen-aaa

Updating dependencies
Resolving dependencies... (1.6s)

Writing lock file

Package operations: 9 installs, 0 updates, 0 removals

  • Installing pycparser (2.20)
  • Installing cffi (1.14.3)
  • Installing pyasn1 (0.4.8)
  • Installing six (1.15.0)
  • Installing cryptography (3.1.1)
  • Installing ecdsa (0.14.1)
  • Installing rsa (4.6)
  • Installing python-jose (3.2.0)
  • Installing iksteen-aaa (0.1.0)
  • Run poetry install again and see the extra dependencies getting uninstalled:
$ poetry install
Installing dependencies from lock file

Package operations: 0 installs, 0 updates, 8 removals

  • Removing cffi (1.14.3)
  • Removing cryptography (3.1.1)
  • Removing ecdsa (0.14.1)
  • Removing pyasn1 (0.4.8)
  • Removing pycparser (2.20)
  • Removing python-jose (3.2.0)
  • Removing rsa (4.6)
  • Removing six (1.15.0)

When adding the package in a different way, f.e. by adding the wheel by its direct URL https://pypi.thegraveyard.org/api/package/iksteen-aaa/iksteen_aaa-0.1.0-py3-none-any.whl, the uninstalling of the extra dependencies does NOT occur.

@iksteen iksteen added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 16, 2020
@abn
Copy link
Member

abn commented Oct 16, 2020

@iksteen first off, thank you for the extremely useful bug report! 👍

Did a bit of digging; seems the issue is the way we parse the extras from the lock file. I have a hotfix for 1.1 and a proper fix for 1.2. Will put up a PR soon.

@abn abn removed the status/triage This issue needs to be triaged label Oct 16, 2020
@iksteen
Copy link
Author

iksteen commented Oct 16, 2020

@abn That's awesome! Thanks for the quick triage!

abn added a commit to abn/poetry that referenced this issue Oct 16, 2020
Previously, when using locked repository, incorrect dependency instance
was created when a dependency's extra requirement activated a
nested extra. This change ensures that these are correctly
loaded.

As part of this change new lock files write PEP 508 serialised form of
extra dependencies in order to reuse core logic to parse specification
of extra requirement.

Resolves: python-poetry#3224
@abn
Copy link
Member

abn commented Oct 16, 2020

@iksteen Good bug reports help :)

Can you please try the fix at #3229.

Using pipx

pipx install --suffix=@3229 'poetry @ git+https://github.com/python-poetry/poetry.git@refs/pull/3229/head'

Using a container (podman | docker)

podman run --rm -i --entrypoint bash python:3.8 <<EOF
set -xe
python -m pip install -q git+https://github.com/python-poetry/poetry.git@refs/pull/3229/head
install -d foobar
pushd foobar
curl -sLO https://gist.githubusercontent.com/iksteen/83a3d5b55a8274bfbb434d72676fea70/raw/c981a55f957f61766be0ff7c77e169017aaf8d56/pyproject.toml
poetry install --no-root
poetry add iksteen-aaa -E example
poetry install --no-root
EOF

@iksteen
Copy link
Author

iksteen commented Oct 17, 2020

Works for me!

abn added a commit to abn/poetry that referenced this issue Oct 23, 2020
Previously, when using locked repository, incorrect dependency instance
was created when a dependency's extra requirement activated a
nested extra. This change ensures that these are correctly
loaded.

As part of this change new lock files write PEP 508 serialised form of
extra dependencies in order to reuse core logic to parse specification
of extra requirement.

Resolves: python-poetry#3224
@abn abn closed this as completed in 89e1d7c Oct 23, 2020
Copy link

github-actions bot commented Mar 2, 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 2, 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