-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
92 lines (81 loc) · 3.11 KB
/
pyproject.toml
File metadata and controls
92 lines (81 loc) · 3.11 KB
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
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "pytex-preprocessor"
version = "1.0.0"
authors = [
{ name="Frederik Beimgraben", email="frederik@beimgraben.net" },
]
description = "Type-safe LaTeX document generation with Python"
readme = "README.md"
requires-python = ">=3.13"
license = { file = "LICENSE" }
classifiers = [
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
]
dependencies = ["pydantic", "marko"]
[project.optional-dependencies]
dev = ["pytest", "ruff", "basedpyright"]
[project.scripts]
pytex = "pytex_builder.build:main"
pytex-tex2py = "pytex_builder.tex2py:main"
pytex-sandbox-init = "pytex_api.sandbox_init:main"
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
pytex_hsrtreport = ["assets/**/*", "tex/**/*"]
[tool.pyright]
extraPaths = ["src"]
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "--import-mode=importlib"
[tool.ruff]
line-length = 88
target-version = "py313"
src = ["src", "tests"]
# Uses Python 3.14 t-string syntax; the py313 target cannot parse it. Excluded
# from lint/format (it is exercised by pytest on 3.14).
# `examples/` is illustrative-only and not part of the CI lint scope (`ruff
# {check,format} src tests`); excluding it keeps a bare `ruff check` matching CI
# instead of choking on example-only files (some also use 3.14 t-strings).
extend-exclude = ["tests/pytex/test_template.py", "examples"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"RET", # flake8-return
"PIE", # flake8-pie
"TC", # flake8-type-checking
"ANN", # flake8-annotations
"RUF", # ruff-specific
]
# N802 (non-lowercase function names) is intentional: the public API mirrors
# LaTeX control sequences as PascalCase factories (`Bfseries`, `Author`,
# `Align`, ...). Renaming would break every document and downstream package.
ignore = ["N802"]
[tool.ruff.lint.per-file-ignores]
# Tests favour readability over full annotation coverage.
"tests/**" = ["ANN"]
# These modules embed raw LaTeX templates whose German typography uses
# non-ASCII glyphs on purpose (EN DASH separators, MULTIPLICATION SIGN). An
# inline `noqa` is impossible since it would land inside the template string.
# pagesetup is one large raw LaTeX template string; its lines cannot be
# reflowed (a source break would alter the emitted LaTeX).
"src/pytex_hsrtreport/pagesetup.py" = ["RUF001", "E501"]
"src/pytex_hsrtreport/watermark.py" = ["RUF002"]
# glossary holds raw LaTeX template constants (column types, style, labels)
# that exceed the line length and cannot be reflowed.
"src/pytex_hsrtreport/glossary.py" = ["E501"]
# tectonic pins a table of 64-char biber SHA256 checksums; the hash literals
# are unbreakable.
"src/pytex_builder/tectonic.py" = ["E501"]
[tool.ruff.lint.isort]
known-first-party = ["pytex_components", "pytex", "pytex_builder", "pytex_koma", "pytex_tikz", "pytex_hsrtreport", "pytex_markdown"]