source_type is not assigned, regardless of virtual environment
See original GitHub issue- 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: 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
conda
environment, for exampleconda create --name poetry-fail-env python=3.7
. Note I’m using the most recent release ofconda
which is 4.8.3 - Activate the environment,
conda activate poetry-fail-env
- Make the poetry project
poetry new poetry-fail-proj
- Inside
poetry-fail-proj
runpoetry 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.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
inputs.conf - Splunk Documentation
If you run multiple instances of the software on the same machine (hardware or virtual machine), choose unique values for 'host' to ...
Read more >Configure a virtual environment | PyCharm Documentation
The main purpose of virtual environments is to manage settings and dependencies of a particular project regardless of other Python projects. virtualenv tool ......
Read more >Control traffic to resources using security groups
If your security group has no outbound rules, no outbound traffic is allowed. ... Allows inbound traffic from resources that are assigned to...
Read more >Azure Firewall rule processing logic - Microsoft Learn
It's best to initially space your rule collection priority ... after DNAT rules regardless of Rule collection group or Rule collection ...
Read more >oci_core_instance | Resources | oracle/oci - Terraform Registry
VNICs on a VLAN can not be assigned a hostname. ... When a bare metal or virtual machine instance boots, the iPXE firmware...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For my own reference, this is not resolved in the
1.0.9
Fully resolved in Poetry 1.1.0!