Skip to content

Commit

Permalink
Pin keras to 3.6.* when stubtesting tensorflow (#13137)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood authored Nov 27, 2024
1 parent 3f9234f commit 90e6bd9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
4 changes: 2 additions & 2 deletions stubs/tensorflow/METADATA.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ partial_stub = true

[tool.stubtest]
ignore_missing_stub = true
# TODO: Support/update to keras 3.4
stubtest_requirements = ["keras>=3.3.3,<3.4"]
# TODO: Support/update to keras 3.7
stubtest_requirements = ["keras==3.6.*"]
10 changes: 1 addition & 9 deletions tests/stubtest_third_party.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,6 @@ def run_stubtest(
dist_extras = ", ".join(stubtest_settings.extras)
dist_req = f"{dist_name}[{dist_extras}]{metadata.version_spec}"

# If tool.stubtest.stubtest_requirements exists, run "pip install" on it.
if stubtest_settings.stubtest_requirements:
pip_cmd = [pip_exe, "install", *stubtest_settings.stubtest_requirements]
try:
subprocess.run(pip_cmd, check=True, capture_output=True)
except subprocess.CalledProcessError as e:
print_command_failure("Failed to install requirements", e)
return False

requirements = get_recursive_requirements(dist_name)

# We need stubtest to be able to import the package, so install mypy into the venv
Expand All @@ -92,6 +83,7 @@ def run_stubtest(
dists_to_install = [dist_req, get_mypy_req()]
# Internal requirements are added to MYPYPATH
dists_to_install.extend(str(r) for r in requirements.external_pkgs)
dists_to_install.extend(stubtest_settings.stubtest_requirements)

# Since the "gdb" Python package is available only inside GDB, it is not
# possible to install it through pip, so stub tests cannot install it.
Expand Down

0 comments on commit 90e6bd9

Please sign in to comment.