File: pyproject.toml

package info (click to toggle)
python-tatsu 5.17.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 1,516 kB
  • sloc: python: 13,185; makefile: 127
file content (228 lines) | stat: -rw-r--r-- 5,908 bytes parent folder | download
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
225
226
227
228
# Copyright (c) 2017-2026 Juancarlo Añez (apalala@gmail.com)
# SPDX-License-Identifier: BSD-4-Clause
# by Gemini 2026-02-13

[build-system]
# We use hatchling as the engine, which is decoupled from the hatch CLI
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "TatSu"
dynamic = ["version"]
authors = [{name = "Juancarlo Añez", email = "apalala@gmail.com"}]
description = "TatSu takes a grammar in a variation of EBNF as input, and outputs a memoizing PEG/Packrat parser in Python."
readme = "README.rst"
requires-python = ">=3.12"
license = {file = "LICENSE"}
keywords = ["PEG", "parser", "grammar", "EBNF", "packrat"]
classifiers = [
    "Development Status :: 5 - Production/Stable",
    "License :: OSI Approved :: BSD License",
    "Natural Language :: English",
    "Intended Audience :: Developers",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Programming Language :: Python :: 3.14",
    "Programming Language :: Python :: 3.15",
    "Topic :: Software Development :: Compilers",
    "Topic :: Text Processing :: General",
]
dependencies = []

[project.optional-dependencies]
colorization = ["colorama"]
parproc = ["rich"]

[dependency-groups]
dev = [
    "basedpyright>=1.38.0",
    "black>=26.1.0",
    "build>=1.4.0",
    "colorama>=0.4.6",
    "diskcache>=5.6.3",
    "graphviz>=0.21",
    "invoke>=2.2.1",
    "ipython>=9.10.0",
    "progress>=1.6.1",
    "psutil>=7.2.2",
    "pytest>=9.0.2",
    "pytest-dependency>=0.6.0",
    "rich>=14.3.3",
    "rich-click>=1.9.7",
    "ruff>=0.15.1",
    "twine>=6.2.0",
    "uv>=0.10.2",
]
test = [
    "basedpyright>=1.38.0",
    "colorama>=0.4.6",
    "graphviz>=0.21",
    "invoke>=2.2.1",
    "mypy>=1.19.1",
    "nodejs-wheel-binaries<=24",
    "progress>=1.6.1",
    "psutil>=7.2.2",
    "pytest>=9.0.2",
    "pytest-cov>=7.0.0",
    "pytest-dependency>=0.6.0",
    "pytest-rerunfailures>=16.1",
    "pytest-xdist>=3.8.0",
    "ruff>=0.15.1",
    "ty>=0.0.17",
]
doc = [
    "docutils>=0.22.4",
    "myst-parser>=5.0.0",
    "pydata-sphinx-theme>=0.16.1",
    "sphinx>=9.1.0",
    "sphinx-autodoc2>=0.5.0",
    "sphinx-copybutton>=0.5.2",
    "sphinx-rtd-theme>=3.1.0",
]
mkdocs = [
    "mkdocs>=1.6.1",
    "mkdocs-autorefs>=1.4.4",
    "mkdocs-gen-files>=0.6.0",
    "mkdocs-literate-nav>=0.6.2",
    "mkdocs-macros-plugin>=1.5.0",
    "mkdocs-material>=9.7.1",
    "mkdocstrings[python]>=1.0.3",
    "pymdown-extensions>=10.20.1",
]

[project.scripts]
tatsu = "tatsu:main"
g2e = "tatsu.g2e:main"

[project.urls]
Homepage = "https://github.com/neogeny/TatSu"
Repository = "https://github.com/neogeny/TatSu"
Documentation = "https://tatsu.readthedocs.io/en/stable/"

[tool.hatch.version]
# Telling Hatchling exactly where to find the version string
path = "tatsu/_version.py"

[tool.hatch.build.targets.wheel]
packages = ["tatsu"]

[tool.hatch.build.targets.sdist]
exclude = ["/backup", "/parsers", "/deprecated"]

[tool.pytest.ini_options]
log_cli = true
log_cli_level = "ERROR"
addopts = "-q --ignore=.venv -p no:logging"
testpaths = ["tests"]
norecursedirs = ["*.egg", ".git", ".venv", "build", "dist"]

[tool.mypy]
python_version = "3.14"
exclude = "backup|parsers|docs|dist|build|tmp"
ignore_missing_imports = true

[tool.ty.analysis]
respect-type-ignore-comments = true

[tool.ty.rules]
unresolved-import = "ignore"
unused-ignore-comment = "ignore"

[tool.coverage.run]
omit = ["tests/*", "tatsu/diagrams.py", "tatsu/codegen/*", "**/test.py"]
data_file = ".cache/coverage/.coverage"

[tool.black]
line-length = 88
target-version = ['py312', 'py313', 'py314']
skip-string-normalization = true
skip-magic-trailing-comma = false
include = '\.pyi?$'
exclude = '''
(
    \.git
  | \.hg
  | \.mypy_cache
  | \.tox
  | \.venv
  | _build
  | buck-out
  | build
  | dist
)
|tatsu/bootstrap.py
'''

[tool.ruff]
line-length = 88
target-version = "py312"
exclude = [".git", "__pycache__", "dist", "docs"]

[tool.ruff.format]
# Tell Ruff to match your Black preferences
quote-style = "preserve"
indent-style = "space"
skip-magic-trailing-comma = false

[tool.ruff.lint.isort]
# These settings define the "criteria" for how Ruff handles imports
combine-as-imports = true
force-single-line = false
lines-after-imports = 2
known-first-party = ["tatsu"] # Replace with your project name


[tool.ruff.lint.pylint]
max-branches = 21
max-nested-blocks = 8

[tool.ruff.lint.mccabe]
max-complexity = 10

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.ruff.lint]
select = [
    "F", "E", "W", "UP",
    "I", "YTT", "S", "B",
    "COM", "C4", "SIM",
    "PTH", "TRY",
    "FLY", "PERF", "FURB", "RUF",
    "PL", "PGH", "RET",
]

ignore = [
    "E501", #    line-too-long
    "E402", #    module-import-not-at-top-of-file
    "I001", #    [*] Import block is un-sorted or un-formatted
    "FURB189", # subclassing str
    "PERF203", # try-except within loop
    "PGH003",
    "PLC0415", # import-outside-top-level
    "PLR6301", # no-self-use
    "PLR0904", # too-many-public-methods
    "PLR0913", # too-many-arguments
    "PLR0915", # too-many-statements
    "PLR0917", # too many positional arguments
    "PLR2004", # magic-value-comparison
    "PLW1514", # unspecified-encoding
    "PLW3201", # bad-dunder-method-name
    "RET504", #  assign before return
    "RET505", #  superfluous-else-return
    "RUF022", #  __all__ sorting
    "RUF027", #  possible f-string
    "S102", #    exec-builtin
    "S101", #    use of assert
    "S301", #    suspicious-pickle-usage
    "S106", #    possible password
    "S403", #    insecure modules
    "SIM108", #  use ternary instead of if-else
    "SIM114", #  if-with-same-arms
    "TRY003", #  raise-vanilla-args
    "TRY300", #  try-consider-else
    "UP031", #   use of % formatting
    "UP046", #   generic class uses `Generic` subclass instead of type parameters
    "UP047", #   should use tyope in 3.12+ type parameters
]