-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
PEP 503 compliance in poetry-core 1.1.0 causes my package to no longer be installed properly #6413
Comments
Upon closer review of the tracebacks, it seems to be an issue with me using the |
Please provide a reproduction. A little github project or a docker container would do the job. |
Oh I see that your pyproject.toml is in a full git repository... So I cloned that and everything went fine:
|
Moved from poetry-core as somehow issues got turned on there by mistake -- we use one tracker for both Poetry and poetry-core. |
Oh, I remember now. This is going to be a duplicate of #6198, in which the discussion concluded that importlib at python 3.10 handled this fine (per my attempt to reproduce), and that poetry wasn't wrong. |
Good catch, I also remember that issue now. We're probably going to need some sort of FAQ entry for this. |
sorry for hijacking this issue but I think I have the same issue and I don't understand the solution presented here or in #6198. We are using implicit namespace packages as per to place all our python packages within an organisation specific namespace and avoid naming collisions. As an example consider the following
which is accomodated by an empty import sys
if sys.version_info >= (3, 8): # pragma: no cover
import importlib.metadata as importlib_metadata
else: # pragma: no cover
import importlib_metadata
def get_version():
return importlib_metadata.version(__name__) Reproduction steps
This produces the (expected) output
This produces a crash
Can you provide instructions how to solve this problem? |
#6198 reported that Indeed it seems unlikely that a fresh install of code that doesn't mention the text Alternatively (warning, untested) perhaps spelling out |
Thanks for the quick reply. I don't think interference from a previous attempt is an issue but of course you never know. It appears the issue was truly with importlib and I didn't fully think the implications through. Hard-coding Thanks to @dimbleby for pointing me in the right direction! |
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. |
Version 1.1.0 of poetry-core implemented PEP 503 compliance (#394) but this seems to be breaking local installations of my package (for other developers using my package who do no use poetry). In other words, when running
pip install .
pre-1.1.0 is not the same as post 1.1.0.Here's my project.toml file
Here's a pip install log from before the 1.1.0 release:
And here's a pip install log from after the release:
And the errors I'm getting after installing with version 1.1.0:
Locking poetry-core version to pre-1.1.0 (as follows) solves my issue for now.:
I thought I would raise this in case backwards compatibility for packages that haven't caught up with PEP503 normalised names was still expected.
I agree that I should work on changing my package structure to fit normalized PEP503 names but doing so would mean I would lose all the history of my package on pypi so its not a decision I can make lightly and will need to be discussed internally first. So if the only valid fix is locking poetry-core version, then I guess I will stick to that :)
The text was updated successfully, but these errors were encountered: