Skip to content

Commit 18f8d28

Browse files
Merge pull request #725 from pyathena-dev/feature/migrate-makefile-to-just
2 parents 1bf6e39 + 15007c1 commit 18f8d28

9 files changed

Lines changed: 107 additions & 76 deletions

File tree

‎.github/workflows/docs-lint.yaml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- '**.md'
88
- '.markdownlint-cli2.jsonc'
99
- '.mise.toml'
10-
- 'Makefile'
10+
- 'justfile'
1111
- '.github/workflows/docs-lint.yaml'
1212

1313
permissions:
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2121
- uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1
22-
- run: make docs/lint
22+
- run: just docs lint
2323

2424
build:
2525
runs-on: ubuntu-latest
@@ -33,4 +33,4 @@ jobs:
3333
enable-cache: true
3434
- run: |
3535
uv sync --group dev
36-
make docs/build
36+
just docs build

‎.github/workflows/docs.yaml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,12 @@ jobs:
3030
with:
3131
python-version: ${{ matrix.python-version }}
3232
enable-cache: true
33+
- uses: taiki-e/install-action@7a79fe8c3a13344501c80d99cae481c1c9085912 # v2.81.10
34+
with:
35+
tool: just
3336
- run: |
3437
uv sync --group dev
35-
make docs/build
38+
just docs build
3639
- name: Upload artifact
3740
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
3841
with:

‎.github/workflows/test-suite.yaml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ jobs:
3939
with:
4040
python-version: ${{ matrix.python-version }}
4141
if: matrix.python-version == '3.13' || matrix.python-version == '3.14'
42+
- uses: taiki-e/install-action@7a79fe8c3a13344501c80d99cae481c1c9085912 # v2.81.10
43+
with:
44+
tool: just
4245
- run: |
43-
make tool
46+
just tool
4447
4548
- name: Configure AWS credentials
4649
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
@@ -51,4 +54,4 @@ jobs:
5154

5255
- name: Test
5356
run: |
54-
make tox
57+
just tox

‎.mise.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[tools]
22
python = "3.12"
3+
just = "latest"
34
"npm:markdownlint-cli2" = "0.18.1"

‎CLAUDE.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ PyAthena is a Python DB API 2.0 (PEP 249) compliant client for Amazon Athena. Se
2020
### Code Quality — Always Run Before Committing
2121

2222
```bash
23-
make format # Auto-fix formatting and imports
24-
make lint # Lint + format check + mypy
23+
just format # Auto-fix formatting and imports
24+
just lint # Lint + format check + mypy
2525
```
2626

2727
### Testing
2828

2929
```bash
30-
# ALWAYS run `make lint` first — tests will fail if lint doesn't pass
31-
make test/pyathena # Unit tests (runs lint first)
32-
make test/sqla # SQLAlchemy dialect tests
33-
make test/sqla-async # SQLAlchemy async dialect tests
30+
# ALWAYS run `just lint` first — tests will fail if lint doesn't pass
31+
just test pyathena # Unit tests (runs lint first)
32+
just test sqla # SQLAlchemy dialect tests
33+
just test sqla-async # SQLAlchemy async dialect tests
3434
```
3535

3636
Tests require AWS environment variables. Use a `.env` file (gitignored):
@@ -48,7 +48,7 @@ export $(cat .env | xargs) && uv run pytest tests/pyathena/test_file.py -v
4848

4949
- Tests mirror source structure under `tests/pyathena/`
5050
- Use pytest fixtures from `conftest.py`
51-
- New features require tests; changes to SQLAlchemy dialects must pass `make test-sqla`
51+
- New features require tests; changes to SQLAlchemy dialects must pass `just test sqla`
5252

5353
#### Test Conventions
5454

@@ -74,9 +74,9 @@ export $(cat .env | xargs) && uv run pytest tests/pyathena/test_file.py -v
7474

7575
```bash
7676
mise install # one-time: installs markdownlint-cli2
77-
make docs/lint # check
78-
make docs/format # auto-fix what's possible
79-
make docs/build # build the Sphinx site under docs/_build/html
77+
just docs lint # check
78+
just docs format # auto-fix what's possible
79+
just docs build # build the Sphinx site under docs/_build/html
8080
```
8181

8282
## Architecture — Key Design Decisions

‎Makefile‎

Lines changed: 0 additions & 50 deletions
This file was deleted.

‎docs/testing.md‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,20 @@ $ export AWS_ATHENA_MANAGED_WORKGROUP=pyathena-managed
3131

3232
## Run test
3333

34+
The task runner uses [just](https://github.com/casey/just). Install it with `mise use -g just`, `brew install just`, or `cargo install just`.
35+
3436
```bash
3537
$ pip install uv or pipx install uv or brew install uv or mise install uv
36-
$ make test/pyathena
37-
$ make test/sqla
38-
$ make test/sqla-async
38+
$ just test pyathena
39+
$ just test sqla
40+
$ just test sqla-async
3941
```
4042

4143
## Run test multiple Python versions
4244

4345
```bash
4446
$ pip install uv or pipx install uv or brew install uv or mise install uv
45-
$ make tox
47+
$ just tox
4648
```
4749

4850
## Code formatting
@@ -52,13 +54,13 @@ The code formatting uses [ruff](https://github.com/astral-sh/ruff).
5254
### Appy format
5355

5456
```bash
55-
$ make format
57+
$ just format
5658
```
5759

5860
### Lint and check format
5961

6062
```bash
61-
$ make lint
63+
$ just lint
6264
```
6365

6466
## GitHub Actions

‎justfile‎

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
RUFF_VERSION := "0.14.14"
2+
TOX_VERSION := "4.34.1"
3+
4+
# List available recipes
5+
default:
6+
@just --list
7+
8+
# Auto-fix formatting and imports
9+
format:
10+
# TODO: https://github.com/astral-sh/uv/issues/5903
11+
uvx ruff@{{RUFF_VERSION}} check --select I --fix .
12+
uvx ruff@{{RUFF_VERSION}} format .
13+
14+
# Lint + format check + mypy
15+
lint:
16+
uvx ruff@{{RUFF_VERSION}} check .
17+
uvx ruff@{{RUFF_VERSION}} format --check .
18+
uv run mypy .
19+
20+
# Run tests: just test (pyathena|sqla|sqla-async)
21+
test target="help":
22+
@just _test-{{ if target =~ "^-" { "help" } else { target } }}
23+
24+
_test-help:
25+
@echo "Usage: just test <target>"
26+
@echo ""
27+
@echo "Targets:"
28+
@echo " pyathena Run unit tests (runs lint first)"
29+
@echo " sqla Run SQLAlchemy dialect tests"
30+
@echo " sqla-async Run SQLAlchemy async dialect tests"
31+
32+
_test-pyathena: lint
33+
uv run pytest -n 8 --cov pyathena --cov-report html --cov-report term tests/pyathena/
34+
35+
_test-sqla:
36+
uv run pytest -n 8 --cov pyathena --cov-report html --cov-report term tests/sqlalchemy/
37+
38+
_test-sqla-async:
39+
uv run pytest -n 8 --cov pyathena --cov-report html --cov-report term tests/sqlalchemy/ --dburi async
40+
41+
# Run tests across multiple Python versions with tox
42+
tox:
43+
uvx tox@{{TOX_VERSION}} -c pyproject.toml run
44+
45+
# Docs: just docs (build|lint|format)
46+
docs target="help":
47+
@just _docs-{{ if target =~ "^-" { "help" } else { target } }}
48+
49+
_docs-help:
50+
@echo "Usage: just docs <target>"
51+
@echo ""
52+
@echo "Targets:"
53+
@echo " build Build the Sphinx documentation site (docs/_build/html)"
54+
@echo " lint Lint Markdown with markdownlint-cli2"
55+
@echo " format Auto-fix Markdown with markdownlint-cli2"
56+
57+
_docs-build:
58+
uv run sphinx-multiversion docs docs/_build/html
59+
echo '<meta http-equiv="refresh" content="0; url=./master/index.html">' > docs/_build/html/index.html
60+
echo 'pyathena.dev' > docs/_build/html/CNAME
61+
touch docs/_build/html/.nojekyll
62+
63+
_docs-lint:
64+
mise exec -- markdownlint-cli2
65+
66+
_docs-format:
67+
mise exec -- markdownlint-cli2 --fix
68+
69+
# Install development tools
70+
tool:
71+
uv tool install ruff@{{RUFF_VERSION}}
72+
uv tool install tox@{{TOX_VERSION}} --with tox-uv --with tox-gh-actions

‎pyproject.toml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,12 @@ TEST_TYPE =
223223
allowlist_externals =
224224
uv
225225
uvx
226-
make
226+
just
227227
commands =
228228
uv sync --group dev
229-
pyathena: make test/pyathena
230-
sqla: make test/sqla
231-
sqla_async: make test/sqla-async
229+
pyathena: just test pyathena
230+
sqla: just test sqla
231+
sqla_async: just test sqla-async
232232
passenv =
233233
TOXENV
234234
AWS_*

0 commit comments

Comments
 (0)