summaryrefslogtreecommitdiff
path: root/bin/rebuild-script.py
diff options
context:
space:
mode:
authorBernát Gábor <gaborjbernat@gmail.com>2018-10-25 12:25:15 +0100
committerGitHub <noreply@github.com>2018-10-25 12:25:15 +0100
commit6974665f6eaea0d1effeab0b684e3841ced62629 (patch)
tree6d1503932dad96500f10120aafff8b354d6873a4 /bin/rebuild-script.py
parentaf5711ca9346b265f196a9cf266cecda9bca5b91 (diff)
parent707d592f1e7c1cf6872d20955e12fb4fc2872121 (diff)
downloadvirtualenv-6974665f6eaea0d1effeab0b684e3841ced62629.tar.gz
Merge pull request #1219 from pypa/add-ci
* update detecting Windows Python installations - now correctly detects current user installation and not just those installed at the system level - for Python versions 3.5+ (which track 32-bit & 64-bit installations separately), recognize version tags X.Y, X.Y-32 & X.Y-64 where X.Y represents the 64-bit installation if available or 32-bit otherwise * touch up & improve `resolve_interpreter()` tests - tests no longer permanently modify the `virtualenv` module under test (`virtualenv.is_executable` changes were leaking from some tests) - tests now check that `get_installed_python()` results unrelated to the given version tag do not affect the result - simple patch function's return values now given in `@patch` decorators to make the test code more compact * test resolve_interpreter() with registered python installations * test `get_installed_pythons()` on and off Windows platform * add embed tox env * disable Python 3.4 * fix coverage reporter
Diffstat (limited to 'bin/rebuild-script.py')
-rwxr-xr-xbin/rebuild-script.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/rebuild-script.py b/bin/rebuild-script.py
index d0bc93e..7066bb6 100755
--- a/bin/rebuild-script.py
+++ b/bin/rebuild-script.py
@@ -16,7 +16,7 @@ def crc32(data):
here = os.path.dirname(__file__)
-script = os.path.join(here, '..', 'virtualenv.py')
+script = os.path.join(here, '..', 'src', 'virtualenv.py')
gzip = codecs.lookup('zlib')
b64 = codecs.lookup('base64')
@@ -28,6 +28,7 @@ file_template = b'##file %(filename)s\n%(varname)s = convert("""\n%(data)s""")'
def rebuild(script_path):
+ exit_code = 0
with open(script_path, 'rb') as f:
script_content = f.read()
parts = []
@@ -52,6 +53,7 @@ def rebuild(script_path):
print(' File up to date (crc: %08x)' % new_crc)
parts += [match.group(0)]
continue
+ exit_code = 1
# Else: content has changed
crc = crc32(gzip.decode(b64.decode(data)[0])[0])
print(' Content changed (crc: %08x -> %08x)' %
@@ -75,6 +77,7 @@ def rebuild(script_path):
print('No changes in content')
if match is None:
print('No variables were matched/found')
+ raise SystemExit(exit_code)
if __name__ == '__main__':
rebuild(script)