Skip to content

Commit 402038d

Browse files
sampathwebtensorflower-gardener
authored andcommitted
Use Nightly requirements when building tf-models-nightly package.
PiperOrigin-RevId: 604331686
1 parent e01ad92 commit 402038d

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

official/nightly_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pandas>=0.22.0
77
psutil>=5.4.3
88
py-cpuinfo>=3.3.0
99
scipy>=0.19.1
10-
tensorflow-hub>=0.6.0
10+
tf-hub-nightly
1111
tensorflow-model-optimization>=0.4.1
1212
tensorflow-datasets
1313
tf-keras-nightly

official/pip_package/setup.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,16 @@
3838
sys.argv.pop(project_name_idx)
3939

4040

41-
def _get_requirements():
41+
def _get_requirements(is_nightly=False):
4242
"""Parses requirements.txt file."""
4343
install_requires_tmp = []
4444
dependency_links_tmp = []
45+
if is_nightly:
46+
file_name = '../nightly_requirements.txt'
47+
else:
48+
file_name = '../requirements.txt'
4549
with open(
46-
os.path.join(os.path.dirname(__file__), '../requirements.txt'), 'r') as f:
50+
os.path.join(os.path.dirname(__file__), file_name), 'r') as f:
4751
for line in f:
4852
package_name = line.strip()
4953
# Skip empty line or comments starting with "#".
@@ -55,13 +59,13 @@ def _get_requirements():
5559
install_requires_tmp.append(package_name)
5660
return install_requires_tmp, dependency_links_tmp
5761

58-
install_requires, dependency_links = _get_requirements()
59-
6062
if project_name == 'tf-models-nightly':
63+
install_requires, dependency_links = _get_requirements(is_nightly=True)
6164
version += '.dev' + datetime.datetime.now().strftime('%Y%m%d')
6265
install_requires.append('tf-nightly')
6366
install_requires.append('tensorflow-text-nightly')
6467
else:
68+
install_requires, dependency_links = _get_requirements()
6569
install_requires.append(f'tensorflow~={tf_version}')
6670
install_requires.append(f'tensorflow-text~={tf_version}')
6771

0 commit comments

Comments
 (0)