Skip to content

Commit

Permalink
Update to released dev-cmd runner.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois committed Dec 22, 2024
1 parent 548e763 commit b116e38
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 40 deletions.
7 changes: 3 additions & 4 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ bootstrapping `science` for use in Python project easier:
Development uses [`uv`](https://docs.astral.sh/uv/getting-started/installation/). Install as you
best see fit.

With `uv` installed, running `uv run scripts/ci.py` is enough to get the tools inst-science uses
installed and run against the codebase. This includes formatting code, running lint checks and then
running tests.

With `uv` installed, running `uv run dev-cmd` is enough to get the tools inst-science uses installed
and run against the codebase. This includes formatting code, linting code, performing type checks
and then running tests.
1 change: 0 additions & 1 deletion python/inst_science/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@

from inst_science import shim


if __name__ == "__main__":
shim.science()
42 changes: 34 additions & 8 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ dependencies = [
"appdirs",
"filelock",
"httpx",
"packaging",
"tomlkit",
"tqdm"
]
dynamic = ["version"]
Expand All @@ -23,21 +25,45 @@ dynamic = ["version"]
inst-science = "inst_science.shim:science"
inst-science-util = "inst_science.util:main"

[dependency-groups]
dev = [
"pex",
"pytest",
"pytest-xdist",
"ruff",
]

[tool.setuptools.dynamic]
version = {attr = "inst_science.__version__"}

[tool.setuptools.packages.find]
where = ["."]
include = ["inst_science*"]

[dependency-groups]
dev = [
"dev-cmd",
"mypy",
"pytest",
"pytest-xdist",
"ruff",
"types-tqdm",
]

[tool.ruff]
line-length = 100

[tool.ruff.lint]
extend-select = ["I"]

[tool.dev-cmd.commands]
fmt = ["ruff", "format"]
check-fmt = ["ruff", "format", "--diff"]

lint = ["ruff", "check", "--fix"]
check-lint = ["ruff", "check"]

type-check = ["mypy", "inst_science"]

[tool.dev-cmd.commands.test]
args = ["pytest", "-n", "auto"]
accepts-extra-args = true

[tool.dev-cmd.aliases]
checks = ["fmt", "lint", "type-check", "test"]
ci = ["check-fmt", "check-lint", "type-check", "test"]

[tool.dev-cmd.default]
alias = "checks"
17 changes: 0 additions & 17 deletions python/scripts/ci.py

This file was deleted.

131 changes: 121 additions & 10 deletions python/uv.lock

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

0 comments on commit b116e38

Please sign in to comment.