You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setup: I have a python project setup in Termux with poetry that depends on packages like cryptography, numpy, lxml and pandas.
These libraries are installed using "pkg install python-cryptography" type commands, to make it available globally.
Poetry is configured to include "system-site-packages", so it can take advantage of globally installed packages rather than trying to install and compile them itself.
Problem" When running "poetry update", poetry thinks that globally installed package is different from the one in PiPy, and tries to "Update" it, causing compilation failures in my limited environment (the main reason why python-cryptography package is provided in the first place).
Root-cause: Managed to narrow it down to logic in src/poetry/core/packages/specification.py:is_same_source_as(), that thinks package is different, because source_url is different: None in PiPy vs "/home/builder/.termux-build/python-cryptography/src" in the Termux package.
Suggested fix: When manually removing direct_url.json from the respective folder, poetry happily accepts already installed package and is able to complete the update command successfully. Is it possible to adjust build procedure for all python packages to exclude addition of direct_url.json file in them?
What steps will reproduce the bug?
Install python-cryptography package
Create an empty python project with cryptography dependency of the same version
Create virtual environment for it and activate it
Install poetry in the environment
Run "poetry config virtualenvs.options.system-site-packages true" for vritualenv to allow seeing globally installed pip packages.
Run "poetry update". Command will fail, trying to compile the cryptography wheel.
I think we should get rid of direct_url.json (either by removing it, or specifying flags to pip so it's never created) - that fixes this issue and aligns with what at least debian/ubuntu and fedora does (for example, check dpkg -L python3-scipy | grep direct_url.json in ubuntu, compared to dpkg -L python-scipy | grep direct_url.json in termux.
Problem description
Setup: I have a python project setup in Termux with poetry that depends on packages like cryptography, numpy, lxml and pandas.
These libraries are installed using "pkg install python-cryptography" type commands, to make it available globally.
Poetry is configured to include "system-site-packages", so it can take advantage of globally installed packages rather than trying to install and compile them itself.
Problem" When running "poetry update", poetry thinks that globally installed package is different from the one in PiPy, and tries to "Update" it, causing compilation failures in my limited environment (the main reason why python-cryptography package is provided in the first place).
Root-cause: Managed to narrow it down to logic in src/poetry/core/packages/specification.py:is_same_source_as(), that thinks package is different, because source_url is different: None in PiPy vs "/home/builder/.termux-build/python-cryptography/src" in the Termux package.
Suggested fix: When manually removing direct_url.json from the respective folder, poetry happily accepts already installed package and is able to complete the update command successfully. Is it possible to adjust build procedure for all python packages to exclude addition of direct_url.json file in them?
What steps will reproduce the bug?
What is the expected behavior?
Successful completion of "poetry update"
System information
The text was updated successfully, but these errors were encountered: