Skip to content

Commit 6cb0949

Browse files
authored
time to eat our own dogfood (#1214)
Resolves #1215
1 parent f52e240 commit 6cb0949

File tree

4 files changed

+23
-13
lines changed

4 files changed

+23
-13
lines changed

azure-pipelines.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,11 @@ jobs:
120120
shutil.copy(str(coverage_file), str(destination))'
121121
displayName: move coverage files into .tox
122122
123-
- script: 'python -m pip install -U tox --pre'
124-
displayName: install tox
123+
- script: "python -m pip install -U pip setuptools --user -v"
124+
displayName: upgrade pip
125+
126+
- script: 'python -m pip install . -U --user'
127+
displayName: install tox - eat our own dog food
125128

126129
- script: 'python -m tox -e py --sdistonly'
127130
displayName: generate version.py
@@ -185,7 +188,7 @@ jobs:
185188
- task: TwineAuthenticate@0
186189
inputs:
187190
externalFeeds: 'toxdev'
188-
- script: 'python3.7 -m pip install -U twine pip tox'
191+
- script: 'python3.7 -m pip install -U twine pip . --user'
189192
displayName: "acquire build tools"
190193
- script: 'python3.7 -m pip wheel -w "$(System.DefaultWorkingDirectory)/w" --no-deps .'
191194
displayName: "build wheel"

azure-run-tox-env.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ jobs:
3333
displayName: show python information
3434

3535
- script: "python -m pip install -U pip setuptools --user -v"
36-
displayName: upgrade pip and setuptools
36+
displayName: upgrade pip
3737

38-
- script: "python -m pip install -U tox --pre --user -v"
39-
displayName: install tox
38+
- script: "python -m pip install -U . --user -v"
39+
displayName: install tox - eat our own dog food
4040

4141
- script: ${{ format('python -m tox -e {0} --notest', parameters.tox) }}
4242
displayName: install test dependencies

docs/changelog/1215.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix tox CI, better error reporting when locating via the py fails - by :user:`gaborbernat`

src/tox/interpreters.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import py
1010

1111
import tox
12+
from tox import reporter
1213
from tox.constants import SITE_PACKAGE_QUERY_SCRIPT, VERSION_QUERY_SCRIPT
1314

1415

@@ -162,13 +163,18 @@ def locate_via_py(*parts):
162163
ver = "-{}".format(".".join(parts))
163164
py_exe = distutils.spawn.find_executable("py")
164165
if py_exe:
166+
cmd = py_exe, ver, VERSION_QUERY_SCRIPT
165167
proc = subprocess.Popen(
166-
(py_exe, ver, VERSION_QUERY_SCRIPT),
167-
stdout=subprocess.PIPE,
168-
stderr=subprocess.PIPE,
169-
universal_newlines=True,
168+
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True
170169
)
171-
out, _ = proc.communicate()
172-
result = json.loads(out)
170+
out, err = proc.communicate()
173171
if not proc.returncode:
174-
return result["executable"]
172+
try:
173+
result = json.loads(out)
174+
except ValueError as exception:
175+
failure = exception
176+
else:
177+
return result["executable"]
178+
else:
179+
failure = "exit code {}".format(proc.returncode)
180+
reporter.info("{!r} cmd {!r} out {!r} err {!r} ".format(failure, cmd, out, err))

0 commit comments

Comments
 (0)