Skip to content

Commit 09335b5

Browse files
committed
feat(tasks): switch from pyinvoke to just (#42)
1 parent fc667cd commit 09335b5

34 files changed

+1966
-938
lines changed
File renamed without changes.

.github/workflows/check.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414
- uses: ./.github/actions/setup
15-
- run: uv sync --group=checks
16-
- run: uv run invoke checks.format
17-
- run: uv run invoke checks.type
18-
- run: uv run invoke checks.code
19-
- run: uv run invoke checks.security
20-
- run: uv run invoke checks.coverage
15+
- run: uv sync --group=check
16+
- run: uv run just check-code
17+
- run: uv run just check-type
18+
- run: uv run just check-format
19+
- run: uv run just check-security
20+
- run: uv run just check-coverage

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717
- uses: ./.github/actions/setup
18-
- run: uv sync --group=docs
19-
- run: uv run invoke docs
18+
- run: uv sync --group=doc
19+
- run: uv run just docs
2020
- uses: JamesIves/github-pages-deploy-action@v4
2121
with:
2222
folder: docs/
@@ -29,7 +29,7 @@ jobs:
2929
- uses: actions/checkout@v4
3030
- uses: ./.github/actions/setup
3131
- run: uv sync --only-dev
32-
- run: uv run invoke packages
32+
- run: uv run just packages
3333
- uses: docker/login-action@v3
3434
with:
3535
registry: ghcr.io

.pre-commit-config.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ default_language_version:
55
python: python3.13
66
repos:
77
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: v4.1.0
8+
rev: 'v5.0.0'
99
hooks:
1010
- id: check-added-large-files
1111
- id: check-case-conflict
@@ -17,12 +17,16 @@ repos:
1717
- id: mixed-line-ending
1818
- id: trailing-whitespace
1919
- repo: https://github.com/astral-sh/ruff-pre-commit
20-
rev: v0.9.9
20+
rev: 'v0.9.9'
2121
hooks:
2222
- id: ruff
2323
- id: ruff-format
24+
- repo: https://github.com/PyCQA/bandit
25+
rev: '1.8.3'
26+
hooks:
27+
- id: bandit
2428
- repo: https://github.com/commitizen-tools/commitizen
25-
rev: v4.4.1
29+
rev: 'v4.4.1'
2630
hooks:
2731
- id: commitizen
2832
- id: commitizen-branch

README.md

Lines changed: 85 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ You can use this package as part of your MLOps toolkit or platform (e.g., Model
3636
- [Automation](#automation-1)
3737
- [Commits: Commitizen](#commits-commitizen)
3838
- [Git Hooks: Pre-Commit](#git-hooks-pre-commit)
39-
- [Tasks: PyInvoke](#tasks-pyinvoke)
39+
- [Tasks: Just](#tasks-just)
4040
- [CI/CD](#cicd)
4141
- [Runner: GitHub Actions](#runner-github-actions)
4242
- [CLI](#cli)
@@ -76,7 +76,7 @@ You can use this package as part of your MLOps toolkit or platform (e.g., Model
7676
- [Runtime: Docker](#runtime-docker)
7777
- [Programming](#programming)
7878
- [Language: Python](#language-python)
79-
- [Version: Pyenv](#version-pyenv)
79+
- [Version: Uv](#version-uv)
8080
- [Observability](#observability)
8181
- [Reproducibility: Mlflow Project](#reproducibility-mlflow-project)
8282
- [Monitoring : Mlflow Evaluate](#monitoring--mlflow-evaluate)
@@ -220,71 +220,90 @@ with job as runner:
220220

221221
This project includes several automation tasks to easily repeat common actions.
222222

223-
You can invoke the actions from the [command-line](https://www.pyinvoke.org/) or [VS Code extension](https://marketplace.visualstudio.com/items?itemName=dchanco.vsc-invoke).
223+
You can invoke the actions from the [command-line](https://just.systems/man/en/introduction.html) or [VS Code extension](https://marketplace.visualstudio.com/items?itemName=nefrob.vscode-just-syntax).
224224

225225
```bash
226226
# execute the project DAG
227-
$ inv projects
227+
$ just project
228228
# create a code archive
229-
$ inv packages
229+
$ just package
230230
# list other actions
231-
$ inv --list
231+
$ just
232232
```
233233

234234
**Available tasks**:
235-
- **checks.all (checks)** - Run all check tasks.
236-
- **checks.code** - Check the codes with ruff.
237-
- **checks.coverage** - Check the coverage with coverage.
238-
- **checks.format** - Check the formats with ruff.
239-
- **checks.security** - Check the security with bandit.
240-
- **checks.test** - Check the tests with pytest.
241-
- **checks.type** - Check the types with mypy.
242-
- **cleans.all (cleans)** - Run all tools and folders tasks.
243-
- **cleans.cache** - Clean the cache folder.
244-
- **cleans.coverage** - Clean the coverage tool.
245-
- **cleans.dist** - Clean the dist folder.
246-
- **cleans.docs** - Clean the docs folder.
247-
- **cleans.environment** - Clean the project environment file.
248-
- **cleans.folders** - Run all folders tasks.
249-
- **cleans.mlruns** - Clean the mlruns folder.
250-
- **cleans.mypy** - Clean the mypy tool.
251-
- **cleans.outputs** - Clean the outputs folder.
252-
- **cleans.projects** - Run all projects tasks.
253-
- **cleans.pytest** - Clean the pytest tool.
254-
- **cleans.python** - Clean python caches and bytecodes.
255-
- **cleans.requirements** - Clean the project requirements file.
256-
- **cleans.reset** - Run all tools, folders, and sources tasks.
257-
- **cleans.ruff** - Clean the ruff tool.
258-
- **cleans.sources** - Run all sources tasks.
259-
- **cleans.tools** - Run all tools tasks.
260-
- **cleans.uv** - Clean uv lock file.
261-
- **cleans.venv** - Clean the venv folder.
262-
- **commits.all (commits)** - Run all commit tasks.
263-
- **commits.bump** - Bump the version of the package.
264-
- **commits.commit** - Commit all changes with a message.
265-
- **commits.info** - Print a guide for messages.
266-
- **containers.all (containers)** - Run all container tasks.
267-
- **containers.build** - Build the container image with the given tag.
268-
- **containers.compose** - Start up docker compose.
269-
- **containers.run** - Run the container image with the given tag.
270-
- **docs.all (docs)** - Run all docs tasks.
271-
- **docs.api** - Document the API with pdoc using the given format and output directory.
272-
- **docs.serve** - Serve the API docs with pdoc using the given format and computer port.
273-
- **formats.all** - (formats) Run all format tasks.
274-
- **formats.imports** - Format python imports with ruff.
275-
- **formats.sources** - Format python sources with ruff.
276-
- **installs.all (installs)** - Run all install tasks.
277-
- **installs.pre-commit** - Install pre-commit hooks on git.
278-
- **installs.uv** - Install uv packages.
279-
- **mlflow.all (mlflow)** - Run all mlflow tasks.
280-
- **mlflow.doctor** - Run mlflow doctor to diagnose issues.
281-
- **mlflow.serve** - Start mlflow server with the given host, port, and backend uri.
282-
- **packages.all (packages)** - Run all package tasks.
283-
- **packages.build** - Build a python package with the given format.
284-
- **projects.all (projects)** - Run all project tasks.
285-
- **projects.environment** - Export the project environment file.
286-
- **projects.requirements** - Export the project requirements file.
287-
- **projects.run** - Run an mlflow project from MLproject file.
235+
236+
```toml
237+
default # display help information
238+
239+
[check]
240+
check # run check tasks
241+
check-code # check code quality
242+
check-coverage numprocesses="auto" cov_fail_under="80" # check code coverage
243+
check-format # check code format
244+
check-security # check code security
245+
check-test numprocesses="auto" # check unit tests
246+
check-type # check code typing
247+
248+
[clean]
249+
clean # run clean tasks
250+
clean-build # clean build folders
251+
clean-cache # clean cache folder
252+
clean-constraints # clean constraints file
253+
clean-coverage # clean coverage files
254+
clean-docs # clean docs folder
255+
clean-environment # clean environment file
256+
clean-mlruns # clean mlruns folder
257+
clean-mypy # clean mypy folders
258+
clean-outputs # clean outputs folder
259+
clean-pytest # clean pytest cache
260+
clean-python # clean python caches
261+
clean-requirements # clean requirements file
262+
clean-ruff # clean ruff cache
263+
clean-venv # clean venv folder
264+
265+
[commit]
266+
commit-bump # bump package
267+
commit-files # commit package
268+
commit-info # get commit info
269+
270+
[doc]
271+
doc # run doc tasks
272+
doc-build format="google" output="docs" # build documentation
273+
doc-serve format="google" port="8088" # serve documentation
274+
275+
[docker]
276+
docker # run docker tasks
277+
docker-build tag="latest" # build docker image
278+
docker-compose # start docker compose
279+
docker-run tag="latest" # run latest docker image
280+
281+
[format]
282+
format # run format tasks
283+
format-import # format code import
284+
format-source # format code source
285+
286+
[install]
287+
install # run install tasks
288+
install-hooks # install git hooks
289+
install-project # install the project
290+
291+
[mlflow]
292+
mlflow # run mlflow tasks
293+
mlflow-doctor # run mlflow doctor
294+
mlflow-serve host="127.0.0.1" port="5000" uri="./mlruns" # start mlflow server
295+
296+
[package]
297+
package # run package tasks
298+
package-build constraints="constraints.txt" # build python package
299+
package-constraints constraints="constraints.txt" # build package constraints
300+
301+
[project]
302+
project # run project tasks
303+
project-environment # export environment file
304+
project-requirements # export requirements file
305+
project-run job # run project job using mlflow
306+
```
288307

289308
## Workflows
290309

@@ -324,16 +343,17 @@ Pre-defined actions to automate your project development.
324343
- **Alternatives**:
325344
- [Git Hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks): less convenient to use
326345

327-
### Tasks: [PyInvoke](https://www.pyinvoke.org/)
346+
### Tasks: [Just](https://just.systems/man/en/introduction.html)
328347

329348
- **Motivations**:
330349
- Automate project workflows
331350
- Sane syntax compared to alternatives
332-
- Good trade-off between power/simplicity
351+
- Good trade-off between power and simplicity
333352
- **Limitations**:
334353
- Not familiar to most developers
335354
- **Alternatives**:
336355
- [Make](https://www.gnu.org/software/make/manual/make.html): most popular, but awful syntax
356+
- [PyInvoke](https://www.pyinvoke.org/): pythonic, but verbose and less straightforward.
337357

338358
## CI/CD
339359

@@ -581,8 +601,8 @@ Generate and share the project documentations.
581601
- **Limitations**:
582602
- Only support API docs (i.e., no custom docs)
583603
- **Alternatives**:
584-
- [Sphinx](https://www.sphinx-doc.org/en/master/): Most complete, overkill for simple projects
585-
- [Mkdocs](https://www.mkdocs.org/): no support for API doc, which is the core feature
604+
- [Sphinx](https://www.sphinx-doc.org/en/master/): More complete, overkill for simple projects
605+
- [Mkdocs](https://www.mkdocs.org/): More complete, but requires more setup
586606

587607
### Format: [Google](https://google.github.io/styleguide/pyguide.html)
588608

@@ -727,7 +747,7 @@ Select your programming environment.
727747
- [R](https://www.r-project.org/): specific purpose language
728748
- [Julia](https://julialang.org/): specific purpose language
729749

730-
### Version: [Pyenv](https://github.com/pyenv/pyenv)
750+
### Version: [Uv](https://docs.astral.sh/uv/guides/install-python/)
731751

732752
- **Motivations**:
733753
- Switch between Python version
@@ -737,6 +757,7 @@ Select your programming environment.
737757
- Require some shell configurations
738758
- **Alternatives**:
739759
- Manual installation: time consuming
760+
- [PyEnv](https://github.com/pyenv/pyenv): shell-based, require more setup
740761

741762
## Observability
742763

0 commit comments

Comments
 (0)