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

Replace all uses of pkg_resources with importlib #2791

Closed
Tracked by #2788
hmpf opened this issue Jan 5, 2024 · 2 comments · Fixed by #2798
Closed
Tracked by #2788

Replace all uses of pkg_resources with importlib #2791

hmpf opened this issue Jan 5, 2024 · 2 comments · Fixed by #2798
Assignees

Comments

@hmpf
Copy link
Contributor

hmpf commented Jan 5, 2024

The difficulty is making this work on python 3.7...

$ rg pkg_resources
python/nav/config.py
30:import pkg_resources
251:    for name in pkg_resources.resource_listdir('nav', current_path):
254:        if pkg_resources.resource_isdir('nav', full_name):
275:    content = pkg_resources.resource_string('nav', resource_path)

python/nav/statemon/checker/RadiusChecker.py
17:from pkg_resources import resource_filename

python/nav/buildconf.py
5:import pkg_resources
14:    VERSION = pkg_resources.get_distribution("nav").version
15:except pkg_resources.DistributionNotFound:

python/nav/pgsync.py
29:from pkg_resources import resource_listdir, resource_string
@hmpf hmpf mentioned this issue Jan 5, 2024
8 tasks
@hmpf hmpf changed the title Replace all uses of pkgresources with importlib Replace all uses of pkg_resources with importlib Jan 5, 2024
@hmpf hmpf self-assigned this Jan 5, 2024
@hmpf
Copy link
Contributor Author

hmpf commented Jan 5, 2024

The stuff in python/nav/config.py, python/nav/statemon/checker/RadiusChecker.py and python/nav/pgsync.py can be replaced with importlib_resources.

@hmpf
Copy link
Contributor Author

hmpf commented Jan 5, 2024

The stuff in python/nav/buildconf.py can be handled by importlib_metadata

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.

1 participant