38
38
sys .argv .pop (project_name_idx )
39
39
40
40
41
- def _get_requirements ():
41
+ def _get_requirements (is_nightly = False ):
42
42
"""Parses requirements.txt file."""
43
43
install_requires_tmp = []
44
44
dependency_links_tmp = []
45
+ if is_nightly :
46
+ file_name = '../nightly_requirements.txt'
47
+ else :
48
+ file_name = '../requirements.txt'
45
49
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 :
47
51
for line in f :
48
52
package_name = line .strip ()
49
53
# Skip empty line or comments starting with "#".
@@ -55,13 +59,13 @@ def _get_requirements():
55
59
install_requires_tmp .append (package_name )
56
60
return install_requires_tmp , dependency_links_tmp
57
61
58
- install_requires , dependency_links = _get_requirements ()
59
-
60
62
if project_name == 'tf-models-nightly' :
63
+ install_requires , dependency_links = _get_requirements (is_nightly = True )
61
64
version += '.dev' + datetime .datetime .now ().strftime ('%Y%m%d' )
62
65
install_requires .append ('tf-nightly' )
63
66
install_requires .append ('tensorflow-text-nightly' )
64
67
else :
68
+ install_requires , dependency_links = _get_requirements ()
65
69
install_requires .append (f'tensorflow~={ tf_version } ' )
66
70
install_requires .append (f'tensorflow-text~={ tf_version } ' )
67
71
0 commit comments