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 (deprecated) pkg_resources with importlib #1689

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

badboy
Copy link
Member

@badboy badboy commented May 3, 2024

This makes it work with Python 3.12

(or it will as soon as I do a Glean release too).
Note that I couldn't find anything how to actually manually update the dependencies; that seems undocumented but requires a push to a requirements branch to trigger CI for it? I will need help with that.

@badboy
Copy link
Member Author

badboy commented May 3, 2024

Apparently there's more pkg_resource usage in dependencies:

  /home/runner/work/mozregression/mozregression/env/lib/python3.8/site-packages/mozrunner/utils.py:19: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html

so that miiiight require changes in mozrunner too.

@zzzeid
Copy link
Collaborator

zzzeid commented May 3, 2024

This makes it work with Python 3.12

(or it will as soon as I do a Glean release too). Note that I couldn't find anything how to actually manually update the dependencies; that seems undocumented but requires a push to a requirements branch to trigger CI for it? I will need help with that.

Thanks for this contribution! Looks like this change will be needed with the latest setuptools. In order to trigger a CI run to generate requirements files, the following steps can be run:

  • checkout the requirements branch
  • delete generated *.txt files in the requirements subdirectory
  • commit and push
  • wait for CI to finish, and pull the latest commit from that branch

That last commit will contain all the different requirements files based on any new packages that match the criteria in the .in files. You can then rebase and move the commit to wherever you need it.

Edit: I also still need to finish adding Python 3.12 to the test matrix (tracked in bug 1851620).

@zzzeid
Copy link
Collaborator

zzzeid commented May 3, 2024

Following up on this, there are a couple of hiccups with the Python 3.12 package upgrades, I will resolve those and hopefully once that is in place this will be easier to implement. Looks like changes are needed anyway on mozrunner as you said.

@badboy
Copy link
Member Author

badboy commented May 6, 2024

Following up on this, there are a couple of hiccups with the Python 3.12 package upgrades, I will resolve those and hopefully once that is in place this will be easier to implement. Looks like changes are needed anyway on mozrunner as you said.

ah yeah. The CI failures also look ... like it might require some updates to requirements.txt.
I will leave that work to you.
This PR should be mergeable as is, it doesn't touch any deps. A new glean-sdk is being released right now, so whenever you get to the 3.12 work you should also update glean-sdk

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