Skip to content

Commit c85365e

Browse files
authored
fix the failing CI on master (#1456)
* fix Signed-off-by: Bernat Gabor <[email protected]> * suppress proc related failures on pypy Signed-off-by: Bernat Gabor <[email protected]>
1 parent 6feee0b commit c85365e

12 files changed

+58
-44
lines changed

.pre-commit-config.yaml

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 19.3b0
3+
rev: 19.10b0
44
hooks:
55
- id: black
66
args: [--safe]
7-
language_version: python3.7
7+
language_version: python3.8
88
- repo: https://github.com/asottile/blacken-docs
9-
rev: v1.1.0
9+
rev: v1.3.0
1010
hooks:
1111
- id: blacken-docs
1212
additional_dependencies: [black==19.3b0]
13-
language_version: python3.7
13+
language_version: python3.8
1414
- repo: https://github.com/asottile/seed-isort-config
15-
rev: v1.9.1
15+
rev: v1.9.3
1616
hooks:
1717
- id: seed-isort-config
1818
args: [--application-directories, "src:."]
@@ -21,20 +21,20 @@ repos:
2121
hooks:
2222
- id: isort
2323
- repo: https://github.com/pre-commit/pre-commit-hooks
24-
rev: v2.2.3
24+
rev: v2.4.0
2525
hooks:
2626
- id: trailing-whitespace
2727
- id: end-of-file-fixer
2828
- id: check-yaml
2929
- id: debug-statements
3030
- id: flake8
31-
additional_dependencies: ["flake8-bugbear == 19.3.0"]
32-
language_version: python3.7
31+
additional_dependencies: ["flake8-bugbear == 19.8.0"]
32+
language_version: python3.8
3333
- repo: https://github.com/asottile/pyupgrade
34-
rev: v1.19.0
34+
rev: v1.25.1
3535
hooks:
3636
- id: pyupgrade
3737
- repo: https://github.com/pre-commit/pygrep-hooks
38-
rev: v1.4.0
38+
rev: v1.4.2
3939
hooks:
4040
- id: rst-backticks

azure-pipelines.yml

+13-8
Original file line numberDiff line numberDiff line change
@@ -21,35 +21,40 @@ pr:
2121
variables:
2222
PYTEST_ADDOPTS: "-v -v -ra --showlocals"
2323
PYTEST_XDIST_PROC_NR: '0'
24+
PRE_COMMIT_HOME: $(Pipeline.Workspace)/pre-commit-cache
2425

2526
jobs:
2627
- template: run-tox-env.yml@tox
2728
parameters:
2829
tox_version: ''
2930
jobs:
30-
fix_lint: null
31+
fix_lint:
32+
before:
33+
- task: CacheBeta@0
34+
displayName: cache pre-commit
35+
inputs:
36+
key: pre-commit | .pre-commit-config.yaml
37+
path: $(PRE_COMMIT_HOME)
3138
docs: null
3239
py38:
33-
image: [linux]
34-
py37:
3540
image: [linux, windows, macOs]
3641
py27:
3742
image: [linux, windows, macOs]
3843
pypy:
3944
image: [linux]
40-
pypy3:
41-
image: [linux]
45+
py37:
46+
image: [linux, windows, macOs]
4247
py36:
4348
image: [linux, windows, macOs]
4449
py35:
4550
image: [linux, windows, macOs]
46-
py34:
47-
image: [linux, windows, macOs]
51+
pypy3:
52+
image: [linux]
4853
dev: null
4954
package_description: null
5055
coverage:
5156
with_toxenv: 'coverage' # generate .tox/.coverage, .tox/coverage.xml after test run
52-
for_envs: [py37, py36, py35, py34, py27]
57+
for_envs: [py38, py37, py36, py35, py27, pypy3, pypy]
5358

5459
- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:
5560
- template: publish-pypi.yml@tox

docs/changelog/1452.bugfix.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Fix provisioning from a pyvenv interpreter. — by :user:`kentzo`
1+
Fix provisioning from a pyvenv interpreter. — by :user:`kentzo`

docs/changelog/1456.deprecation.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Python ``3.4`` is no longer supported. — by :user:`gaborbernat`

setup.cfg

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ classifiers =
3636

3737
[options]
3838
packages = find:
39-
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
39+
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
4040
install_requires =
4141
importlib-metadata >= 0.12, <1;python_version<"3.8"
4242
packaging >= 14
@@ -63,7 +63,7 @@ testing =
6363
pytest-cov >= 2.5.1, <3
6464
pytest-mock >= 1.10.0, <2
6565
pytest-xdist >= 1.22.2, <2
66-
pytest-randomly >= 1.2.3, <2
66+
pytest-randomly >= 1.0.0, <4
6767
psutil >= 5.6.1, < 6; python_version != "3.4"
6868
flaky >= 3.4.0, < 4
6969
docs =

src/tox/exception.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def exit_code_str(exception_name, command, exit_code):
1717
"""
1818
str_ = "{} for command {}".format(exception_name, command)
1919
if exit_code is not None:
20-
if (exit_code < 0 or (os.name == "posix" and exit_code > 128)):
20+
if exit_code < 0 or (os.name == "posix" and exit_code > 128):
2121
signals = {
2222
number: name for name, number in vars(signal).items() if name.startswith("SIG")
2323
}

src/tox/session/commands/provision.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def provision_tox(provision_venv, args):
1313
try:
1414
env = os.environ.copy()
1515
env[str("TOX_PROVISION")] = str("1")
16-
env.pop('__PYVENV_LAUNCHER__', None)
16+
env.pop("__PYVENV_LAUNCHER__", None)
1717
action.popen(provision_args, redirect=False, report_fail=False, env=env)
1818
return 0
1919
except InvocationError as exception:

tests/integration/test_parallel_interrupt.py

+2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
from flaky import flaky
1010
from pathlib2 import Path
1111

12+
from tox.constants import INFO
1213
from tox.util.main import MAIN_FILE
1314

1415

1516
@flaky(max_runs=3)
17+
@pytest.mark.skipif(INFO.IS_PYPY, reason="TODO: process numbers work differently on pypy")
1618
@pytest.mark.skipif(
1719
"sys.platform == 'win32'", reason="triggering SIGINT reliably on Windows is hard"
1820
)

tests/integration/test_provision_int.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import pytest
77
from pathlib2 import Path
88

9+
from tox.constants import INFO
910
from tox.util.main import MAIN_FILE
1011

1112

@@ -41,6 +42,7 @@ def test_provision_missing(initproj, cmd):
4142
assert meta_python.exists()
4243

4344

45+
@pytest.mark.skipif("sys.platform == 'win32'", reason="pyenv does not exists on Windows")
4446
def test_provision_from_pyvenv(initproj, cmd, monkeypatch):
4547
initproj(
4648
"pkg123-0.7",
@@ -59,8 +61,10 @@ def test_provision_from_pyvenv(initproj, cmd, monkeypatch):
5961
monkeypatch.setenv(str("__PYVENV_LAUNCHER__"), sys.executable)
6062
result = cmd("-e", "py", "-vv")
6163
result.assert_fail()
62-
assert '.tox/.tox/bin/python -m virtualenv' in result.out
64+
assert ".tox/.tox/bin/python -m virtualenv" in result.out
6365

66+
67+
@pytest.mark.skipif(INFO.IS_PYPY, reason="TODO: process numbers work differently on pypy")
6468
@pytest.mark.skipif(
6569
"sys.platform == 'win32'", reason="triggering SIGINT reliably on Windows is hard"
6670
)

tests/unit/config/test_config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ def test_getbool(self, newconfig):
837837
reader.getbool("key3")
838838
with pytest.raises(tox.exception.ConfigError) as excinfo:
839839
reader.getbool("key5")
840-
msg, = excinfo.value.args
840+
(msg,) = excinfo.value.args
841841
assert msg == "key5: boolean value 'yes' needs to be 'True' or 'False'"
842842

843843

tests/unit/test_venv.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ def test_create_KeyboardInterrupt(mocksession, newconfig, mocker):
9292
)
9393
mocksession.new_config(config)
9494
venv = mocksession.getvenv("py123")
95-
with mocker.patch.object(venv, "_pcall", side_effect=KeyboardInterrupt):
96-
with pytest.raises(KeyboardInterrupt):
97-
venv.setupenv()
95+
mocker.patch.object(venv, "_pcall", side_effect=KeyboardInterrupt)
96+
with pytest.raises(KeyboardInterrupt):
97+
venv.setupenv()
9898

9999
assert venv.status == "keyboardinterrupt"
100100

tox.ini

+18-16
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ skip_missing_interpreters = true
1616

1717
[testenv]
1818
description = run the tests with pytest under {basepython}
19-
setenv = PIP_DISABLE_VERSION_CHECK = 1
20-
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
21-
VIRTUALENV_NO_DOWNLOAD = 1
19+
setenv =
20+
PIP_DISABLE_PIP_VERSION_CHECK = 1
21+
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
2222
passenv =
2323
CURL_CA_BUNDLE
2424
http_proxy
@@ -27,7 +27,8 @@ passenv =
2727
REQUESTS_CA_BUNDLE
2828
SSL_CERT_FILE
2929
PYTEST_*
30-
deps = pip == 19.1.1
30+
PIP_CACHE_DIR
31+
deps = pip >= 19.3.1
3132
extras = testing
3233
commands = pytest \
3334
--cov "{envsitepackagesdir}/tox" \
@@ -38,14 +39,14 @@ commands = pytest \
3839

3940
[testenv:docs]
4041
description = invoke sphinx-build to build the HTML docs
41-
basepython = python3.7
42+
basepython = python3.8
4243
extras = docs
4344
commands = sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" --color -W -bhtml {posargs}
4445
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'
4546

4647
[testenv:package_description]
4748
description = check that the long description is valid
48-
basepython = python3.7
49+
basepython = python3.8
4950
deps = twine >= 1.12.1
5051
# TODO installing readme-renderer[md] should not be necessary
5152
readme-renderer[md] >= 24.0
@@ -57,15 +58,16 @@ commands = pip wheel -w {envtmpdir}/build --no-deps .
5758

5859
[testenv:fix_lint]
5960
description = format the code base to adhere to our styles, and complain about what we cannot do automatically
60-
basepython = python3.7
61-
passenv = {[testenv]passenv}
62-
# without PROGRAMDATA cloning using git for Windows will fail with an
63-
# `error setting certificate verify locations` error
64-
PROGRAMDATA
61+
basepython = python3.8
62+
passenv =
63+
{[testenv]passenv}
64+
# without PROGRAMDATA cloning using git for Windows will fail with an `error setting certificate verify locations` error
65+
PROGRAMDATA
66+
PRE_COMMIT_HOME
6567
extras = lint
6668
deps = pre-commit >= 1.14.4, < 2
6769
skip_install = True
68-
commands = pre-commit run --all-files --show-diff-on-failure
70+
commands = pre-commit run --all-files --show-diff-on-failure {posargs}
6971
python -c 'import pathlib; print("hint: run \{\} install to add checks as pre-commit hook".format(pathlib.Path(r"{envdir}") / "bin" / "pre-commit"))'
7072

7173

@@ -90,10 +92,10 @@ parallel_show_output = True
9092
[testenv:exit_code]
9193
# to see how the InvocationError is displayed, use
9294
# PYTHONPATH=.:$PYTHONPATH python3 -m tox -e exit_code
93-
basepython = python3.7
95+
basepython = python3.8
9496
description = commands with several exit codes
9597
skip_install = True
96-
commands = python3.7 -c "import sys; sys.exit(139)"
98+
commands = python3.8 -c "import sys; sys.exit(139)"
9799

98100
[testenv:X]
99101
description = print the positional arguments passed in with echo
@@ -150,7 +152,7 @@ known_third_party = apiclient,docutils,filelock,flaky,freezegun,git,httplib2,oau
150152
151153
[testenv:release]
152154
description = do a release, required posarg of the version number
153-
basepython = python3.7
155+
basepython = python3.8
154156
passenv = *
155157
deps = gitpython >= 2.1.10
156158
towncrier >= 18.5.0
@@ -159,7 +161,7 @@ commands = python {toxinidir}/tasks/release.py --version {posargs}
159161
160162
[testenv:notify]
161163
description = notify people about the release of the library
162-
basepython = python3.7
164+
basepython = python3.8
163165
skip_install = true
164166
passenv = *
165167
deps = gitpython >= 2.1.10

0 commit comments

Comments
 (0)