-
Notifications
You must be signed in to change notification settings - Fork 6
/
pyproject.toml
224 lines (199 loc) · 4.87 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
[project]
name = "mdpo"
version = "2.1.3"
description = "Markdown files translation using PO files."
readme = "README.md"
license = "BSD-3-Clause"
authors = [{ name = "Álvaro Mondéjar Rubio", email = "mondejar1994@gmail.com" }]
requires-python = ">=3.8,<3.13"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Operating System :: OS Independent",
"License :: OSI Approved :: BSD License",
"Intended Audience :: Developers",
"Topic :: Software Development :: Internationalization",
"Topic :: Text Processing",
"Topic :: Text Processing :: Markup :: Markdown",
"Environment :: Console",
"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",
]
keywords = ["markdown", "pofile", "translation", "html", "po", "i18n"]
dependencies = [
"polib>=1.1,<2",
"pymd4c>=1.3,<2",
"md-ulb-pwrap>=0.1,<1",
"importlib-metadata-argparse-version>=2,<3",
"importlib-metadata; python_version < '3.10'",
"contextlib-chdir>=1,<2",
]
[project.urls]
Source = "https://github.com/mondeja/mdpo"
Documentation = "https://mondeja.github.io/mdpo"
"Bug tracker" = "https://github.com/mondeja/mdpo/issues"
Changelog = "https://github.com/mondeja/mdpo/releases"
[tool.hatch.build]
include = ["/src"]
[tool.hatch.build.targets.wheel]
packages = ["src/mdpo"]
[project.scripts]
md2po = "mdpo.md2po.__main__:main"
po2md = "mdpo.po2md.__main__:main"
md2po2md = "mdpo.md2po2md.__main__:main"
mdpo2html = "mdpo.mdpo2html.__main__:main"
[tool.hatch.envs.default]
python = "3.10"
dependencies = ["mondeja-bump"]
[tool.hatch.envs.style]
python = "3.10"
detached = true
dependencies = ["pre-commit"]
[tool.hatch.envs.style.scripts]
lint = "pre-commit run -a"
[tool.hatch.envs.tests]
dependencies = [
"pytest~=7.0",
"coverage~=6.4",
"covdefaults",
"pytest-maybe-raises~=0.1",
"pre-commit",
]
[tool.hatch.envs.tests.scripts]
all = "coverage run -m pytest"
unit = "coverage run -m pytest tests/test_unit"
integration = "coverage run -m pytest tests/test_integration --override-ini addopts=-svv"
cov = [
"hatch run +py=py310 tests:all",
"coverage html",
"python -c 'import webbrowser as w;w.open(\"http://127.0.0.1:8088\")'",
"python -m http.server 8088 -b localhost -d htmlcov"
]
[[tool.hatch.envs.tests.matrix]]
python = ["py38", "py39", "py310", "py311", "py312"]
[tool.hatch.envs.docs]
python = "3.10"
dependencies = [
"Sphinx~=7.2",
"sphinx-rtd-theme~=2.0",
"sphinx-argparse-cli~=1.12",
"sphinx-github-changelog~=1.2",
"sphinx-tabs~=3.4",
]
[tool.hatch.envs.docs.scripts]
build = "python -m sphinx -n -T -E -W docs docs/_build/html"
serve = [
"python -m sphinx -n -T -E -W docs docs/_build/html",
"python -c 'import webbrowser as w;w.open(\"http://127.0.0.1:8089\")'",
"python -m http.server 8089 -b localhost -d docs/_build/html",
]
[tool.bump]
targets = [{ file = "pyproject.toml" }, { file = "docs/pre-commit-hooks.rst" }]
[tool.project-config]
cache = "2 days"
style = [
"gh://mondeja/project-config-styles@v5.4/python/base.json5",
"gh://mondeja/project-config-styles@v5.4/python/sphinx.json5",
"gh://mondeja/project-config-styles@v5.4/python/readthedocs.json5",
]
[tool.pytest.ini_options]
addopts = "-s"
[tool.coverage.run]
source = ["src"]
plugins = ["covdefaults"]
[tool.coverage.report]
fail_under = 1
exclude_lines = [
"def __repr__\\(",
"@(abc\\.)?abstractmethod",
"if '-h' in args or '--help' in args:"
]
[tool.ruff]
line-length = 80
target-version = "py38"
[tool.ruff.lint]
select = [
"W",
"B",
"E",
"I",
"F",
"A",
"D",
"G",
"Q",
"PL",
"UP",
"PT",
"C4",
"EXE",
"ISC",
"T20",
"INP",
"ARG",
"SIM",
"RET",
"FBT",
"ERA",
"T10",
"COM",
"SLOT",
]
ignore = [
"PLR0911",
"PLR0912",
"PLR0915",
"PLR0913",
"FBT002",
"G004",
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.flake8-quotes]
inline-quotes = "single"
multiline-quotes = "single"
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
parametrize-values-type = "tuple"
parametrize-values-row-type = "tuple"
[tool.ruff.lint.isort]
lines-after-imports = 2
combine-as-imports = true
force-wrap-aliases = true
known-first-party = ["mdpo"]
known-local-folder = ["tests"]
extra-standard-library = [
"contextvars",
"dataclasses",
"importlib.resources",
"importlib.metadata",
"zoneinfo",
"graphlib",
"tomllib",
"wsgiref.types"
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"I002",
"D100",
"D101",
"D102",
"D103",
"D104",
"D107",
"D205",
"D415",
"INP001",
"PLR0913",
"PLR2004",
]
"setup.py" = ["D205", "INP001", "I002"]
"src/**/*.py" = ["D101", "D102", "D103", "D107"]
"src/md.py" = ["D101", "D102", "D107"]
"docs/conf.py" = ["INP001"]
"tests/test_unit/test_event.py" = ["E501", "ISC003"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"