-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add PyPI checker and issue creator #22807
Conversation
@anthonykim1 What we really need here is have a workflow that runs once a week. that workflow should install packages with If it creates an issue on every pre-release that will be a lot of noise. I think it should do this only if the python tests fail. |
Now mainly having two condition to trigger issue creation in Python Repo:
|
import os | ||
import pathlib | ||
import importlib.metadata | ||
import pytest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is pytest
imported here? it won't even be installed when this script is actually called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we would need this for importlib.metadata.version("pytest")
to correctly fetch the version of pytest that is imported.
Should I add pytest in additional to python -m pip install -U pip wheel PyGithub
or do we not need it at all??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In your pipeline you are not installing pytest. import pytest
will immediately fail. This works for you locally because you have pytest installed locally. Try running this from a fresh environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you need pytest
then you need to install all requirements before running this script. In this script you can later update the installed pytest to whatever version you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see... the intent of importing pytest and running importlib.metadata.version("pytest")
was to get the version of pytest that our python extension was using...
Now I'm little lost on how to correctly get this value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I install test-requirement.txt and then use importlib to dynaimically get it since test-requirement.txt does not pin to specific version of pytest.
Closing this since this hasn't been worked on in a while |
Resolves: #22800