-
Notifications
You must be signed in to change notification settings - Fork 516
Improve version checking #999
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
Conversation
@ProGamerGov if you rebase from master #1000 will hopefully fix failing conda issue |
@ProGamerGov, would it be possible to use something like this:
Especially because pytorch's versioning is non-complicated and follows the same pattern. https://stackoverflow.com/questions/11887762/how-do-i-compare-version-numbers-in-python |
@NarineK That solution fails for nightly builds:
Though I suppose we could find a way to make it work. Are the other PyTorch libraries like Torchtext using the same versioning pattern? The Edit: This might work for PyTorch versions (and hopefully other PyTorch library versions as well):
|
@NarineK Is
|
@NarineK I've implemented the |
@ProGamerGov, thank you for making the changes. I was looking into the dependency graph of the libs and I noticed that mathplotlib already depends on packaging if that's the right packaging library that I'm looking into. Is there need to add it here ? We already have the dependency in the non-dev setting as well ?
|
@NarineK I just tested installing Captum & Matplotlib, and neither installed the packaging library. Its listed in Matplotlib's setup.py, but not their setupext.py (which I think is used for the general user version of the package). They also use it for testing and some of the optional modules it looks like: https://github.com/matplotlib/matplotlib/search?p=1&q=packaging |
Thank you for checking @ProGamerGov, makes sense! I added a question related to the |
@NarineK I've answered your question! The packaging library is downloaded as a dependency in the Captum dev install, but I'm not sure which package uses it as a dependency. So, we only need the |
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.
Thank you very much for working on this PR, @ProGamerGov!
@NarineK has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Without the packaging library, statements like:
"1.8.0" > "1.10.0"
will be equal to True, despite v1.10 being a later version that v1.8.0.The
packaging
library will in some cases not be already installed on a user's device, so I've also added it thesetup.py
file. It's one of the core libraries from the Python Packaging Authority, but it's not included with the base Python installation: https://packaging.python.org/en/latest/key_projects/#pypa-projectsThis wasn't an issue in #940 as one the libraries in dev install has
packaging
as a dependency. So, there's no error when the tests are using thepackaging
library.