Skip to content

Commit b2fb9d1

Browse files
authored
More build fixes (#205)
1 parent dfe1d75 commit b2fb9d1

File tree

8 files changed

+50
-79
lines changed

8 files changed

+50
-79
lines changed

.github/workflows/tox.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ jobs:
9595
run: python3 -m pip install --upgrade 'tox>=4.0.3'
9696

9797
- name: Initialize tox envs
98-
run: python -m tox --notest --skip-missing-interpreters false -vv -e tox_env
98+
run: python -m tox --notest --skip-missing-interpreters false -vv -e ${{ matrix.tox_env }}
9999

100100
- name: Test with tox
101-
run: python -m tox -e tox_env
101+
run: python -m tox -e ${{ matrix.tox_env }}
102102

103103
- name: Archive logs
104104
uses: actions/upload-artifact@v3

.pre-commit-config.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ repos:
8484
args: ["--strict"]
8585
additional_dependencies:
8686
- cached_property
87-
- flaky
8887
- packaging
8988
- pytest
9089
- pytest-mock
@@ -98,7 +97,6 @@ repos:
9897
- id: pylint
9998
additional_dependencies:
10099
- PyYAML
101-
- flaky
102100
- pytest
103101
- typing_extensions
104102
# Keep last due to being considerably slower than the others:
@@ -109,17 +107,17 @@ repos:
109107
name: Upgrade constraints files and requirements
110108
files: ^(pyproject\.toml|requirements\.txt)$
111109
language: python
112-
entry: python -m piptools compile --upgrade -q --extra docs --extra test --output-file=requirements.txt pyproject.toml
110+
entry: python -m piptools compile --resolver=backtracking --upgrade -q --extra docs --extra test --output-file=requirements.txt pyproject.toml
113111
pass_filenames: false
114112
stages:
115113
- manual
116114
additional_dependencies:
117-
- pip-tools>=6.10.0
115+
- pip-tools>=6.11.0
118116
- id: pip-compile
119117
name: Check constraints files and requirements
120118
files: ^(pyproject\.toml|requirements\.txt)$
121119
language: python
122-
entry: python -m piptools compile -q --extra docs --extra test --output-file=requirements.txt pyproject.toml
120+
entry: python -m piptools compile --resolver=backtracking -q --extra docs --extra test --output-file=requirements.txt pyproject.toml
123121
pass_filenames: false
124122
additional_dependencies:
125-
- pip-tools>=6.10.0
123+
- pip-tools>=6.11.0

.pylintrc

Lines changed: 0 additions & 23 deletions
This file was deleted.

mypy.ini

Lines changed: 0 additions & 29 deletions
This file was deleted.

pyproject.toml

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,7 @@ docs = [
5656
"sphinx_ansible_theme",
5757
"myst_parser",
5858
]
59-
test = [
60-
"coverage",
61-
"flaky",
62-
"pip-tools",
63-
"pytest>=7.2.0",
64-
"pytest-mock",
65-
"pytest-plus",
66-
]
59+
test = ["coverage", "pip-tools", "pytest>=7.2.0", "pytest-mock", "pytest-plus"]
6760

6861
[tool.coverage.run]
6962
source = ["src"]
@@ -73,11 +66,48 @@ branch = true
7366
exclude_lines = ["pragma: no cover", "if TYPE_CHECKING:"]
7467
skip_covered = true
7568

69+
[tool.mypy]
70+
python_version = 3.8
71+
color_output = true
72+
error_summary = true
73+
disallow_untyped_calls = true
74+
disallow_untyped_defs = true
75+
disallow_any_generics = true
76+
# disallow_any_unimported = True
77+
#; warn_redundant_casts = True
78+
# warn_return_any = True
79+
# warn_unused_configs = True
80+
exclude = "test/local-content"
81+
7682
[tool.isort]
7783
profile = "black"
7884

85+
[tool.pylint.BASIC]
86+
good-names = [
87+
"f", # filename
88+
"i",
89+
"j",
90+
"k",
91+
"ns", # namespace
92+
"ex",
93+
"Run",
94+
"_"
95+
]
96+
97+
[tool.pylint.IMPORTS]
98+
preferred-modules = ["unittest:pytest"]
99+
100+
[tool.pylint."MESSAGES CONTROL"]
101+
disable = [
102+
# On purpose disabled as we rely on black
103+
"line-too-long",
104+
# local imports do not work well with pre-commit hook
105+
"import-error",
106+
# Temporary disable duplicate detection we remove old code from prerun
107+
"duplicate-code",
108+
]
109+
79110
[tool.pytest.ini_options]
80-
addopts = "--no-success-flaky-report"
81111
# ensure we treat warnings as error
82112
filterwarnings = ["error"]
83113

requirements.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#
2-
# This file is autogenerated by pip-compile with python 3.9
3-
# To update, run:
2+
# This file is autogenerated by pip-compile with Python 3.9
3+
# by the following command:
44
#
5-
# pip-compile --extra=docs --extra=test --output-file=requirements.txt pyproject.toml
5+
# pip-compile --extra=docs --extra=test --output-file=requirements.txt --resolver=backtracking pyproject.toml
66
#
77
alabaster==0.7.12
88
# via sphinx
@@ -33,8 +33,6 @@ docutils==0.17.1
3333
# sphinx-rtd-theme
3434
exceptiongroup==1.0.4
3535
# via pytest
36-
flaky==3.7.0
37-
# via ansible-compat (pyproject.toml)
3836
idna==3.4
3937
# via requests
4038
imagesize==1.4.1

test/test_runtime.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import pytest
1212
from _pytest.monkeypatch import MonkeyPatch
13-
from flaky import flaky
1413
from packaging.version import Version
1514
from pytest_mock import MockerFixture
1615

@@ -213,8 +212,6 @@ def remember_cwd(cwd: str) -> Iterator[None]:
213212
os.chdir(curdir)
214213

215214

216-
# # https://github.com/box/flaky/issues/170
217-
@flaky(max_runs=3) # type: ignore
218215
def test_prerun_reqs_v1(caplog: pytest.LogCaptureFixture, runtime: Runtime) -> None:
219216
"""Checks that the linter can auto-install requirements v1 when found."""
220217
cwd = os.path.realpath(
@@ -234,7 +231,6 @@ def test_prerun_reqs_v1(caplog: pytest.LogCaptureFixture, runtime: Runtime) -> N
234231
)
235232

236233

237-
@flaky(max_runs=3) # type: ignore
238234
def test_prerun_reqs_v2(caplog: pytest.LogCaptureFixture, runtime: Runtime) -> None:
239235
"""Checks that the linter can auto-install requirements v2 when found."""
240236
cwd = os.path.realpath(

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ deps =
7979
skip_install = true
8080
usedevelop = false
8181
commands =
82-
{envpython} -m pre_commit run -a --show-diff-on-failure {posargs:}
82+
pre-commit run -a --show-diff-on-failure {posargs:}
83+
pre-commit run -a pip-compile
8384
passenv =
8485
{[testenv]passenv}
8586
PRE_COMMIT_HOME

0 commit comments

Comments
 (0)