Skip to content

Commit a6c5bea

Browse files
committed
remove setup.cfg file
1 parent 80e7141 commit a6c5bea

File tree

5 files changed

+58
-72
lines changed

5 files changed

+58
-72
lines changed

noxfile.py

+11-15
Original file line numberDiff line numberDiff line change
@@ -180,17 +180,20 @@ def test_python_suite(session: Session) -> None:
180180
session.env["IDOM_DEBUG_MODE"] = "1"
181181
install_requirements_file(session, "test-env")
182182
session.run("playwright", "install", "chromium")
183-
posargs = session.posargs
184-
posargs += ["--reruns", "3", "--reruns-delay", "1"]
183+
args = ["pytest", "--reruns", "3", "--reruns-delay", "1", *session.posargs]
185184

186-
if "--no-cov" in session.posargs:
185+
check_cov = "--no-cov" not in session.posargs
186+
if check_cov:
187+
args = ["coverage", "run", "--source=src/idom", "--module", *args]
188+
install_idom_dev(session)
189+
else:
187190
session.log("Coverage won't be checked")
188191
session.install(".[all]")
189-
else:
190-
posargs += ["--cov=src/idom", "--cov-report", "term"]
191-
install_idom_dev(session)
192192

193-
session.run("pytest", *posargs)
193+
session.run(*args)
194+
195+
if check_cov:
196+
session.run("coverage", "report")
194197

195198

196199
@nox.session
@@ -209,14 +212,7 @@ def test_python_style(session: Session) -> None:
209212
"""Check that Python style guidelines are being followed"""
210213
install_requirements_file(session, "check-style")
211214
session.run("flake8", "src/idom", "tests", "docs")
212-
black_default_exclude = r"\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|\.svn|_build|buck-out|build|dist"
213-
session.run(
214-
"black",
215-
".",
216-
"--check",
217-
"--exclude",
218-
rf"/({black_default_exclude}|venv|node_modules)/",
219-
)
215+
session.run("black", ".", "--check")
220216
session.run("isort", ".", "--check-only")
221217

222218

pyproject.toml

+43
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,46 @@ ensure_newline_before_comments = "True"
1010
include_trailing_comma = "True"
1111
line_length = 88
1212
lines_after_imports = 2
13+
14+
[tool.mypy]
15+
ignore_missing_imports = true
16+
warn_unused_configs = true
17+
warn_redundant_casts = true
18+
warn_unused_ignores = true
19+
20+
[tool.pytest.ini_options]
21+
testpaths = "tests"
22+
xfail_strict = true
23+
markers = ["slow: marks tests as slow (deselect with '-m \"not slow\"')"]
24+
python_files = "*asserts.py test_*.py"
25+
asyncio_mode = "auto"
26+
27+
[tool.coverage.report]
28+
fail_under = 100
29+
show_missing = true
30+
skip_covered = true
31+
sort = "Name"
32+
exclude_lines = [
33+
"pragma: no cover",
34+
'\.\.\.',
35+
"raise NotImplementedError",
36+
]
37+
38+
[tool.pydocstyle]
39+
inherit = false
40+
match = '.*\.py'
41+
convention = "google"
42+
add_ignore = ["D100", "D101", "D102", "D103", "D104", "D105", "D107", "D412", "D415"]
43+
44+
[tool.flake8]
45+
ignore = ["E203", "E266", "E501", "W503", "F811", "N802", "N806"]
46+
per-file-ignores = [
47+
# sometimes this is required in order to hide setup for an example
48+
"docs/*/_examples/*.py:E402",
49+
]
50+
max-line-length = 88
51+
max-complexity = 18
52+
select = ["B", "C", "E", "F", "W", "T4", "B9", "N", "ROH"]
53+
exclude = ["**/node_modules/*", ".eggs/*", ".tox/*"]
54+
# -- flake8-tidy-imports --
55+
ban-relative-imports = "parents"

requirements/check-style.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
black
1+
black[jupyter]
22
flake8
3+
flake8-pyproject
34
flake8-idom-hooks >=0.5.0
45
flake8-print
56
flake8-tidy-imports

requirements/test-env.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
pytest
22
pytest-asyncio>=0.17
3-
pytest-cov
43
pytest-mock
54
pytest-rerunfailures
65
pytest-timeout
6+
7+
coverage
78
responses
89
playwright
910

setup.cfg

-55
This file was deleted.

0 commit comments

Comments
 (0)