-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
149 lines (128 loc) · 3.74 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# Ref dev_guide.py for some comments on this config.
[tool.poetry]
name = "mpl-tools"
version = "0.4.0"
description = "Tools for working with matplotlib" # Set == Github descript.
authors = ["patricknraanes <[email protected]>"]
license = "MIT"
readme = "README.md" # puts the README on PyPI
keywords = ["matplotlib", "plotting"]
repository = "https://github.com/patricknraanes/mpl-tools"
documentation = "https://patricknraanes.github.io/mpl-tools"
#homepage = "https://python-poetry.org/"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
##################
# Dependencies #
##################
[tool.poetry.dependencies]
python = "^3.9"
matplotlib = "~=3.7"
[tool.poetry.dev-dependencies]
scipy = "*"
# pyqt5 = "*" # GUI-backend for mpl
pdoc3 = "^0.9.2" # Doc generation
pre-commit = "*"
# Test
pytest = ">=6" # >6 to enable config in pyproject.toml
pytest-cov = "*"
coverage = {extras = ["toml"], version = ">=5.1"}
# "toml" and ">5.0b1" to enable config in pyproject.toml
pytest-sugar = "*"
# pytest-benchmark pytest-clarity pytest-xdist
# Lint
flakehell = "*"
# NB: plugins must also be ENABLED in [tool.flakehell.plugins]
# NB: plugins should also be listed in .pre-commit-config.yaml
flake8-commas = "*"
flake8-docstrings = "*"
flake8-bugbear = "*"
flake8-comprehensions = "*"
flake8-isort = "*"
flake8-builtins = "*"
pep8-naming = "*"
##################
# Config tests #
##################
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py3{7,8,9}
toxworkdir={homedir}/.tox
isolated_build = True
[testenv]
platform = linux|darwindeps
install_dev_deps = true
commands =
pytest {posargs}
"""
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--cov --cov-report term-missing --doctest-modules"
#testpaths = ["tests", "integration"] # norecursedirs suffices
norecursedirs = """.* build dist CVS _darcs {arch} *.egg venv \
tmp*""" # add tmp to the above (defaults)
[tool.coverage.run]
branch = true # stricter
source = ["mpl_tools"]
#omit = ["bad_file.py"]
[tool.coverage.report]
ignore_errors = true
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:"
]
####################
# Config linting #
####################
[tool.autopep8]
max_line_length = 88
ignore = "W6"
[tool.flakehell]
exclude = [".*", "README.*", "example*.py"]
max_line_length = 88
format = "grouped" # also try "stat"
show_source = false
#whitelist = "../../allowlist.txt" # Used by flake8-spellcheck.
# Tmp fix for flakehell crashing on python3.9
# https://github.com/flakehell/flakehell/issues/10
extended_default_ignore=[]
[tool.flakehell.plugins]
pyflakes = ["+*"]
pycodestyle = ["+*",
# flake8 defaults:
"-E24", "-W503", "-E123", "-E226", "-E704", "-E121", "-W504", "-E126",
#"-E711", "-E712", # "Comparison to True/None should be with 'is'"
"-E221", # Allow operator alignment
"-E251", # Allow operator alignment for dicts
#"-E266", # Allow ## block comments
"-C408", # Prefer {} to dict()
# "-E271", "-E701", and more... # if-list alignment
# "-E201", "-E202", "-E203", "-E241", "-E231", # leave arrays as printed
#"-E202", "-E203",
# "-E301", "-E302", # dont put spaces between functions
]
#mccabe = ["+*"]
#pylint = ["+*"]
pep8-naming = ["+*",
# ignore lowercase demands:
"-N802", "-N803", "-N806"]
#flake8-bandit = ["-*"]
flake8-bugbear = ["+*"]
flake8-builtins = ["+*"]
flake8-comprehensions = ["+*", "-C408"]
#flake8-darglint = ["+*"]
flake8-commas = ["+*"]
flake8-docstrings = ["+*", "-D105"]
#flake8-eradicate = ["+*"]
#flake8-isort = ["+*"]
#flake8-pytest-style = ["+*"]
#flake8-spellcheck = ["+*"]
[tool.flakehell.exceptions."tests/*.py"]
flake8-docstrings = ["-D*"]