|
25 | 25 | import re
|
26 | 26 | import shlex
|
27 | 27 | import shutil
|
28 |
| -import sys |
29 | 28 | import tempfile
|
30 | 29 |
|
31 | 30 | base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
@@ -167,48 +166,6 @@ def main():
|
167 | 166 | # If we're handed a version from the build manager we
|
168 | 167 | # should check that the version is correct or write
|
169 | 168 | # a new one.
|
170 |
| - if len(sys.argv) >= 2: |
171 |
| - # 'build_version' is what the release manager wants, |
172 |
| - # 'expect_version' is what we're expecting to compare |
173 |
| - # the package version to before building the dists. |
174 |
| - build_version = expect_version = sys.argv[1] |
175 |
| - |
176 |
| - # Any prefixes in the version specifier mean we're making |
177 |
| - # a pre-release which will modify __versionstr__ locally |
178 |
| - # and not produce a git tag. |
179 |
| - if any(x in build_version for x in ("-SNAPSHOT", "-rc", "-alpha", "-beta")): |
180 |
| - # If a snapshot, then we add '+dev' |
181 |
| - if "-SNAPSHOT" in build_version: |
182 |
| - version = version + "+dev" |
183 |
| - # alpha/beta/rc -> aN/bN/rcN |
184 |
| - else: |
185 |
| - pre_number = re.search(r"-(a|b|rc)(?:lpha|eta|)(\d+)$", expect_version) |
186 |
| - version = version + pre_number.group(1) + pre_number.group(2) |
187 |
| - |
188 |
| - expect_version = re.sub( |
189 |
| - r"(?:-(?:SNAPSHOT|alpha\d+|beta\d+|rc\d+))+$", "", expect_version |
190 |
| - ) |
191 |
| - if expect_version.endswith(".x"): |
192 |
| - expect_version = expect_version[:-1] |
193 |
| - |
194 |
| - # For snapshots we ensure that the version in the package |
195 |
| - # at least *starts* with the version. This is to support |
196 |
| - # build_version='7.x-SNAPSHOT'. |
197 |
| - if not version.startswith(expect_version): |
198 |
| - print( |
199 |
| - "Version of package (%s) didn't match the " |
200 |
| - "expected release version (%s)" % (version, build_version) |
201 |
| - ) |
202 |
| - exit(1) |
203 |
| - |
204 |
| - # A release that will be tagged, we want |
205 |
| - # there to be no '+dev', etc. |
206 |
| - elif expect_version != version: |
207 |
| - print( |
208 |
| - "Version of package (%s) didn't match the " |
209 |
| - "expected release version (%s)" % (version, build_version) |
210 |
| - ) |
211 |
| - exit(1) |
212 | 169 |
|
213 | 170 | for suffix in ("", major_version):
|
214 | 171 | run("rm", "-rf", "build/", "*.egg-info", ".eggs")
|
|
0 commit comments