Skip to content

Commit ba9e5cf

Browse files
authoredJan 27, 2025··
Upgrade dev-cmd and document commands & tasks. (#128)
Now: ```console :; uvrc -l Commands: (5 commands are hidden.) check-python-version fmt check-fmt lint check-lint type-check doc -type: The type of sphinx doc to build. One of: html, dirhtml, htmlhelp, qthelp, devhelp, text, gettext, linkcheck or xml. [default: html] Tasks: test linkcheck: Check documentation for broken links. package: Build the science scies using science from local sources. science: Runs science from local sources. Accepts extra args after --. checks: Runs all development checks, including auto-formatting code. ci: Runs all checks used for CI. ```
1 parent 2bd9199 commit ba9e5cf

File tree

2 files changed

+43
-13
lines changed

2 files changed

+43
-13
lines changed
 

‎pyproject.toml

+38-10
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,12 @@ check-lint = ["ruff", "check"]
101101

102102
type-check = ["mypy", "docs/_ext", "science", "scripts", "setup.py", "tests", "test-support"]
103103

104-
doc = ["sphinx-build", "-b", "{-type:html}", "-aEW", "docs", "docs/build/{-type:html}"]
104+
[tool.dev-cmd.commands.create-zipapp]
105+
args = ["scripts/create-zipapp.py"]
106+
hidden = true
105107

106-
create-zipapp = ["scripts/create-zipapp.py"]
107-
108-
package-thin-scie = [
108+
[tool.dev-cmd.commands.package-thin-scie]
109+
args = [
109110
"python",
110111
"dist/science.pyz",
111112
"lift",
@@ -121,8 +122,10 @@ package-thin-scie = [
121122
"--dest-dir",
122123
"dist",
123124
]
125+
hidden = true
124126

125-
package-fat-scie = [
127+
[tool.dev-cmd.commands.package-fat-scie]
128+
args = [
126129
"python",
127130
"dist/science.pyz",
128131
"lift",
@@ -142,29 +145,54 @@ package-fat-scie = [
142145
"--dest-dir",
143146
"dist",
144147
]
148+
hidden = true
149+
150+
[tool.dev-cmd.commands.doc.factors]
151+
type = """\
152+
The type of sphinx doc to build. One of:
153+
html, dirhtml, htmlhelp, qthelp, devhelp, text, gettext, linkcheck or xml.
154+
"""
155+
[tool.dev-cmd.commands.doc]
156+
args = ["sphinx-build", "-b", "{-type:html}", "-aEW", "docs", "docs/build/{-type:html}"]
145157

146158
[tool.dev-cmd.commands.run-zipapp]
147159
env = {"SCIENCE_DOC_LOCAL" = "docs/build/html"}
148160
args = ["python", "dist/science.pyz"]
149161
accepts-extra-args = true
162+
hidden = true
150163

151164
[tool.dev-cmd.commands.pytest]
152165
args = ["pytest", "-n", "auto"]
153166
cwd = "tests"
154167
accepts-extra-args = true
168+
hidden = true
155169
[tool.dev-cmd.commands.pytest.env]
156170
BUILD_ROOT = ".."
157171
PYTHONPATH = "../test-support"
158172
SCIENCE_TEST_PYZ_PATH = "../dist/science.pyz"
159173

160174
[tool.dev-cmd.tasks]
161-
linkcheck = ["doc-type:linkcheck"]
162175
test = ["create-zipapp", "pytest"]
163-
checks = [["check-python-version", ["fmt", "lint"]], "type-check", "test"]
164-
ci = [["check-python-version", "check-fmt", "check-lint", "type-check"], "test"]
165-
science = [["doc", "create-zipapp"], "run-zipapp"]
166176

167-
package = [["doc", "create-zipapp"], ["package-thin-scie", "package-fat-scie"]]
177+
[tool.dev-cmd.tasks.linkcheck]
178+
description = "Check documentation for broken links."
179+
steps = ["doc-type:linkcheck"]
180+
181+
[tool.dev-cmd.tasks.package]
182+
description = "Build the science scies using science from local sources."
183+
steps = [["doc", "create-zipapp"], ["package-thin-scie", "package-fat-scie"]]
184+
185+
[tool.dev-cmd.tasks.science]
186+
description = "Runs science from local sources. Accepts extra args after --."
187+
steps = [["doc", "create-zipapp"], "run-zipapp"]
188+
189+
[tool.dev-cmd.tasks.checks]
190+
description = "Runs all development checks, including auto-formatting code."
191+
steps = [["check-python-version", ["fmt", "lint"]], "type-check", "test"]
192+
193+
[tool.dev-cmd.tasks.ci]
194+
description = "Runs all checks used for CI."
195+
steps = [["check-python-version", "check-fmt", "check-lint", "type-check"], "test"]
168196

169197
[tool.dev-cmd]
170198
default = "checks"

‎uv.lock

+5-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.