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

'poetry install' fails on Mint with 'system-site-packages' opion #4022

Closed
1 of 3 tasks
vlad0337187 opened this issue May 2, 2021 · 6 comments
Closed
1 of 3 tasks
Labels
status/duplicate Duplicate issues

Comments

@vlad0337187
Copy link
Contributor

vlad0337187 commented May 2, 2021

  • 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).
  • Linux Mint 20.1:
  • master:
  • doesn't depend on pyproject.toml:

Issue

poetry install fails to complete if system-site-packages option was specified to True.

Steps to reproduce.

  • install Poetry from master: pipx install git+https://github.com/python-poetry/poetry.git
  • ensure that pip list has python-debian 0.1.36ubuntu1 package listed, if no - install it (apt install python-debian)
  • open terminal in any directory, run poetry init
  • enable system-site-packages: poetry config virtualenvs.options.system-site-packages true --local
  • run poetry install
  • see error: Invalid PEP 440 version: '0.1.36ubuntu1'

It fails only on Linux Mint 20.1, should fail and on Ubuntu 20.04 too.

As I see, this is not actually a Poetry but, but but with python3-debian apt package, which specified not PEP 440-compliant version.

Reported this to Ubuntu bug tracker

I think this issue should be here until this will be fixed in Ubuntu or Mint or Debian side.

Workaround:

  • specify valid version in /usr/lib/python3/dist-packages/python_debian-0.1.36ubuntu1.egg-info/PKG-INFO
  • also in /usr/lib/python3/dist-packages/debian/_version.py
  • valid version: 0.1.36+ubuntu1
@vlad0337187 vlad0337187 added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels May 2, 2021
@vlad0337187 vlad0337187 changed the title Poetry install fails on Mint with system-site-packages opion 'poetry install' fails on Mint with system-site-packages opion May 2, 2021
@vlad0337187 vlad0337187 changed the title 'poetry install' fails on Mint with system-site-packages opion 'poetry install' fails on Mint with 'system-site-packages' opion May 2, 2021
@abn
Copy link
Member

abn commented May 2, 2021

Considering the issue is, as you have pointed out, in the distro provided package I am wondering what is gained by keeping this one open as there is not real action required on the poetry side.

Or are you considering that poetry should handle this less strict? (this will be a step backwads imho)

@vlad0337187
Copy link
Contributor Author

@abn , I think we should track: will that issue be resolved or at least be going to be resolved.

If no - probably, to don't handle versions naming less strict, but add exception for a specific (python-debian) package.

I consider this to be issue with Poetry too, because freshly installed Poetry will crash on freshly installed system (Mint).

@dephekt
Copy link

dephekt commented Jul 4, 2021

Marked this on Launchpad as affecting me too, so at least it shows confirmed. The backstory for me is: for gpgme Python bindings the gnupg-recommend way of installing them is using the system package as that will always be compatible with your system-installed gnupg2 version and is well-maintained by the distribution's maintainers.

The version installed on PyPi with pip install gpg is 3 years old and may not be compatible from one developer to the next if their system gnupg2 version does not match the Python gpgme bindings. In order to adopt Poetry for the torbrowser-launcher project, I need to use the new system-site-packages config in 1.2.0a1 so I can tell developers "install python3-gpg using your system's package manager then run poetry install" to get their local dev environment configured properly.

I completely agree that the issue is not with Poetry, but it would be absolutely fantastic if there was an option to be less strict/pedantic in this particular context. This way, we could still adopt and use Poetry today and not be blocked waiting for the distribution to roll out a fix for the versioning.

Alternatively, if there was some way of specifying what packages from the system site packages we want included, that would solve my particular issue, e.g. I only need the system gpg package available, I don't need debian (the problematic module in this case) or other system site packages. E.g. if I could say something like this in my pyproject.toml, it would be awesome:

gpg = { version = "*", use-system = true }

I considered using Pipenv temporarily since it doesn't seem to care about this issue when specifying --site-packages but there are numerous reasons why I do not like Pipenv and opinions it has that make it difficult to use for this particular project, so I don't have any good solution at the moment.

@mmorton
Copy link

mmorton commented Jul 6, 2021

I'm running into the same issue on Ubuntu 20.04 LTS. The project I am working on requires a Python library, dlib, which has to be compiled from source in order to use CUDA; It is then installed into dist-packages. There are other project dependencies that require this one, but right now, my only option is to not track any of those dependencies, neither dlib or the packages that depend on it, with Poetry.

@neersighted
Copy link
Member

Dupe #6013

@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Oct 1, 2022
@neersighted neersighted added status/duplicate Duplicate issues and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 1, 2022
Copy link

github-actions bot commented Mar 1, 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 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/duplicate Duplicate issues
Projects
None yet
Development

No branches or pull requests

5 participants