summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernat Gabor <bgabor8@bloomberg.net>2018-10-25 10:14:15 +0100
committerBernat Gabor <bgabor8@bloomberg.net>2018-10-25 10:17:47 +0100
commitd408e62829bac31fe746a25bbdc381a548454f2b (patch)
treebaf2630e97140b3a3ebcd9ecb4370a5dd46860e0
parentaf5711ca9346b265f196a9cf266cecda9bca5b91 (diff)
downloadvirtualenv-add-ci.tar.gz
add embed tox envadd-ci
-rw-r--r--azure-pipelines.yml2
-rwxr-xr-xbin/rebuild-script.py5
-rw-r--r--tox.ini9
3 files changed, 14 insertions, 2 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 83547e1..36db607 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -21,6 +21,8 @@ trigger:
jobs:
- template: azure-run-tox-env.yml
+ parameters: {tox: embed, python: 3.7}
+- template: azure-run-tox-env.yml
parameters: {tox: docs, python: 3.7}
- template: azure-run-tox-env.yml
parameters: {tox: package_readme, python: 3.7}
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)
diff --git a/tox.ini b/tox.ini
index c06a572..93c0518 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
[tox]
minversion = 3.3.0
-envlist = py{27,34,35,36,37}, pypy{,3}, cross_python{2,3}, docs, package_readme
+envlist = embed, py{27,34,35,36,37}, pypy{,3}, cross_python{2,3}, docs, package_readme
isolated_build = true
skip_missing_interpreters = true
@@ -84,3 +84,10 @@ skip_install = true
extras =
commands = pip wheel -w {envtmpdir}/build --no-deps .
twine check {envtmpdir}/build/*
+
+[testenv:embed]
+description = embed dependencies into virtualenv.py
+skip_install = true
+deps =
+commands = python {toxinidir}/bin/rebuild-script.py
+