Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
208 lines (182 loc) · 6.65 KB
/
Copy pathpyproject.toml
File metadata and controls
208 lines (182 loc) · 6.65 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
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
# ---- Project Info and Dependencies ----
[project.urls]
Repository = "https://github.com/jlevy/repren"
# Homepage = "https://..."
# Documentation = "https://..."
[project]
name = "repren"
description = "Powerful CLI string replacement and file renaming for agents and humans"
authors = [
{ name = "Joshua Levy", email = "joshua@cal.berkeley.edu" },
]
readme = "README.md"
license = "MIT"
requires-python = ">=3.10,<4.0"
dynamic = ["version"]
# https://pypi.org/classifiers/
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: System Administrators",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX",
"Operating System :: Unix",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Utilities",
"Topic :: Text Processing",
"Topic :: Software Development",
"Typing :: Typed",
# Include this to avoid accidentally publishing to PyPI:
# "Private :: Do Not Upload",
]
# ---- Main dependencies ----
dependencies = []
# ---- Dev dependencies ----
[dependency-groups]
build = [
"hatchling==1.31.0",
"uv-dynamic-versioning==0.14.0",
]
dev = [
"pytest>=9.1.1",
"pytest-sugar>=1.1.1",
"ruff>=0.16.1",
"codespell>=2.4.3",
"rich>=15.0.0",
"basedpyright>=1.39.9",
"funlog>=0.2.1",
"jinja2>=3.1.4",
"pytest-cov>=7.0.0",
]
[project.scripts]
repren = "repren:main"
# ---- Build system ----
# Dynamic versioning from:
# https://github.com/ninoseki/uv-dynamic-versioning/
[build-system]
requires = ["hatchling==1.31.0", "uv-dynamic-versioning==0.14.0"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "uv-dynamic-versioning"
# Note JSON schemas don't seem to be right for tool.hatch.version.source so
# this may cause false warnings in IDEs.
# https://github.com/ninoseki/uv-dynamic-versioning/issues/21
[tool.uv-dynamic-versioning]
vcs = "git"
style = "pep440"
bump = true
pattern = "default-unprefixed"
[tool.hatch.build.targets.wheel]
# The source location for the package.
packages = ["repren"]
[tool.hatch.build.targets.sdist]
# Ship the package, downstream-verifiable tests and their small harness, and public
# documentation. Repository workflows, agent integrations, tbd state, and internal
# project records are intentionally not release artifacts.
include = [
"/repren",
"/tests",
"/scripts",
"/.npmrc",
"/package.json",
"/package-lock.json",
"/tryscript.config.js",
"/docs/development.md",
"/docs/installation.md",
"/docs/publishing.md",
"/docs/repren-docs.md",
"/docs/research-replace-rename-landscape.md",
"/README.md",
"/LICENSE",
"/SUPPLY-CHAIN-SECURITY.md",
]
# ---- Tool Settings ----
[tool.ruff]
# Set as desired, typically 88 (black standard) or 100 (wide).
line-length = 100
# Flowmark owns Markdown formatting; Ruff owns Python source formatting.
extend-exclude = ["*.md"]
[tool.ruff.lint]
select = [
# See: https://docs.astral.sh/ruff/rules/
# Basic list from: https://docs.astral.sh/ruff/linter/#rule-selection
"E", # https://docs.astral.sh/ruff/rules/#error-e
"F", # https://docs.astral.sh/ruff/rules/#pyflakes-f
"UP", # https://docs.astral.sh/ruff/rules/#pyupgrade-up
"B", # https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"I", # https://docs.astral.sh/ruff/rules/#isort-i
# Other possibilities:
# "D", # https://docs.astral.sh/ruff/rules/#pydocstyle-d
# "Q", # https://docs.astral.sh/ruff/rules/#flake8-quotes-q
# "COM", # https://docs.astral.sh/ruff/rules/#flake8-commas-com
# "SIM", # https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
]
ignore = [
# Disable some rules that are overly pedantic. Add/remove as desired:
"E501", # https://docs.astral.sh/ruff/rules/line-too-long/
"E731", # https://docs.astral.sh/ruff/rules/lambda-assignment/
# We use both ruff formatter and linter so some rules should always be disabled.
# See: https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191", # https://docs.astral.sh/ruff/rules/tab-indentation/
"E111", # https://docs.astral.sh/ruff/rules/indentation-with-invalid-multiple/
"E114", # https://docs.astral.sh/ruff/rules/indentation-with-invalid-multiple-comment/
"E117", # https://docs.astral.sh/ruff/rules/over-indented/
"D206", # https://docs.astral.sh/ruff/rules/docstring-tab-indentation/
"D300", # https://docs.astral.sh/ruff/rules/triple-single-quotes/
"Q000", # https://docs.astral.sh/ruff/rules/bad-quotes-inline-string/
"Q001", # https://docs.astral.sh/ruff/rules/bad-quotes-multiline-string/
"Q002", # https://docs.astral.sh/ruff/rules/bad-quotes-docstring/
"Q003", # https://docs.astral.sh/ruff/rules/avoidable-escaped-quote/
"COM812", # https://docs.astral.sh/ruff/rules/missing-trailing-comma/
"COM819", # https://docs.astral.sh/ruff/rules/prohibited-trailing-comma/
"ISC002", # https://docs.astral.sh/ruff/rules/multi-line-implicit-string-concatenation/
]
[tool.basedpyright]
# BasedPyright currently seems like the best type checker option, much faster
# than mypy and with a good extension for VSCode/Cursor.
# https://marketplace.visualstudio.com/items?itemName=detachhead.basedpyright
# https://docs.basedpyright.com/latest/configuration/config-files/#sample-pyprojecttoml-file
include = ["repren", "tests", "devtools"]
# By default BasedPyright is very strict, so you almost certainly want to disable
# some of the rules.
# Disable only the noisy rules this codebase has intentionally chosen not to enforce.
reportMissingTypeStubs = false
reportUnusedCallResult = false
reportAny = false
reportExplicitAny = false
reportImplicitStringConcatenation = false
reportPrivateUsage = false
reportImplicitOverride = false
reportUnreachable = false
# reportPrivateImportUsage = false
# reportPrivateLocalImportUsage = false
# reportMissingImports = false
# reportUnnecessaryIsInstance = false
# These require more type annotations to enable:
reportUnknownParameterType = false
reportMissingParameterType = false
reportUnknownArgumentType = false
reportUnknownMemberType = false
reportUnknownVariableType = false
reportUnknownLambdaType = false
[tool.codespell]
# Add here as needed:
# ignore-words-list = "foo,bar"
# skip = "foo.py,bar.py"
[tool.pytest.ini_options]
python_files = ["*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
testpaths = [
"repren",
"tests",
]
norecursedirs = []
filterwarnings = []