Skip to content

Commit 5d89357

Browse files
committed
build: Replace Makefile with justfile
Migrate the primary development tasks from make to just: - Add a justfile with the build, format, lint, test, watch, and version recipes, keeping the quiet output of the Makefile's @-prefixed rules. - Install just in CI via the shared setup action and in the devcontainer. - Point the workflows, the postgenerate npm script, the README, and .editorconfig at just. The tag message in the version recipe is now the version, as intended. In the Makefile, `-m "$(poetry version -s)"` was expanded by make rather than the shell, so it produced an empty message.
1 parent e71a02e commit 5d89357

12 files changed

Lines changed: 54 additions & 41 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT}
55
ARG NODE_VERSION="24"
66
ARG POETRY_VERSION="1.8.2"
77
ARG POETRY_SRC="https://install.python-poetry.org"
8+
ARG JUST_VERSION="1.57.0"
9+
ARG JUST_SRC="https://just.systems/install.sh"
810

911
# https://github.com/microsoft/vscode-dev-containers/blob/main/containers/go/.devcontainer/base.Dockerfile
1012
ENV USERNAME=vscode
@@ -25,6 +27,9 @@ RUN curl -fsSL -o install-poetry.py "${POETRY_SRC}" \
2527
&& python install-poetry.py --version $POETRY_VERSION \
2628
&& rm install-poetry.py
2729

30+
RUN mkdir -p .local/bin \
31+
&& curl -fsSL "${JUST_SRC}" | bash -s -- --tag "${JUST_VERSION}" --to /home/vscode/.local/bin
32+
2833
RUN mkdir -p .config/git \
2934
&& echo ".vscode/*" >> .config/git/ignore \
3035
&& echo "*.code-workspace" >> .config/git/ignore \

.devcontainer/devcontainer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"build": {
55
"dockerfile": "Dockerfile",
66
"args": {
7+
"JUST_VERSION": "1.57.0",
78
"NODE_VERSION": "24",
89
"POETRY_VERSION": "1.8.2",
910
"VARIANT": "3.12"

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ indent_size = 2
1111
[*.py]
1212
indent_size = 4
1313

14-
[Makefile]
15-
indent_style = tab
14+
[justfile]
15+
indent_size = 4

.github/actions/setup/action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ inputs:
1111
description: The Poetry version.
1212
required: false
1313
default: '1.8.2'
14+
just_version:
15+
description: The just version.
16+
required: false
17+
default: '1.57.0'
1418
install_dependencies:
1519
description: Install dependencies.
1620
required: false
@@ -36,6 +40,10 @@ runs:
3640
~/.local/bin
3741
~/.local/share/pypoetry
3842
~/Library/Application Support/pypoetry
43+
- name: Setup just
44+
uses: extractions/setup-just@v4
45+
with:
46+
just-version: ${{ inputs.just_version }}
3947
- name: Setup Python
4048
uses: actions/setup-python@v5
4149
with:

.github/workflows/_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
with:
3838
python_version: ${{ inputs.python_version }}
3939
- name: Build
40-
run: make build
40+
run: just build
4141
- name: Upload artifact
4242
uses: actions/upload-artifact@v7
4343
if: inputs.upload_artifact == 'true'

.github/workflows/check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Setup Node.js
3737
uses: ./.github/actions/setup-node
3838
- name: Test
39-
run: make test
39+
run: just test
4040
lint:
4141
name: Lint (Python ${{ matrix.python }})
4242
runs-on: ubuntu-latest
@@ -55,7 +55,7 @@ jobs:
5555
with:
5656
python_version: ${{ matrix.python }}
5757
- name: Lint
58-
run: make lint
58+
run: just lint
5959
build:
6060
name: Build (Python ${{ matrix.python }} on ${{ matrix.os_name }})
6161
uses: ./.github/workflows/_build.yml

.github/workflows/format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Setup Node.js
3333
uses: ./.github/actions/setup-node
3434
- name: Format
35-
run: make format
35+
run: just format
3636
- name: Format with Prettier
3737
run: npm run format
3838
- name: Commit

.github/workflows/version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ jobs:
3434
- name: Cut ${{ github.event.inputs.version }} version
3535
run: |
3636
poetry version "${{ github.event.inputs.version }}"
37-
make version
37+
just version

Makefile

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

README.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,9 @@ Run each command below in a separate terminal window:
452452

453453
::
454454

455-
$ make watch
455+
$ just watch
456456

457-
Primary development tasks are defined in the ``Makefile``.
457+
Primary development tasks are defined in the ``justfile``.
458458

459459
Source Code
460460
~~~~~~~~~~~
@@ -471,7 +471,7 @@ Clone the project with
471471
Requirements
472472
~~~~~~~~~~~~
473473

474-
You will need `Python 3`_ and Poetry_ and Node.js_ with npm_.
474+
You will need `Python 3`_ and Poetry_ and Node.js_ with npm_ and just_.
475475

476476
Install the development dependencies with
477477

@@ -480,6 +480,7 @@ Install the development dependencies with
480480
$ poetry install
481481
$ npm install
482482

483+
.. _just: https://just.systems/
483484
.. _Node.js: https://nodejs.org/
484485
.. _npm: https://www.npmjs.com/
485486
.. _Poetry: https://poetry.eustace.io/
@@ -492,20 +493,20 @@ Lint code with
492493

493494
::
494495

495-
$ make lint
496+
$ just lint
496497

497498

498499
Run tests with
499500

500501
::
501502

502-
$ make test
503+
$ just test
503504

504505
Run tests on changes with
505506

506507
::
507508

508-
$ make watch
509+
$ just watch
509510

510511
Publishing
511512
~~~~~~~~~~

0 commit comments

Comments
 (0)