Skip to content

Commit fe6f9eb

Browse files
authored
INTPYTHON-467 Switch from Makefile to Justfile (#52)
1 parent d01b7c3 commit fe6f9eb

File tree

10 files changed

+99
-158
lines changed

10 files changed

+99
-158
lines changed

.github/scripts/extract_ignored_words_list.py

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

.github/workflows/_codespell.yml

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

.github/workflows/_lint.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717

1818
jobs:
1919
build:
20-
name: "make lint #${{ matrix.python-version }}"
20+
name: "run lint #${{ matrix.python-version }}"
2121
runs-on: ubuntu-latest
2222
strategy:
2323
fail-fast: false
@@ -55,6 +55,8 @@ jobs:
5555
run: |
5656
poetry lock --check
5757
58+
- uses: extractions/setup-just@v2
59+
5860
- name: Install dependencies
5961
# Also installs dev/lint/test/typing dependencies, to ensure we have
6062
# type hints for as many of our libraries as possible.
@@ -66,7 +68,7 @@ jobs:
6668
# It doesn't matter how you change it, any change will cause a cache-bust.
6769
working-directory: ${{ inputs.working-directory }}
6870
run: |
69-
make install
71+
just install
7072
7173
- name: Get .mypy_cache to speed up mypy
7274
uses: actions/cache@v4
@@ -81,4 +83,4 @@ jobs:
8183
- name: Analysing the code with our lint
8284
working-directory: ${{ inputs.working-directory }}
8385
run: |
84-
make lint
86+
just lint

.github/workflows/_release.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,10 @@ jobs:
142142
143143
poetry run python -c "import $IMPORT_NAME; print(dir($IMPORT_NAME))"
144144
145+
- uses: extractions/setup-just@v2
146+
145147
- name: Import test dependencies
146-
run: make install
148+
run: just install
147149
working-directory: ${{ inputs.working-directory }}
148150

149151
# Overwrite the local version of the package with the test PyPI version.
@@ -162,7 +164,7 @@ jobs:
162164
uses: supercharge/[email protected]
163165

164166
- name: Run unit tests
165-
run: make tests
167+
run: just tests
166168
working-directory: ${{ inputs.working-directory }}
167169

168170
- name: Start local Atlas
@@ -181,7 +183,7 @@ jobs:
181183
ollama pull all-minilm:l6-v2
182184
183185
- name: Run integration tests
184-
run: make integration_tests
186+
run: just integration_tests
185187
working-directory: ${{ inputs.working-directory }}
186188

187189
- name: Get minimum versions
@@ -199,7 +201,7 @@ jobs:
199201
MIN_VERSIONS: ${{ steps.min-version.outputs.min-versions }}
200202
run: |
201203
poetry run pip install $MIN_VERSIONS
202-
make tests
204+
just tests
203205
working-directory: ${{ inputs.working-directory }}
204206

205207
publish:

.github/workflows/_test.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
python-version:
2424
- "3.9"
2525
- "3.12"
26-
name: "make test #${{ matrix.python-version }}"
26+
name: "run test #${{ matrix.python-version }}"
2727
steps:
2828
- uses: actions/checkout@v4
2929

@@ -35,17 +35,19 @@ jobs:
3535
working-directory: ${{ inputs.working-directory }}
3636
cache-key: core
3737

38+
- uses: extractions/setup-just@v2
39+
3840
- name: Install dependencies
3941
shell: bash
40-
run: make install
42+
run: just install
4143

4244
- name: Start MongoDB
4345
uses: supercharge/[email protected]
4446

4547
- name: Run core tests
4648
shell: bash
4749
run: |
48-
make test
50+
just test
4951
5052
- name: Start local Atlas
5153
working-directory: .
@@ -65,7 +67,7 @@ jobs:
6567
ollama pull all-minilm:l6-v2
6668
6769
- name: Run integration tests
68-
run: make integration_tests
70+
run: just integration_tests
6971
working-directory: ${{ inputs.working-directory }}
7072

7173
- name: Ensure the tests did not create any additional files

CONTRIBUTING.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ Install Poetry: **[documentation on how to install it](https://python-poetry.org
1515

1616
### Local Development Dependencies
1717

18-
The project configuration and the makefile for running dev commands are located under the `libs/langchain-mongodb` or `libs/langgraph-checkpoint-mongodb` directories.
18+
The project configuration and the `justfile` for running dev commands are located under the `libs/langchain-mongodb` or `libs/langgraph-checkpoint-mongodb` directories.
19+
20+
`just` can be [installed](https://just.systems/man/en/packages.html) from many package managers, including `brew`.
1921

2022
```bash
2123
cd libs/langchain-mongodb
@@ -24,13 +26,13 @@ cd libs/langchain-mongodb
2426
Install langchain-mongodb development requirements (for running langchain, running examples, linting, formatting, tests, and coverage):
2527

2628
```bash
27-
make install
29+
just install
2830
```
2931

3032
Then verify the installation.
3133

3234
```bash
33-
make test
35+
just test
3436
```
3537

3638
### Testing
@@ -41,7 +43,7 @@ If you add new logic, please add a unit test.
4143
To run unit tests:
4244

4345
```bash
44-
make test
46+
just test
4547
```
4648

4749
Integration tests cover the end-to-end service calls as much as possible.
@@ -53,7 +55,7 @@ this, please raise an issue.
5355
To run the integration tests:
5456

5557
```bash
56-
make integration_test
58+
just integration_test
5759
```
5860

5961
### Formatting and Linting
@@ -84,13 +86,13 @@ Linting and formatting for this project is done via a combination of [ruff](http
8486
To run lint:
8587

8688
```bash
87-
make lint
89+
just lint
8890
```
8991

9092
To run the type checker:
9193

9294
```bash
93-
make typing
95+
just typing
9496
```
9597

9698
We recognize linting can be annoying - if you do not want to do it, please contact a project maintainer, and they can help you with it. We do not want this to be a blocker for good code getting contributed.
@@ -103,7 +105,7 @@ Note that `codespell` finds common typos, so it could have false-positive (corre
103105
To check spelling for this project:
104106

105107
```bash
106-
make codespell
108+
just codespell
107109
```
108110

109111
If codespell is incorrectly flagging a word, you can skip spellcheck for that word by adding it to the codespell config in the `.pre-commit-config.yaml` file.

libs/langchain-mongodb/Makefile

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

libs/langchain-mongodb/justfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
set shell := ["bash", "-c"]
2+
set dotenv-load
3+
set dotenv-filename := "../../.local_atlas_uri"
4+
5+
# Default target executed when no arguments are given.
6+
[private]
7+
default:
8+
@just --list
9+
10+
install:
11+
poetry install --with dev
12+
13+
[group('test')]
14+
integration_tests:
15+
poetry run pytest tests/integration_tests/
16+
17+
[group('test')]
18+
test *args="tests/unit_tests":
19+
poetry run pytest {{args}}
20+
21+
[group('test')]
22+
test_watch filename:
23+
poetry run ptw --snapshot-update --now . -- -vv {{filename}}
24+
25+
[group('lint')]
26+
lint:
27+
git ls-files -- '*.py' | xargs poetry run pre-commit run ruff --files
28+
git ls-files -- '*.py' | xargs poetry run pre-commit run ruff-format --files
29+
30+
[group('lint')]
31+
typing:
32+
poetry run mypy .
33+
34+
[group('lint')]
35+
codespell:
36+
git ls-files -- '*.py' | xargs poetry run pre-commit run --hook-stage manual codespell --files

libs/langgraph-checkpoint-mongodb/Makefile

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
set shell := ["bash", "-c"]
2+
set dotenv-load
3+
set dotenv-filename := "../../.local_atlas_uri"
4+
5+
# Default target executed when no arguments are given.
6+
[private]
7+
default:
8+
@just --list
9+
10+
install:
11+
poetry install --with dev
12+
13+
[group('test')]
14+
integration_tests:
15+
poetry run pytest tests/integration_tests/
16+
17+
[group('test')]
18+
test *args="tests/unit_tests":
19+
poetry run pytest {{args}}
20+
21+
[group('test')]
22+
test_watch filename:
23+
poetry run ptw --snapshot-update --now . -- -vv {{filename}}
24+
25+
[group('lint')]
26+
lint:
27+
git ls-files -- '*.py' | xargs poetry run pre-commit run ruff --files
28+
git ls-files -- '*.py' | xargs poetry run pre-commit run ruff-format --files
29+
30+
[group('lint')]
31+
typing:
32+
poetry run mypy .
33+
34+
[group('lint')]
35+
codespell:
36+
git ls-files -- '*.py' | xargs poetry run pre-commit run --hook-stage manual codespell --files

0 commit comments

Comments
 (0)