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

Missing setuptools runtime dependency #503

Closed
markgras opened this issue Nov 29, 2021 · 3 comments · Fixed by #541
Closed

Missing setuptools runtime dependency #503

markgras opened this issue Nov 29, 2021 · 3 comments · Fixed by #541

Comments

@markgras
Copy link

The django-polymorphic package's top-level __init__.py file imports pkg_resources, which is part of the setuptools package. Attempting to use django-polymorphic in a Python environment that does not have setuptools installed leads to an ImportError. To fix this, django-polymorphic's metadata should properly state that setuptools is a runtime dependency of the package.

@jonprindiville
Copy link

jonprindiville commented Sep 12, 2022

Hey, @markgras ... just a shot in the dark here, I don't know if I bumped into the same thing as you or not, but I did experience a similar symptom: django-polymorphic's import of pkg_resources threw an ImportError.

It was in CI (with a work project) and it was pretty odd to me because I wasn't changing anything related to django-polymorphic at the time, I was moving some other dependency from Poetry's list of "dev" deps to the "main" list of deps.

Anyhow, in my case what feels like ended up being the problem was that I had crossed up the versions of Poetry I was using locally and in CI: basically, there were two places where we configured the Poetry version and I only updated one, then goofy things happened when I made dependency changes 💥

That issue when away for me when I corrected my using two different versions of Poetry goof.

Don't know if you experienced a similar thing, but though I'd share.

@markgras
Copy link
Author

@jonprindiville You ran into this GitHub issue, as pkg_resources is part of setuptools (source code). In your problem configuring Poetry you ended up creating an environment that didn't have setuptools installed (or perhaps installed in the wrong place). Seeing this issue pop up in the wild is rare because setuptools is already present in most environments for old python setup.py install installation backward-compatibility. However, as more and more packages become PEP 517/518-compliant, we may see this backward-compatibility dropped, in which case this issue will become more apparent.

@jonprindiville
Copy link

you ended up creating an environment that didn't have setuptools installed

Nope. I just thought I'd share a possible trigger for this issue in case you were stuck.

However, as more and more packages become PEP 517/518-compliant, we may see this backward-compatibility dropped, in which case this issue will become more apparent.

Ok, cool, that would have been useful information to include in the description of the issue.

Carry on. 👋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants