Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dev-cmd and document commands & tasks. #128

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 38 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,12 @@ check-lint = ["ruff", "check"]

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

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

create-zipapp = ["scripts/create-zipapp.py"]

package-thin-scie = [
[tool.dev-cmd.commands.package-thin-scie]
args = [
"python",
"dist/science.pyz",
"lift",
Expand All @@ -121,8 +122,10 @@ package-thin-scie = [
"--dest-dir",
"dist",
]
hidden = true

package-fat-scie = [
[tool.dev-cmd.commands.package-fat-scie]
args = [
"python",
"dist/science.pyz",
"lift",
Expand All @@ -142,29 +145,54 @@ package-fat-scie = [
"--dest-dir",
"dist",
]
hidden = true

[tool.dev-cmd.commands.doc.factors]
type = """\
The type of sphinx doc to build. One of:
html, dirhtml, htmlhelp, qthelp, devhelp, text, gettext, linkcheck or xml.
"""
[tool.dev-cmd.commands.doc]
args = ["sphinx-build", "-b", "{-type:html}", "-aEW", "docs", "docs/build/{-type:html}"]

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

[tool.dev-cmd.commands.pytest]
args = ["pytest", "-n", "auto"]
cwd = "tests"
accepts-extra-args = true
hidden = true
[tool.dev-cmd.commands.pytest.env]
BUILD_ROOT = ".."
PYTHONPATH = "../test-support"
SCIENCE_TEST_PYZ_PATH = "../dist/science.pyz"

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

package = [["doc", "create-zipapp"], ["package-thin-scie", "package-fat-scie"]]
[tool.dev-cmd.tasks.linkcheck]
description = "Check documentation for broken links."
steps = ["doc-type:linkcheck"]

[tool.dev-cmd.tasks.package]
description = "Build the science scies using science from local sources."
steps = [["doc", "create-zipapp"], ["package-thin-scie", "package-fat-scie"]]

[tool.dev-cmd.tasks.science]
description = "Runs science from local sources. Accepts extra args after --."
steps = [["doc", "create-zipapp"], "run-zipapp"]

[tool.dev-cmd.tasks.checks]
description = "Runs all development checks, including auto-formatting code."
steps = [["check-python-version", ["fmt", "lint"]], "type-check", "test"]

[tool.dev-cmd.tasks.ci]
description = "Runs all checks used for CI."
steps = [["check-python-version", "check-fmt", "check-lint", "type-check"], "test"]

[tool.dev-cmd]
default = "checks"
Expand Down
8 changes: 5 additions & 3 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading