-
Notifications
You must be signed in to change notification settings - Fork 9
/
pyproject.toml
191 lines (163 loc) · 4.23 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# pyproject.toml
[build-system]
requires = ["setuptools>=61.1.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "j2lint"
version = "v1.1.0"
description = "Command-line utility that validates jinja2 syntax according to Arista's AVD style guide."
readme = "README.md"
authors = [{ name = "Arista Ansible Team", email = "[email protected]" }]
license = { file = "LICENSE" }
classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Testing",
]
keywords = ["j2lint", "linter", "jinja", "lint"]
dependencies = [
"jinja2>=3.0",
"rich>=13.5.2,<13.10.0",
]
requires-python = ">=3.8"
[project.optional-dependencies]
dev = [
"pre-commit>=3.3.3",
"bumpver==2024.1130",
"tox>=4.10.0,<5.0.0",
]
test = [
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
]
lint = [
"black>=23.10.1",
"isort[colors]>=5.12.0",
"pylint>=3.0.0",
"flake8==7.1.1",
]
type = [
"mypy==1.14.0",
]
[project.urls]
Homepage = "https://github.com/aristanetworks/j2lint.git"
"Bug Tracker" = "https://github.com/aristanetworks/j2lint/issues"
[project.scripts]
j2lint = "j2lint.cli:run"
[tool.bumpver]
current_version = "v1.1.0"
version_pattern = "vMAJOR.MINOR.PATCH"
commit_message = "Chore: Version {old_version} -> {new_version}"
commit = true
# No Tag
tag = false
push = false
[tool.bumpver.file_patterns]
"pyproject.toml" = ['current_version = "{version}"', 'version = "{version}"']
"j2lint/__init__.py" = ["{version}"]
"tests/test_cli.py" = ["{version}"]
[tool.pylint.'MESSAGES CONTROL']
max-line-length = 160
[tool.tox]
legacy_tox_ini = """
[tox]
envlist =
clean,
py38,
py39,
py310,
py311,
py312,
lint,
type,
report
isolated_build = True
[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311, coverage, report
3.12: py312
[testenv]
description = run the test driver with {basepython}
extras = test
commands =
pytest {tty:--color=yes}
[testenv:lint]
description = check the code style
extras =
lint
test
commands =
flake8 --max-line-length=160 --config=/dev/null j2lint
flake8 --max-line-length=160 --config=/dev/null tests
pylint j2lint
pylint tests
black --check --diff --color .
isort --check --diff --color .
[testenv:type]
description = check the code type
extras = type
commands =
mypy --config-file=pyproject.toml j2lint
[testenv:clean]
deps = coverage[toml]
skip_install = true
commands = coverage erase
[testenv:report]
deps = coverage[toml]
commands = coverage report --rcfile=pyproject.toml
# add the following to make the report fail under some percentage
# commands = coverage report --fail-under=80
depends = py311
"""
[tool.pytest.ini_options]
addopts = "-ra -q -s -vv --capture=tee-sys --cov --cov-append"
log_level = "WARNING"
log_cli = "True"
[tool.coverage.run]
source = ['j2lint']
omit = ["j2lint/__main__.py"]
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain about missing debug-only code:
"def __repr__",
"if self\\.debug",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",
# Don't complain about abstract methods, they aren't run:
"@(abc\\.)?abstractmethod",
# Don't complain about TYPE_CHECKING blocks
"if TYPE_CHECKING:",
]
[tool.mypy]
follow_imports = "skip"
ignore_missing_imports = true
warn_redundant_casts = true
disallow_any_generics = true
check_untyped_defs = true
no_implicit_reexport = true
strict_optional = true
# for strict mypy: (this is the tricky one :-))
disallow_untyped_defs = true
mypy_path = "j2lint"
[tool.isort]
profile = "black"