Skip to content

Commit 44db4d0

Browse files
authored
style: simpler mypy toml config, mypy 0.901 (#588)
1 parent c263e40 commit 44db4d0

File tree

3 files changed

+76
-76
lines changed

3 files changed

+76
-76
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ repos:
4646
additional_dependencies: [pyyaml]
4747

4848
- repo: https://github.com/asottile/pyupgrade
49-
rev: v2.19.1
49+
rev: v2.19.3
5050
hooks:
5151
- id: pyupgrade
5252
args: [--py36-plus]
@@ -69,11 +69,12 @@ repos:
6969
additional_dependencies: [flake8-bugbear, flake8-print]
7070

7171
- repo: https://github.com/pre-commit/mirrors-mypy
72-
rev: v0.812
72+
rev: v0.901
7373
hooks:
7474
- id: mypy
7575
files: src
76-
additional_dependencies: [numpy==1.20.1, uhi==0.2.1]
76+
args: []
77+
additional_dependencies: [numpy==1.20.1, uhi==0.2.1, types-dataclasses==0.1.3]
7778

7879
- repo: https://github.com/mgedmin/check-manifest
7980
rev: "0.46"

pyproject.toml

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,78 @@ requires = [
55
"toml",
66
"setuptools_scm>=4.1.2"
77
]
8-
98
build-backend = "setuptools.build_meta"
109

1110
[tool.setuptools_scm]
1211
write_to = "src/boost_histogram/version.py"
12+
13+
[tool.pytest.ini_options]
14+
junit_family = "xunit2"
15+
addopts = "--benchmark-disable -Wd --strict-markers"
16+
xfail_strict = true
17+
testpaths = ["tests"]
18+
required_plugins = ["pytest-benchmark"]
19+
log_cli_level = "DEBUG"
20+
21+
[tool.isort]
22+
profile = "black"
23+
multi_line_output = 3
24+
25+
[tool.mypy]
26+
warn_unused_configs = true
27+
python_version = "3.6"
28+
files = "src"
29+
disallow_any_generics = true
30+
disallow_subclassing_any = true
31+
disallow_untyped_calls = true
32+
disallow_untyped_defs = true
33+
disallow_incomplete_defs = true
34+
check_untyped_defs = true
35+
disallow_untyped_decorators = true
36+
no_implicit_optional = true
37+
warn_redundant_casts = true
38+
warn_unused_ignores = true
39+
warn_return_any = true
40+
no_implicit_reexport = true
41+
strict_equality = true
42+
43+
[tool.check-manifest]
44+
ignore = [
45+
".all-contributorsrc",
46+
".clang-format",
47+
".cmake-format.yaml",
48+
".pre-commit-config.yaml",
49+
".pre-commit-nodocker.yaml",
50+
".readthedocs.yml",
51+
".clang-tidy",
52+
"examples/**",
53+
"notebooks/**",
54+
"docs/**",
55+
"scripts/**",
56+
"dev-requirements.txt",
57+
"extern/**/*.py",
58+
"extern/**/*.md",
59+
"extern/**/*.rst",
60+
"extern/**/*.toml",
61+
"extern/*/checks/**",
62+
"extern/*/test/**",
63+
"extern/*/benchmark/**",
64+
"extern/*/doc/**",
65+
"extern/*/examples/**",
66+
"extern/*/tools/**",
67+
"extern/pybind11/docs/**",
68+
"extern/pybind11/tests/**",
69+
"CMakeLists.txt",
70+
"extern/*/README.md",
71+
"CONTRIBUTING.md",
72+
"Jamfile",
73+
"configure",
74+
"*.clang_complete",
75+
"*.html",
76+
"*.in",
77+
"*.json",
78+
"*.yml",
79+
"src/boost_histogram/_core.*",
80+
"src/boost_histogram/version.py",
81+
"tests/.pytest_cache/**",
82+
]

setup.cfg

Lines changed: 1 addition & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ project_urls =
4545
Bug Tracker = https://github.com/scikit-hep/boost-histogram/issues
4646
Discussions = https://github.com/scikit-hep/boost-histogram/discussions
4747
Changelog = https://boost-histogram.readthedocs.io/en/latest/CHANGELOG.html
48+
Chat = https://gitter.im/HSF/PyHEP-histogramming
4849

4950
[options]
5051
packages = find:
@@ -61,20 +62,6 @@ zip_safe = False
6162
[options.packages.find]
6263
where = src
6364

64-
[tool:pytest]
65-
junit_family = xunit2
66-
addopts = --benchmark-disable -Wd --strict-markers
67-
xfail_strict = True
68-
testpaths =
69-
tests
70-
required_plugins =
71-
pytest-benchmark
72-
log_cli_level = DEBUG
73-
74-
[tool:isort]
75-
profile = black
76-
multi_line_output = 3
77-
7865
[flake8]
7966
max-line-length = 80
8067
max-complexity = 13
@@ -88,61 +75,3 @@ per-file-ignores =
8875
scripts/*: T
8976
setup.py: T
9077
setup_helpers.py: C901
91-
92-
[mypy]
93-
warn_unused_configs = True
94-
python_version = 3.6
95-
files = src
96-
disallow_any_generics = True
97-
disallow_subclassing_any = True
98-
disallow_untyped_calls = True
99-
disallow_untyped_defs = True
100-
disallow_incomplete_defs = True
101-
check_untyped_defs = True
102-
disallow_untyped_decorators = True
103-
no_implicit_optional = True
104-
warn_redundant_casts = True
105-
warn_unused_ignores = True
106-
warn_return_any = True
107-
no_implicit_reexport = True
108-
strict_equality = True
109-
110-
[check-manifest]
111-
ignore =
112-
.all-contributorsrc
113-
.clang-format
114-
.cmake-format.yaml
115-
.pre-commit-config.yaml
116-
.pre-commit-nodocker.yaml
117-
.readthedocs.yml
118-
.clang-tidy
119-
examples/**
120-
notebooks/**
121-
docs/**
122-
scripts/**
123-
dev-requirements.txt
124-
extern/**/*.py
125-
extern/**/*.md
126-
extern/**/*.rst
127-
extern/**/*.toml
128-
extern/*/checks/**
129-
extern/*/test/**
130-
extern/*/benchmark/**
131-
extern/*/doc/**
132-
extern/*/examples/**
133-
extern/*/tools/**
134-
extern/pybind11/docs/**
135-
extern/pybind11/tests/**
136-
CMakeLists.txt
137-
extern/*/README.md
138-
CONTRIBUTING.md
139-
Jamfile
140-
configure
141-
*.clang_complete
142-
*.html
143-
*.in
144-
*.json
145-
*.yml
146-
src/boost_histogram/_core.*
147-
src/boost_histogram/version.py
148-
tests/.pytest_cache/**

0 commit comments

Comments
 (0)