FS#73867 - [python-poetry] ImportError: attempted relative import with no known parent package

Attached to Project: Community Packages
Opened by Devyn Keeney (devyntk) - Friday, 18 February 2022, 19:19 GMT
Last edited by Caleb Maclennan (alerque) - Monday, 02 May 2022, 08:49 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Caleb Maclennan (alerque)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Poetry fails to install the virtualenv correctly when using the packaged version. When installing using the "install-poetry.py" file that Poetry provides upstream, I am unable to reproduce.

Additional info:
* Poetry Version 1.1.13
* Upstream error: https://github.com/python-poetry/poetry/issues/5216
* pyproject.toml: https://github.com/first-illinois-robotics/firweb/blob/e54d45d91e52cbacccd9e55a114a6ae41c79e175/pyproject.toml
* error log: https://gist.github.com/devyntk/565b3cad4afc98f08729488f5f8921d9

Steps to reproduce:
* Install poetry via `pacman -S python-poetry`
* Attempt `poetry install` on the above pyproject.toml.
This task depends upon

Closed by  Caleb Maclennan (alerque)
Monday, 02 May 2022, 08:49 GMT
Reason for closing:  Fixed
Additional comments about closing:  python-poetry-1.1.13-3
Comment by Samuel (sammko) - Saturday, 19 February 2022, 22:30 GMT
Same problem here, installing anything at all. However, only happens on one of my machines, other one is fine. Both -Syu'd just now. Btw, did you do anything to get the stack traces? poetry doesn't print them for me, and there's https://github.com/python-poetry/poetry/issues/3050.
Comment by Samuel (sammko) - Saturday, 19 February 2022, 22:38 GMT
Figured it out. Just to confirm, you have python-packaging 21.0-1 from testing? 20.9-7 from extra works.

https://github.com/python-poetry/poetry/issues/4264. Has a link to a Fedora issue as well.
Comment by Travis Shirk (nicfit) - Saturday, 26 February 2022, 18:14 GMT
I see the same import issue and have python-packaging 20.9-7
Comment by Caleb Maclennan (alerque) - Sunday, 27 March 2022, 08:19 GMT
If this is still a problem and if it is a problem with the poetry package can somebody help out with an MWE showing how to replicate it? If it is a problem with python-packaging, perhaps this issue needs updating with the relevant package.
Comment by Devyn Keeney (devyntk) - Sunday, 27 March 2022, 14:41 GMT
I'm still getting this error when installing poetry from the repos, with python-packaging 20.9-7.
Comment by Stefan Tatschner (rumpelsepp) - Wednesday, 13 April 2022, 07:45 GMT
This error occured on my machine with python-packaging 21.3-1; python-packaging 20.9-7 works.
Comment by Caleb Maclennan (alerque) - Friday, 15 April 2022, 07:27 GMT
I added a relatively (pun intended) dirty patch from @felixonmars to work around this is in Arch packaging. I put it in [community-testing] for now and would appreciate some testing and either signoffs or comments here before it goes into the repo since I don't have working test cases for this.

pacman -U https://archlinux.org/packages/community-testing/any/python-poetry/download
Comment by Caleb Maclennan (alerque) - Friday, 22 April 2022, 07:22 GMT
No takers? A "high" priority bug report with 5 participants and nobody wants to say if the proposed package in testing fixes their problem?
Comment by Stefan Tatschner (rumpelsepp) - Friday, 22 April 2022, 08:37 GMT
Hey, sorry I am just busy these days. I grabbed this package (python-packaging 21.3-1) from https://archlinux.org/packages/testing/any/python-packaging/ and python-poetry from the link you suggested. It seems to work now. `poetry install` ran without errors. Thank you very much for your fix!
Comment by Caleb Maclennan (alerque) - Monday, 02 May 2022, 08:49 GMT
Okay I'll take that as a signoff, thanks Stefan.

Loading...