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

widget_tweaks causes 'DeprecationWarning: pkg_resources is deprecated as an API' #131

Open
fsargent opened this issue Apr 11, 2023 · 1 comment

Comments

@fsargent
Copy link

Python 3.8
widget_tweaks 1.4.2

    from pkg_resources import get_distribution, DistributionNotFound
  File "/Users/felixsargent/src/hiring/resume-ranker-frontend/mysite/.venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 121, in <module>
    warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
DeprecationWarning: pkg_resources is deprecated as an API

found using pytest -W error

FWIW, both pkg_resources and directly invoking setup.py install are semi-deprecated and are mostly unsupported.

The replacement for pkg_resources.distribution(...).version is importlib.metadata.version(...) (backported to pre-3.7 Python as importlib_metadata), though I doubt that will solve anyone's problem if the installation metadata is simply not present.

pypa/setuptools#2088 (comment), but the short answer is that you should always prefer pip install to setup.py install, even in a package manager. A few people (particularly those involved in Arch linux packaging) have been working on minimal PEP 517 build frontend to build wheels and a minimal wheel installer, so possibly early adoption of those technologies will work better for you, @PureTryOut.

googleapis/python-api-core#27 (comment)

@PureTryOut
Copy link

Please remove usernames when quoting, as you now pinged me needlessly.

jnns added a commit to jnns/django-widget-tweaks that referenced this issue Apr 14, 2023
pkg_resources is deprecated and emits warning messages.

Fixes jazzband#131
jnns added a commit to jnns/django-widget-tweaks that referenced this issue Apr 25, 2023
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