-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathpyproject.toml
More file actions
269 lines (241 loc) · 8.02 KB
/
Copy pathpyproject.toml
File metadata and controls
269 lines (241 loc) · 8.02 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
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
[project]
name = "rovr"
version = "0.10.1.post1"
description = "a stylish, batteries-included terminal file manager."
readme = "README.md"
requires-python = ">=3.13,<3.15"
license = "MIT"
license-files = [ "LICENSE" ]
authors = [{ name = "NSPC911" }]
keywords = ["filemanager", "fs", "python", "textual", "tui"]
classifiers = [
"Development Status :: 4 - Beta",
# "License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.13",
# "Framework :: Textual", # I highly believe textual deserves its own category
"Topic :: Desktop Environment :: File Managers",
"Topic :: Utilities",
]
dependencies = [
"backports-zstd>=1.3.0; python_version < '3.14'",
"fastjsonschema>=2.21.2",
"humanize>=4.15.0",
"multiarchive>=0.1.2",
"pathvalidate>=3.3.1",
"pillow>=12.2.0",
"platformdirs>=4.9.0",
"puremagic>=2.2.0",
"pytrash>=0.4.0",
"rarfile>=4.2",
"resvg-py>=0.3.1",
"rich==14.2.0",
"textual~=8.0",
"textual-autocomplete>=4.0.6",
"textual-drivers~=0.10.0",
"textual-image[textual]~=0.13.0",
"tomli>=2.4.0",
]
[project.urls]
Issues = "https://github.com/NSPC911/rovr/issues"
Source = "https://github.com/NSPC911/rovr"
Documentation = "https://nspc911.github.io/rovr"
[project.scripts]
rovr = "rovr:main"
[project.optional-dependencies]
speedup = [
"textual-speedups>=0.2.1",
]
[dependency-groups]
build = [
"zstandard>=0.25.0",
"poethepoet>=0.45.0",
"nuitka>=4.0.0,<4.2.0",
]
dev = [
"poethepoet>=0.41.0",
"prek>=0.2.25",
"ruff>=0.15.0",
"textual-dev>=1.8.0",
"ty==0.0.49",
"pyinstrument>=5.1.2",
"commitizen>=4.13.0",
"pytest>=9.0.2",
"pytest-asyncio>=1.3.0",
"pytest-xdist>=3.8.0",
]
docscripts = [
"json-schema-for-humans>=1.5.1",
"jsonschema-gentypes>=2.13.0",
"poethepoet>=0.41.0",
"ruff>=0.15.0",
]
[build-system]
requires = ["uv_build==0.12.*"]
build-backend = "uv_build"
[tool.uv]
compile-bytecode = true
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "$version"
version_scheme = "pep440"
version_provider = "uv"
update_changelog_on_bump = true
major_version_zero = true
[tool.poe.executor]
type = "uv"
no-sync = true
[tool.poe.tasks]
_hash_dump.shell = "git rev-parse HEAD > src/rovr/COMMIT_HASH"
_warn_dump.shell = "echo \"If you need to change any config, don't change them here!! Look at https://nspc911.github.io/rovr/configuration/configuration/ for more info\" > src/rovr/DO_NOT_EDIT_THESE_FILES"
_schema_compile.cmd = "docs/scripts/compile_schema.py"
_dump_clean.shell = "python -c \"import os; [os.remove(file) for file in ('src/rovr/COMMIT_HASH', 'src/rovr/DO_NOT_EDIT_THESE_FILES', 'src/rovr/_schema_validator.py') if os.path.exists(file)]\""
_docscripts_setup.cmd = "uv sync --group docscripts"
run.help = "Run rovr"
run.cmd = "rovr"
run.use_exec = true
dev.help = "Run rovr in development mode with textual-dev"
dev.cmd = "textual run --dev rovr.__main__:cli --"
dev.use_exec = true
log.help = "Launch textual's console (need rovr to be launched as dev)"
log.cmd = "textual console -x WORKER -x SYSTEM -x DEBUG -x EVENT"
log.use_exec = true
gen-schema.help = "Generate the JSON schema for rovr's config"
gen-schema.sequence = [
"_docscripts_setup",
{ cmd = "docs/scripts/generate_schema.py" },
]
icon-test.help = "Print all available icons to the terminal for testing"
icon-test.cmd = "docs/scripts/icon_test.py"
typed.help = ""
typed.ref = "schema-to-dict"
schema-to-dict.help = "Convert the JSON schema into a Python TypedDict for internal use"
schema-to-dict.sequence = [
"_docscripts_setup",
{ cmd = "jsonschema-gentypes --json-schema ./src/rovr/assets/schema.json --python ./src/rovr/classes/config.pyi" },
"format"
]
gen-ctx.help = ""
gen-ctx.ref = "update-contexts"
update-contexts.help = "Update set of key contexts in src/rovr/variables/maps.py"
update-contexts.sequence = [
{ cmd = "docs/scripts/contexts.py" },
"format"
]
check.help = "Run all checks (type checking and linting)"
check.sequence = [ { cmd = "ty check" }, { cmd = "ruff check" } ]
fmt.help = ""
fmt.ref = "format"
format.help = "Run ruff related formatters"
format.sequence = [ { cmd = "ruff check --unsafe-fixes --fix"}, { cmd = "ruff format"} ]
svg-fmt.help = ""
svg-fmt.ref = "screenshot-format"
screenshot-format.help = "Format all SVG screenshots in the docs"
screenshot-format.cmd = 'pnpx prettier --write "docs/public/screenshots/*.svg" --parser html --bracket-same-line --print-width 160'
snap.help = ""
snap.cmd = "poe snip"
snap.use_exec = true
snip.help = "Take a screenshot of the app after a certain delay, before saving to the docs screenshots folder"
snip.cmd = "textual run --screenshot ${delay} rovr.__main__:cli --screenshot-path docs/public/screenshots --screenshot-filename ${filename} -- --without theme.transparent"
snip.args = [
{ name = "filename", help = "Filename of the screenshot", type = "string", positional = true, required = true },
{ name = "delay", help = "Delay in seconds before taking the screenshot", default = 10, type = "integer" },
]
snip.use_exec = true
tokei.help = "Run tokei"
tokei.cmd = " tokei --sort lines --exclude '*.svg' --exclude 'schema.mdx' --exclude 'src/rovr/classes/config.pyi' --exclude '*lock' --hidden"
pnpm.help = "Run pnpm in the docs folder"
pnpm.cmd = "pnpm --dir docs"
[tool.poe.tasks.test]
help = "Run tests"
cmd = "pytest -n ${workers} ${FILES} $POE_EXTRA_ARGS"
args = [
{ name = "FILES", help = "Specific test files or directories to run (optional)", type = "string", positional = true, required = false, multiple = true },
{ name = "workers", help = "Number of parallel workers for test execution (optional)", default = 4, type = "integer", options = ["-n"] },
]
[tool.poe.tasks.build]
help = "Build rovr into an executable using Nuitka"
sequence = [
{ cmd = "uv sync --group build --extra speedup --no-dev" }, # no dev because for some reason, stuff gets included
"_schema_compile",
"_warn_dump",
"_hash_dump",
# --python-flag=-m
# "nuitka $POE_EXTRA_ARGS",
{ cmd = 'nuitka --lto=${lto} --mode=${mode} --report=${report} --include-module=rovr._schema_validator --user-package-configuration-file=nuitka.config.yml --user-plugin=docs/scripts/nuitka_bytecode_plugin.py src/rovr --onefile-tempdir-spec="{TEMP}/rovr_onefile_0.10.1" $POE_EXTRA_ARGS' },
{ cmd = "docs/scripts/post-nuitka-build.py" },
"_dump_clean",
]
args = [
{ name = "mode", help = "Build mode: onefile (default) or standalone", default = "onefile", positional = true, choices = ["standalone", "onefile"] },
{ name = "lto", help = "Enable LTO (doesn't work with zig)", default = "yes", choices = ["yes", "no"], options = ["--lto"] },
{ name = "report", help = "Where to output the Nuitka report", default = "report.xml", options = ["--report"] },
]
[tool.poe.tasks.uv-build]
help = "Build rovr distributions using uv and include commit hash"
sequence = [
"_schema_compile",
"_hash_dump",
"_warn_dump",
{ cmd = "uv build" },
"_dump_clean",
]
[tool.poe.tasks.flame]
help = "Start rovr with pyinstrument for flamegraph profiling"
cmd = "pyinstrument --renderer=${renderer} --timeline --use-timing-thread --show-all -m rovr $POE_EXTRA_ARGS"
use_exec = true
args = [
{ name = "renderer", help = "Output format for the flamegraph (default: html)", default = "html", positional = true },
]
[tool.pytest]
testpaths = ["tests"]
asyncio_mode = "auto"
filterwarnings = [
'ignore::DeprecationWarning'
]
[tool.ruff]
force-exclude = true
exclude = []
[tool.ruff.lint]
select = [
"ASYNC220",
"ASYNC221",
"ASYNC251",
"ANN",
"B019",
"COM819",
"C400",
"DOC",
"D404",
"E",
"F",
"I",
"N801", "N802", "N805",
"PLE1142",
"Q",
"SIM",
"TD",
"W",
]
ignore = [
"ANN002",
"ANN003",
"ANN401",
"E501",
"E731",
"TD002",
"TD003",
"W505",
]
preview = true
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"
preview = true
[tool.ty.rules]
unresolved-reference = "ignore" # handled by ruff
unresolved-attribute = "ignore"
no-matching-overload = "ignore" # not that accurate
# possibly-missing-attribute = "ignore" # no it is not missing
invalid-assignment = "warn" # probably already but warn for future
unused-ignore-comment = "ignore"