-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
Adds package and requirement spec output to version check exception #18702
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 for the improvement, @colindean
I'm totally in agreement. But let's make it even better as
None
has no meaning to the user in the context of internal variable names.Perhaps something like this?
(untested)
I don't think we need
pkg
since it's already in therequirement
.BTW, I'm curious in what context did you get this triggered? as this was just a defensive programming and shouldn't have really happened. Unless it receives
want_ver=None
when the package isn't there - it's been a while so I don't quite remember.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'll make the suggested change and push it up shortly.
I somehow ended up with empty packages installed. As in, the folders and the egg info directory exist, so the package look like it's installed to importlib but then it has no version information (and no files to actually load). It's quite an invalid state but I have no idea how it got to be like that beyond the possibility of arbitrary file deletion: our venv was on a shared system and a junior admin haphazardly deleted all files with creation dates older than 2022-01-01 to free up space… this created a lot of weirdness! However, I'd reinstalled the venv and its packages with Conda after that event, so I'm really not sure what happened. Manually installing the packages with pip brought 'em back. Assumptions about shared filesystems made by my predecessors were… unsafe. And transformers is getting slightly better because of it!
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 for sharing the details of your use-case, Colin. This is definitely a possibility for users, so yes, I'm glad you are making the Transformers code more user-friendly, especially so when it's already a troublesome situation.
I'm not sure if perhaps it'd help to also add at the end:
"you may want to try to force the reinstall of the {pkg} package"
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.
@colindean, currently the autoformatter CI job fails - you need to run
make style
and push the changes. runpip install -e .[dev]
if the former fails due to some dependency missing and try again.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 wasn't able to get
pip install -e .[dev]
to complete successfully.I'm on an M1 Mac and there's no whl for macos arm64 for
tensorflow-text
in Tensorflow 2.9.0. Also, fugasi required installation ofmecab
from Homebrew… I'll see about adding some hints to CONTRIBUTING about that last one but I don't have a good workaround for the former. Its unavailability blocks installation of packages :-/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.
You can just install the quality tools with
pip install -e .[quality]
, no need for all the dev dependencies.