Repository navigation
Closed
Labels
kind/bugSomething isn't working as expectedSomething isn't working as expected
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 (
-vvvoption).
- OS version and name: Fedora 31
- Poetry version: 1.1.0a1
Issue
Summary
Inside of a conda environment or a virtualenv, packages are discovered, but are not assigned a source_type attribute.
To reproduce the issue with conda:
- Create a new
condaenvironment, for exampleconda create --name poetry-fail-env python=3.7. Note I'm using the most recent release ofcondawhich is 4.8.3 - Activate the environment,
conda activate poetry-fail-env - Make the poetry project
poetry new poetry-fail-proj - Inside
poetry-fail-projrunpoetry install
Note that already packages are being updated despite being the most recent version:
Updating dependencies
Resolving dependencies... (0.2s)
Writing lock file
Package operations: 0 installs, 11 updates, 0 removals
- Updating zipp (3.1.0 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 3.1.0)
- Updating importlib-metadata (1.6.0 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 1.6.0)
- Updating pyparsing (2.4.7 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 2.4.7)
- Updating six (1.14.0 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 1.14.0)
- Updating attrs (19.3.0 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 19.3.0)
- Updating more-itertools (8.2.0 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 8.2.0)
- Updating packaging (20.3 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 20.3)
- Updating pluggy (0.13.1 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 0.13.1)
- Updating py (1.8.1 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 1.8.1)
- Updating wcwidth (0.1.9 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 0.1.9)
- Updating pytest (5.4.1 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 5.4.1)
- Installing poetry-fail-proj (0.1.0)
- Run
poetry update --dry-run
The packages are still marked for update:
Updating dependencies
Resolving dependencies... (0.2s)
Package operations: 0 installs, 11 updates, 0 removals, 2 skipped
- Updating zipp (3.1.0 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 3.1.0)
- Updating importlib-metadata (1.6.0 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 1.6.0)
- Updating pyparsing (2.4.7 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 2.4.7)
- Updating six (1.14.0 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 1.14.0)
- Skipping atomicwrites (1.3.0) Not needed for the current environment
- Updating attrs (19.3.0 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 19.3.0)
- Skipping colorama (0.4.3) Not needed for the current environment
- Updating more-itertools (8.2.0 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 8.2.0)
- Updating packaging (20.3 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 20.3)
- Updating pluggy (0.13.1 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 0.13.1)
- Updating py (1.8.1 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 1.8.1)
- Updating wcwidth (0.1.9 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 0.1.9)
- Updating pytest (5.4.1 /home/sean/.conda/envs/poetry-fail/lib/python3.7/site-packages -> 5.4.1)
Poetry debug info:
Poetry
Version: 1.1.0a1
Python: 3.7.6
Virtualenv
Python: 3.7.6
Implementation: CPython
Path: /home/sean/.conda/envs/poetry-fail
Valid: True
System
Platform: linux
OS: posix
Python: /home/sean/.conda/envs/poetry-fail
To reproduce the issue with virtualenv:
Same process as conda but use virtualenv instead.
poetry install
Installing dependencies from lock file
Package operations: 11 installs, 0 updates, 0 removals
- Installing zipp (3.1.0)
- Installing importlib-metadata (1.6.0)
- Installing pyparsing (2.4.7)
- Installing six (1.14.0)
- Installing attrs (19.3.0)
- Installing more-itertools (8.2.0)
- Installing packaging (20.3)
- Installing pluggy (0.13.1)
- Installing py (1.8.1)
- Installing wcwidth (0.1.9)
- Installing pytest (5.4.1)
- Installing poetry-fail-proj (0.1.0)
poetry update --dry run
Updating dependencies
Resolving dependencies... (0.6s)
Package operations: 0 installs, 11 updates, 0 removals, 2 skipped
- Updating zipp (3.1.0 /home/sean/.virtualenvs/poetry-test/lib/python3.7/site-packages -> 3.1.0)
- Updating importlib-metadata (1.6.0 /home/sean/.virtualenvs/poetry-test/lib/python3.7/site-packages -> 1.6.0)
- Updating pyparsing (2.4.7 /home/sean/.virtualenvs/poetry-test/lib/python3.7/site-packages -> 2.4.7)
- Updating six (1.14.0 /home/sean/.virtualenvs/poetry-test/lib/python3.7/site-packages -> 1.14.0)
- Skipping atomicwrites (1.3.0) Not needed for the current environment
- Updating attrs (19.3.0 /home/sean/.virtualenvs/poetry-test/lib/python3.7/site-packages -> 19.3.0)
- Skipping colorama (0.4.3) Not needed for the current environment
- Updating more-itertools (8.2.0 /home/sean/.virtualenvs/poetry-test/lib/python3.7/site-packages -> 8.2.0)
- Updating packaging (20.3 /home/sean/.virtualenvs/poetry-test/lib/python3.7/site-packages -> 20.3)
- Updating pluggy (0.13.1 /home/sean/.virtualenvs/poetry-test/lib/python3.7/site-packages -> 0.13.1)
- Updating py (1.8.1 /home/sean/.virtualenvs/poetry-test/lib/python3.7/site-packages -> 1.8.1)
- Updating wcwidth (0.1.9 /home/sean/.virtualenvs/poetry-test/lib/python3.7/site-packages -> 0.1.9)
- Updating pytest (5.4.1 /home/sean/.virtualenvs/poetry-test/lib/python3.7/site-packages -> 5.4.1)
Poetry debug info:
Poetry
Version: 1.1.0a1
Python: 3.7.6
Virtualenv
Python: 3.7.6
Implementation: CPython
Path: /home/sean/.virtualenvs/poetry-test
Valid: True
System
Platform: linux
OS: posix
Python: /usr
Investigation
Digging through the code, I found these line was triggering the updates:
elif package.source_type != pkg.source_type:
operations.append(Update(pkg, package))
where package.source_type is an empty string, but pkg.source_type is directory.
I'm not sure why the solver never assigns a value to source_type, but am happy to debug further asynchronously or via a video chat.
Unlike #1612, reverting to poetry 1.0.0 does not solve this problem.
Metadata
Metadata
Assignees
Labels
kind/bugSomething isn't working as expectedSomething isn't working as expected
Activity
[-]Conda environment causes `source_type` to not be assigned.[/-][+]`source_type` is not assigned, regardless of virtual environment[/+][-]`source_type` is not assigned, regardless of virtual environment[/-][+]source_type is not assigned, regardless of virtual environment[/+]Seanny123 commentedon Apr 13, 2020
Probably a duplicate of #1612 and almost definitely a duplicate of #2225. When #2225 is addressed, I will test and report back.
Seanny123 commentedon May 25, 2020
Currently can't figure out how to install Poetry from master, so I'm not yet able to test it until a new release is created.
Seanny123 commentedon May 25, 2020
Installing Poetry from master does indeed solves my problem when using
virtualenv, but somehow fails when usingconda. I'll make a new issue.Seanny123 commentedon May 25, 2020
Somehow, when I install
poetryfrom master by doing:poetry installThen activate it:
poetry shellWhich I verify with:
which poetryWhich gives:
/home/sean/.cache/pypoetry/virtualenvs/poetry-Y5_HnyyO-py3.8/bin/poetryThe bug is resolved. However, if I install
poetryin any other manner, such as in an existingcondaenvironment orvirtualenv, I get the same update error.But also, with
conda, I sometimes get the error:I guess the conclusion is that I should wait for a new version of poetry, so I can install it with
pipxand it will resolve the errors I'm having.Seanny123 commentedon Jun 12, 2020
For my own reference, this is not resolved in the
1.0.9Seanny123 commentedon Oct 1, 2020
Fully resolved in Poetry 1.1.0!
github-actions commentedon Mar 3, 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.