Skip to content

Commit

Permalink
chore(ci): cleanup justfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
jeertmans committed Sep 11, 2024
1 parent 2b91eba commit 592daa5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -278,20 +278,17 @@ jobs:
linkcheck-docs:
runs-on: ubuntu-latest
env:
NO_RYE: 1
steps:
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-python@v5
- name: Setup Rye
uses: eifinger/setup-rye@v4
with:
python-version: '3.11'
cache: pip
cache-dependency-path: requirements-dev.lock
enable-cache: true

- name: Install dependencies
run: pip install -r requirements-dev.lock
run: rye sync

- name: Install Just
uses: taiki-e/install-action@just
Expand Down
7 changes: 2 additions & 5 deletions docs/justfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Run Python commands inside environment
env-run := if env("NO_RYE", "") == "1" { "" } else { "rye run" }

# Default command (list all commands)
default:
@just --list
Expand All @@ -12,11 +9,11 @@ clean:

# Build docs
build builder="html" *OPTIONS="-W --keep-going":
{{env-run}} sphinx-build -M {{builder}} source build {{OPTIONS}}
rye run sphinx-build -M {{builder}} source build {{OPTIONS}}

# Build docs in "draft" mode
draft *ARGS:
NB_OFF="1" just build {{ARGS}}
NB_OFF="1" just build {{ARGS}}

# Check links
linkcheck *ARGS: (draft "linkcheck" ARGS)
Expand Down
11 changes: 4 additions & 7 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Run Python commands inside environment
env-run := if env("NO_RYE", "") == "1" { "" } else { "rye run" }

# Default command (list all commands)
default:
@just --list
Expand All @@ -13,7 +10,7 @@ bench: bench-python bench-rust
[group('python')]
[group('test')]
bench-python *ARGS:
pytest --benchmark-only {{ARGS}}
rye run pytest --benchmark-only {{ARGS}}

# Benchmark Rust code
[group('rust')]
Expand All @@ -29,7 +26,7 @@ build *ARGS:
# Bump packages version
[group('dev')]
bump +ARGS="patch":
{{env-run}} bump-my-version {{ARGS}}
rye run bump-my-version {{ARGS}}

# Check the code can compile
[group('rust')]
Expand All @@ -51,7 +48,7 @@ install:
# Run code linters and formatters
[group('dev')]
lint:
{{env-run}} pre-commit run --all-files
rye pre-commit run --all-files

alias fmt := lint

Expand All @@ -63,7 +60,7 @@ test: test-python test-rust
[group('python')]
[group('test')]
test-python *ARGS:
{{env-run}} pytest {{ARGS}}
rye pytest {{ARGS}}

# Test Rust code
[group('rust')]
Expand Down

0 comments on commit 592daa5

Please sign in to comment.