Skip to content

Commit e17aae5

Browse files
committed
add embed tox env
1 parent b338abc commit e17aae5

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

azure-pipelines.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ trigger:
2020
- .github/*
2121

2222
jobs:
23+
- template: azure-run-tox-env.yml
24+
parameters: {tox: embed, python: 3.7}
2325
- template: azure-run-tox-env.yml
2426
parameters: {tox: docs, python: 3.7}
2527
- template: azure-run-tox-env.yml

bin/rebuild-script.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def crc32(data):
1616

1717

1818
here = os.path.dirname(__file__)
19-
script = os.path.join(here, '..', 'virtualenv.py')
19+
script = os.path.join(here, '..', 'src', 'virtualenv.py')
2020

2121
gzip = codecs.lookup('zlib')
2222
b64 = codecs.lookup('base64')
@@ -28,6 +28,7 @@ def crc32(data):
2828

2929

3030
def rebuild(script_path):
31+
exit_code = 0
3132
with open(script_path, 'rb') as f:
3233
script_content = f.read()
3334
parts = []
@@ -52,6 +53,7 @@ def rebuild(script_path):
5253
print(' File up to date (crc: %08x)' % new_crc)
5354
parts += [match.group(0)]
5455
continue
56+
exit_code = 1
5557
# Else: content has changed
5658
crc = crc32(gzip.decode(b64.decode(data)[0])[0])
5759
print(' Content changed (crc: %08x -> %08x)' %
@@ -75,6 +77,7 @@ def rebuild(script_path):
7577
print('No changes in content')
7678
if match is None:
7779
print('No variables were matched/found')
80+
raise SystemExit(exit_code)
7881

7982
if __name__ == '__main__':
8083
rebuild(script)

tox.ini

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
minversion = 3.3.0
3-
envlist = py{27,34,35,36,37}, pypy{,3}, cross_python{2,3}, docs, package_readme
3+
envlist = embed, py{27,34,35,36,37}, pypy{,3}, cross_python{2,3}, docs, package_readme
44
isolated_build = true
55
skip_missing_interpreters = true
66

@@ -84,3 +84,10 @@ skip_install = true
8484
extras =
8585
commands = pip wheel -w {envtmpdir}/build --no-deps .
8686
twine check {envtmpdir}/build/*
87+
88+
[testenv:embed]
89+
description = embed dependencies into virtualenv.py
90+
skip_install = true
91+
deps =
92+
commands = python {toxinidir}/bin/rebuild-script.py
93+

0 commit comments

Comments
 (0)