Skip to content

Commit adddb07

Browse files
build: Determine tensorflow-probability requirements from python version (#2452)
* Split the requirements for the 'tensorflow' extra into two different conditional groups by python_version. - Starting with tensorflow v2.16.1, multiple changes were made that simplifies the installation of tensorflow across platform_machine and Keras v3.0 was adopted. - tensorflow-probability did _not_ adopt Keras v3.0, but instead requires tf-keras. Starting in tensorflow-probability v0.24.0 the 'tensorflow-probability[tf]' extra was added which includes all the required dependencies to be able to use tensorflow-probability with tensorflow v2.15+. - tensorflow v2.16.1 and tensorflow-probability v0.24.0 support Python 3.9+, so for Python 3.8 support the 'tensorflow' requirements need to use the previous more verbose conditionals. * Reverts PR #2448
1 parent be2fde2 commit adddb07

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

pyproject.toml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,18 @@ Homepage = "https://github.com/scikit-hep/pyhf"
6767

6868
[project.optional-dependencies]
6969
shellcomplete = ["click_completion"]
70-
# TODO: Use 'tensorflow' for all platform_machine for tensorflow v2.16.x+
70+
# TODO: 'tensorflow' supports all platform_machine for tensorflow v2.16.1+
71+
# but TensorFlow only supports python_version 3.8 up through tensorflow v2.13.1.
72+
# So until Python 3.8 support is dropped, split requirments on python_version
73+
# before and after 3.9.
7174
# NOTE: macos x86 support is deprecated from tensorflow v2.17.0 onwards.
7275
tensorflow = [
73-
"tensorflow>=2.7.0,!=2.16.1; platform_machine != 'arm64'", # c.f. PR #1962, #2448
74-
"tensorflow-macos>=2.7.0,!=2.16.1; platform_machine == 'arm64' and platform_system == 'Darwin'", # c.f. PR #2119, #2448
75-
"tensorflow-probability>=0.11.0", # c.f. PR #1657
76+
# python == 3.8
77+
"tensorflow>=2.7.0; python_version < '3.9' and platform_machine != 'arm64'", # c.f. PR #1962, #2452
78+
"tensorflow-macos>=2.7.0; python_version < '3.9' and platform_machine == 'arm64' and platform_system == 'Darwin'", # c.f. PR #2119, #2452
79+
"tensorflow-probability>=0.11.0; python_version < '3.9'", # c.f. PR #1657, #2452
80+
# python >= 3.9
81+
"tensorflow-probability[tf]>=0.24.0; python_version >= '3.9'" # c.f. PR #2452
7682
]
7783
torch = ["torch>=1.10.0"] # c.f. PR #1657
7884
jax = [

0 commit comments

Comments
 (0)