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

DeprecationWarning: the load_module() method is deprecated and slated for removal in Python 3.12 #494

Closed
kbaikov opened this issue Oct 6, 2021 · 5 comments · Fixed by #498
Labels
upstream This is a bug in one of our dependencies

Comments

@kbaikov
Copy link

kbaikov commented Oct 6, 2021

Describe the bug

When i run nox with python warnings enabled the deprecation warning appears:
<frozen importlib._bootstrap>:283: DeprecationWarning: the load_module() method is deprecated and slated for removal in Python 3.12; use exec_module() instead

How to reproduce

Enable python warnings.
run nox.

nox --version
2021.10.1

python -V
Python 3.10.0

OS: windows 10

Expected behavior

There is no deprecation warnins appear when i run nox.

@FollowTheProcess FollowTheProcess added the upstream This is a bug in one of our dependencies label Oct 6, 2021
@FollowTheProcess
Copy link
Collaborator

Hi @kbaikov Thanks for raising this!

@DiddiLeija
Copy link
Collaborator

If we have to remove load_module(), I offer to make the switch.

@FollowTheProcess
Copy link
Collaborator

FollowTheProcess commented Oct 6, 2021

This might be bigger than just a straight swap. load_module returns the loaded ModuleType where as exec_module returns None. I tried briefly converting to importlib.import_module as this cropped in a few issues in setup tools referencing the same deprecation warning which also returns a ModuleType but this broke a heap of tests. To fix this properly might require a few plumbing changes to the nox internals

@DiddiLeija
Copy link
Collaborator

Good point. Anyway, tell me if I can help with something :)

@kbaikov
Copy link
Author

kbaikov commented Oct 9, 2021

@FollowTheProcess thank you. That was not a trivial fix! And fast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream This is a bug in one of our dependencies
Development

Successfully merging a pull request may close this issue.

3 participants