summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernát Gábor <gaborjbernat@gmail.com>2019-03-28 11:08:20 +0000
committerGitHub <noreply@github.com>2019-03-28 11:08:20 +0000
commit6cb0949a1c3794c5d48771bfa64407cae6898a06 (patch)
treec8c02c0ba8deff4c77c60c85d20b217f151e0e76
parentf52e24092be676be5740b0e8efe422f500a6ffc6 (diff)
downloadtox-git-6cb0949a1c3794c5d48771bfa64407cae6898a06.tar.gz
time to eat our own dogfood (#1214)
Resolves #1215
-rw-r--r--azure-pipelines.yml9
-rw-r--r--azure-run-tox-env.yml6
-rw-r--r--docs/changelog/1215.bugfix.rst1
-rw-r--r--src/tox/interpreters.py20
4 files changed, 23 insertions, 13 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 7f7b8dc1..a80accaa 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -120,8 +120,11 @@ jobs:
shutil.copy(str(coverage_file), str(destination))'
displayName: move coverage files into .tox
- - script: 'python -m pip install -U tox --pre'
- displayName: install tox
+ - script: "python -m pip install -U pip setuptools --user -v"
+ displayName: upgrade pip
+
+ - script: 'python -m pip install . -U --user'
+ displayName: install tox - eat our own dog food
- script: 'python -m tox -e py --sdistonly'
displayName: generate version.py
@@ -185,7 +188,7 @@ jobs:
- task: TwineAuthenticate@0
inputs:
externalFeeds: 'toxdev'
- - script: 'python3.7 -m pip install -U twine pip tox'
+ - script: 'python3.7 -m pip install -U twine pip . --user'
displayName: "acquire build tools"
- script: 'python3.7 -m pip wheel -w "$(System.DefaultWorkingDirectory)/w" --no-deps .'
displayName: "build wheel"
diff --git a/azure-run-tox-env.yml b/azure-run-tox-env.yml
index 9842a856..a75feea7 100644
--- a/azure-run-tox-env.yml
+++ b/azure-run-tox-env.yml
@@ -33,10 +33,10 @@ jobs:
displayName: show python information
- script: "python -m pip install -U pip setuptools --user -v"
- displayName: upgrade pip and setuptools
+ displayName: upgrade pip
- - script: "python -m pip install -U tox --pre --user -v"
- displayName: install tox
+ - script: "python -m pip install -U . --user -v"
+ displayName: install tox - eat our own dog food
- script: ${{ format('python -m tox -e {0} --notest', parameters.tox) }}
displayName: install test dependencies
diff --git a/docs/changelog/1215.bugfix.rst b/docs/changelog/1215.bugfix.rst
new file mode 100644
index 00000000..f684a25a
--- /dev/null
+++ b/docs/changelog/1215.bugfix.rst
@@ -0,0 +1 @@
+Fix tox CI, better error reporting when locating via the py fails - by :user:`gaborbernat`
diff --git a/src/tox/interpreters.py b/src/tox/interpreters.py
index ead865b3..ef7c5238 100644
--- a/src/tox/interpreters.py
+++ b/src/tox/interpreters.py
@@ -9,6 +9,7 @@ import sys
import py
import tox
+from tox import reporter
from tox.constants import SITE_PACKAGE_QUERY_SCRIPT, VERSION_QUERY_SCRIPT
@@ -162,13 +163,18 @@ else:
ver = "-{}".format(".".join(parts))
py_exe = distutils.spawn.find_executable("py")
if py_exe:
+ cmd = py_exe, ver, VERSION_QUERY_SCRIPT
proc = subprocess.Popen(
- (py_exe, ver, VERSION_QUERY_SCRIPT),
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- universal_newlines=True,
+ cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True
)
- out, _ = proc.communicate()
- result = json.loads(out)
+ out, err = proc.communicate()
if not proc.returncode:
- return result["executable"]
+ try:
+ result = json.loads(out)
+ except ValueError as exception:
+ failure = exception
+ else:
+ return result["executable"]
+ else:
+ failure = "exit code {}".format(proc.returncode)
+ reporter.info("{!r} cmd {!r} out {!r} err {!r} ".format(failure, cmd, out, err))