Skip to content

Conversation

@mhucka
Copy link
Member

@mhucka mhucka commented Dec 23, 2025

This PR adds several more constraints in requirements.in in order to produce a set that supports building TFQ for Python 3.9 as well as 3.10 – 3.12. This means TFQ can support versions 3.9 – 3.12 now (at least on Linux).

In addition, this PR updates scripts/generate_requirements.sh to deal with a shortcoming of generating requirements.txt using pip-compile. The versions of some transitive dependencies may need to be updated to address security releases, but simply re-running pip-compile to produce a new requirements.txt may not update the versions because the dependencies that bring in the transitive dependencies have not themselves changed. The recommended practice for this situation is to put such version constraints into a separate constraint file and pass it as an argument to pip-compile. (pip-compile has explicit support for this.) Some additions to the script scripts/generate_requirements.sh encapsulate and document this process.

This PR also removes some no-longer-needed post-processing of the requirements.txt file from scripts/generate_requirements.sh. It was a hack in the first place, and with the latest requirements.in, it turns out to be unnecessary. While at it, I also simplified the script some more and made it follow more style guidelines for Bash scripts.

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.
@mhucka mhucka marked this pull request as ready for review December 24, 2025 02:47
@mhucka mhucka changed the title Further constrain requirements to support Python 3.9 Further constrain dependency versions in order to support Python 3.9 Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant