-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
274 lines (243 loc) · 9.92 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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# ─────────────────────────────────────────────────────────────────────────────
# Project Metadata
# ─────────────────────────────────────────────────────────────────────────────
[project]
name = "reskein"
authors = [{ name = "Jens Lorrmann", email = "[email protected]" }]
maintainers = [{ name = "Jens Lorrmann", email = "[email protected]" }]
description = "Python application and library that adjusts and uses jcrist's Skein library to simplify the deployment of applications on Apache Hadoop cluster using YARN ResourceManager REST API."
readme = "README.md"
keywords = ["YARN", "HDFS", "hadoop", "distributed", "cluster"]
license = { text = "MIT License" }
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Topic :: System :: Systems Administration",
"Topic :: System :: Distributed Computing",
]
dynamic = ["version"]
# ─────────────────────────────────────────────────────────────────────────────
# Project Dependencies
# ─────────────────────────────────────────────────────────────────────────────
requires-python = ">=3.8"
dependencies = [
"requests>=2.32.3,<3",
"requests-kerberos>=0.15.0,<0.16",
"fsspec>=2024.9.0,<2025",
"msgspec>=0.18.6",
"skein>=0.8.2",
"rich>=13.8.1",
"rich-click>=1.8.3",
"tqdm>=4.66.5",
"python-dotenv>=1.0.1",
"portalocker>=2.10.1,<3",
"setuptools>=75.1.0,<76",
]
[tool.pixi.feature.dev.dependencies]
pytest = ">=8.3.2,<9"
pytest-mock = ">=3.14.0,<4"
pytest-cov = ">=5.0.0,<6"
pytest-html = ">=4.1.1,<5"
ruff = ">=0.6.2,<0.7"
black = ">=24.8.0,<25"
ipykernel = ">=6.29.5,<7"
pre-commit = ">=3.8.0,<4"
[tool.pixi.target.win-64.pypi-dependencies]
pywin32 = { version = ">=306" }
[tool.pixi.pypi-dependencies]
reskein = { path = ".", editable = true }
# ─────────────────────────────────────────────────────────────────────────────
# Project Entrypoints
# ─────────────────────────────────────────────────────────────────────────────
[project.scripts]
reskein = "reskein.__main__:main"
# ─────────────────────────────────────────────────────────────────────────────
# Build System Configuration
# ─────────────────────────────────────────────────────────────────────────────
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "src/reskein/_version.py"
[tool.hatch.build]
packages = ["src/reskein"]
[tool.hatch.build.targets.wheel]
packages = ["src/reskein", "reskein"]
[tool.hatch.build.targets.sdist]
packages = ["src/reskein", "reskein"]
# ─────────────────────────────────────────────────────────────────────────────
# Pixi Configuration
# ─────────────────────────────────────────────────────────────────────────────
[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["linux-64", "osx-64", "win-64"]
[tool.pixi.environments]
dev = { features = ["dev"], solve-group = "default" }
[tool.pixi.tasks]
post-install = "pre-commit install"
[tool.pixi.feature.dev.tasks.test]
# Run tests with pytest and generate a coverage report in XML format
cmd = "pytest -s -v --cov"
[tool.pixi.feature.dev.tasks.test-reports]
# Run tests with pytest and generate a coverage report in XML format
cmd = "pytest -s -v --cov-report=xml:reports/coverage.xml --junitxml=reports/junit.xml --html=reports/report.html"
[tool.pixi.feature.dev.tasks.ruff-check]
# Format code using Ruff
cmd = "ruff check --fix --exit-non-zero-on-fix --force-exclude ./src"
[tool.pixi.feature.dev.tasks.format]
# Format code using Ruff
cmd = "ruff format --force-exclude ./src"
[tool.pixi.feature.dev.tasks.pre-commit]
# Run all pre-commit hooks
cmd = "pre-commit run --all-files"
[tool.pixi.feature.dev.tasks.bump-version]
# Bump the project version using Hatch
# Usage: pixi run -e dev bump-version [patch|minor|major],[dev]
cmd = "pixi exec hatch version $segment"
[tool.pixi.feature.dev.tasks.build-sdist]
# Build the source distribution (sdist) using Hatch
# Inputs: source files and pyproject.toml
# Outputs: tar.gz files in the dist directory
cmd = "pixi exec hatch build -t sdist"
inputs = ["src/**/*", "pyproject.toml"]
outputs = ["dist/*.tar.gz"]
[tool.pixi.feature.dev.tasks.build-wheel]
# Build the wheel distribution using Hatch
# Inputs: source files and pyproject.toml
# Outputs: wheel files in the dist directory
cmd = "pixi exec hatch build -t wheel"
inputs = ["src/**/*", "pyproject.toml"]
outputs = ["dist/*.whl"]
[tool.pixi.feature.dev.tasks.build]
# Build the wheel and ource distribution (sdist) distribution using Hatch
cmd = "pixi exec hatch build -t wheel -t sdist"
inputs = ["src/**/*", "pyproject.toml"]
outputs = ["dist/*.whl", "dist/*.tar.gz"]
[tool.pixi.feature.dev.tasks.recipe-v1]
# Generate a conda recipe using grayskull
# Usage: pixi run -e dev recipe
cmd = """pixi exec grayskull pypi --strict-conda-forge --use-v1-format reskein \
&& sed -i 's/\\${{ PYTHON }}/python/g' reskein/recipe.yaml
"""
cwd = "recipe"
[tool.pixi.feature.dev.tasks.recipe-v0]
# Generate a conda recipe using grayskull
# Usage: pixi run -e dev recipe
cmd = """pixi exec grayskull pypi --strict-conda-forge reskein; \
sed -i 's/\\${{ PYTHON }}/python/g' reskein/meta.yaml; \
sed -i '/about:/a \\ \\ home: https://github.com/jslorrma/reskein' reskein/meta.yaml
"""
cwd = "recipe"
[tool.pixi.feature.dev.tasks.release]
# Release the project to PyPI using Hatch
# Usage: pixi run -e dev release
cmd = """version=$(pixi exec hatch version) \
&& pixi update \
&& git add pixi.lock pyproject.toml src/reskein/_version.py \
&& git commit -m "Release v$version" \
&& git push origin \
&& git tag -a v$version -m "Release v$version" \
&& git push origin v$version
"""
# ─────────────────────────────────────────────────────────────────────────────
# Code Formatting and Linting
# ─────────────────────────────────────────────────────────────────────────────
[tool.black]
line-length = 120
include = '\.pyi?$'
[tool.ruff]
line-length = 120
target-version = "py310"
fix = true
src = ["src"]
lint.select = [
"I", # isort
"F", # pyflakes
"E",
"W", # pycodestyle
"B", # flake8-bugbear
"PLC",
"PLE",
"PLR",
"PLW", # pylint
"PIE", # misc lints
"ISC", # implicit string concatenation
"TCH", # type-checking imports
"C4", # comprehensions
"PGH", # pygrep-hooks
"UP", # pyupgrade
"RUF", # Ruff-specific rules
]
lint.unfixable = ["PLR"]
lint.ignore = [
# space before : (needed for how black formats slicing)
"E203", # not yet implemented
# module level import not at top of file
"E402",
# line tool long (will be handled by black)
"E501",
# Conflicts with ruff format
"W191",
# Function is too complex
"C901",
# do not assign a lambda expression, use a def
"E731",
# unused variables in function scopes
"F841",
# line break before binary operator
# "W503", # not yet implemented
# line break after binary operator
# "W504", # not yet implemented
# invalid escape sequence
"W605",
# controversial
"B006",
# controversial
"B007",
# controversial
"B008",
# setattr is used to side-step mypy
"B009",
# getattr is used to side-step mypy
"B010",
# tests use assert False
"B011",
# tests use comparisons but not their returned value
"B015",
# false positives
"B019",
# # Loop control variable overrides iterable it iterates
# "B020",
# # Function definition does not bind loop variable
# "B023",
# Functions defined inside a loop must not use variables redefined in the loop
# "B301", # not yet implemented
# # Only works with python >=3.10
# "B905",
# # Too many arguments to function call
# "PLR0913",
# # Too many returns
# "PLR0911",
# Too many branches
"PLR0912",
# Too many statements
"PLR0915",
# Redefined loop name
"PLW2901",
# Global statements are discouraged
"PLW0603",
# Docstrings should not be included in stubs
"PYI021",
# No builtin `eval()` allowed
"S307",
# compare-to-empty-string
"PLC1901",
# Use typing_extensions.TypeAlias for type aliases
# "PYI026", # not yet implemented
# Use "collections.abc.*" instead of "typing.*" (PEP 585 syntax)
# "PYI027", # not yet implemented
# while int | float can be shortened to float, the former is more explicit
# "PYI041", # not yet implemented
# Checks for implicitly concatenated strings on a single line.
"ISC001",
]