File tree Expand file tree Collapse file tree 2 files changed +14
-12
lines changed
tensorflow_hub/pip_package Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -58,15 +58,6 @@ function main() {
5858 cp " tensorflow_hub/LICENSE" " ${TMPDIR} /LICENSE.txt"
5959 cp -R " ${RUNFILES} /tensorflow_hub" " ${TMPDIR} "
6060
61- # Remove this once the library supports Keras 3.
62- # Install tf-keras-nightly instead if tf-nightly is installed.
63- if [[ $TENSORFLOW_VERSION == * tf-nightly ]]
64- then
65- sed -i " s|tf-keras|tf-keras-nightly|g" " ${TMPDIR} /setup.py"
66- else
67- echo " Did not replace dependency on tf-keras"
68- fi
69-
7061 pushd ${TMPDIR}
7162 rm -f MANIFEST
7263
Original file line number Diff line number Diff line change 1515"""Setup for pip package."""
1616
1717from datetime import datetime
18+ import os
19+ import sys
20+
1821from setuptools import find_packages
1922from setuptools import setup
2023
21- import sys
2224
2325# Can't import the module during setup.py.
2426# Use execfile to find __version__.
2830REQUIRED_PACKAGES = [
2931 'numpy >= 1.12.0' ,
3032 'protobuf >= 3.19.6' , # No less than what ../WORKSPACE uses.
31- 'tf-keras >= 2.14.1' ,
3233]
3334
3435project_name = 'tensorflow-hub'
4142# If we're dealing with a nightly build we need to make sure that the
4243# version changes for every release.
4344version = __version__
45+ is_nightly = False
4446if project_name == 'tf-hub-nightly' :
47+ is_nightly = True
4548 version += datetime .now ().strftime ('%Y%m%d%H%M' )
4649
50+ if os .environ .get ('TENSORFLOW_VERSION' , '' ).endswith ('tf-nightly' ):
51+ is_nightly = True
52+
53+ if is_nightly :
54+ REQUIRED_PACKAGES += ['tf-keras-nightly' ]
55+ else :
56+ REQUIRED_PACKAGES += ['tf-keras >= 2.14.1' ]
57+
4758setup (
4859 name = project_name , # Automatic: tensorflow_hub, etc. Case insensitive.
4960 version = version .replace ('-' , '' ),
8394 'tensorflow machine learning share module subgraph component hub '
8495 'embedding retraining transfer'
8596 ),
86- )
97+ )
You can’t perform that action at this time.
0 commit comments