Commits
Andrew McNichols authored and Ville Suoranta committed 6b995825af8 Merge
72 72 | #print("Latest commit doesn't have a tag. Adding -dirty flag to version string.") |
73 73 | dirty="+" + out.split(" ")[2].strip() # "+" denotes local version identifier as described in PEP440 |
74 74 | last_tag = last_tag + dirty |
75 75 | |
76 76 | print("Last tag:" + last_tag) |
77 77 | |
78 78 | env["PATH"] = casa_full_dir + ":" + casa_full_dir + "/bin:" + work_dir + "/pipeline" + ":" + env["PATH"] |
79 79 | print(env) |
80 80 | |
81 81 | # Install dependencies |
82 - | cmd = ( casa_full_dir + "/bin/pip3 install --extra-index-url=https://pypi.org/simple wheel astropy==5.1 bdsf==1.10.2 pympler==1.0.1") |
82 + | if (version.parse(platform.python_version())) >= version.parse("3.8.0"): |
83 + | cmd = ( casa_full_dir + "/bin/pip3 install --extra-index-url=https://pypi.org/simple wheel astropy==5.1 bdsf==1.10.2 pympler==1.0.1") |
84 + | else: |
85 + | cmd = ( casa_full_dir + "/bin/pip3 install --extra-index-url=https://pypi.org/simple wheel astropy==4.1 bdsf==1.10.1 pympler==1.0.1") |
86 + | |
83 87 | shell.runshell(cmd.split(), work_dir + "/pipeline", env) |
84 88 | |
85 89 | # Get the Python version from the package name |
86 90 | p = re.compile('.*py(\d+\.\d+).*') |
87 91 | py_ver=''.join(p.findall(casa_pkg)[0]) |
88 92 | |
89 93 | # Update astropy data files |
90 94 | eop = casa_full_dir +"/lib/py/lib/python" + py_ver + "/site-packages/astropy/utils/iers/data/eopc04_IAU2000.62-now" |
91 95 | leap = casa_full_dir +"/lib/py/lib/python" + py_ver + "/site-packages/astropy/utils/iers/data/Leap_Second.dat" |
92 96 | print ("Updating") |
153 157 | last_tag = last_tag + dirty |
154 158 | |
155 159 | print("Last tag:" + last_tag) |
156 160 | |
157 161 | |
158 162 | env = os.environ.copy() |
159 163 | env["PATH"] = casa_full_dir + ":" + casa_full_dir + "/Contents/MacOS:" + work_dir + "/pipeline" + ":" + env["PATH"] |
160 164 | print(env) |
161 165 | |
162 166 | # Install dependencies |
163 - | cmd = ( casa_full_dir + "/Contents/MacOS/pip3 install --extra-index-url=https://pypi.org/simple csscompressor wheel astropy==5.1 pympler==1.0.1") |
167 + | if (version.parse(platform.python_version())) >= version.parse("3.8.0"): |
168 + | cmd = ( casa_full_dir + "/Contents/MacOS/pip3 install --extra-index-url=https://pypi.org/simple csscompressor wheel astropy==5.1 pympler==1.0.1") |
169 + | else: |
170 + | cmd = ( casa_full_dir + "/Contents/MacOS/pip3 install --extra-index-url=https://pypi.org/simple csscompressor wheel astropy==4.1 pympler==1.0.1") |
171 + | |
164 172 | shell.runshell(cmd.split(), work_dir + "/pipeline", env) |
165 173 | |
166 174 | # Update astropy data files |
167 175 | # Can't parse the Python version from name, so searching for the file. |
168 176 | # This might be a better option for Linux too but the other version is already tested. |
169 177 | def find(name, path): |
170 178 | for root, dirs, files in os.walk(path): |
171 179 | if name in files: |
172 180 | return os.path.join(root, name) |
173 181 | |