-
Notifications
You must be signed in to change notification settings - Fork 645
Update requirements and scripts/generate_requirements.sh #945
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
Open
mhucka
wants to merge
18
commits into
tensorflow:master
Choose a base branch
from
mhucka:mh-update-requirements
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or 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
This adds additional version constraints on dependencies that are necessary to generate a requirements.txt file that works with TensorFlow 2.16.2 and tf-keras.
The python_version actually means the constraint only applies to that Python version. We need the packages installed no matter the Python version; we just need the constraint on Python < 3.11. It's simpler and still works to not add the python_version, so let's just remove them.
This is the output of running pip-compile on requirements.in.
This adds more constraints so that the result works on Python 3.9.
This version works with Python 3.9.
After other changes in this script, using `set -eo pipefail` turns out to be unnecessary. Let's go back to what was there before to slightly reduce the noise in the diff.
The PyYAML library causes a lot of problems at `pip install` time; on some python & platform combos, it tries to uninstall an existing pyyaml that comes with the distutils package, and fails, with the result that the whole installation fails. Pyyaml is a transitive dependency brought in by something else and not something TFQ needs. The best solution I can come up with is to use pip-compile's feature for "unsafe" packages to leave pyyaml out of requirements.txt.
This removes more constraints and tries to reduce things to the minimum I can get to work.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR updates the dependencies in
requirements.inandsetup.pyas follows:This PR also updates
scripts/generate_requirements.shto remove some no-longer-needed post-processing of therequirements.txtfile. The modified script still needs to have one special case, to avoid pinning the version of PyYAML. PyYAML is a transitive dependency that, in older Pythons, was installed via distutils and not pip. Pinning the version (as pip-compile would normally do) causes pip to try to uninstall any existing versions of pyyaml in the environment, and fail, because pip didn't install it in the first place. The most robust solution I've found is to avoid pinning the version. Previously this was accomplished inscripts/generate_requirements.shby editing the output usingsed(ugh – my bad). This update uses pip-compile's feature for "unsafe" packages to simply leave pyyaml out ofrequirements.txt.