Skip to content

Commit f1e2b97

Browse files
authored
chore: swap makefile for justfile (#380)
# Description <!-- Please provide a general summary of your PR changes and link any related issues or other pull requests. --> # Testing <!-- Please provide details on how you tested this code. See below. - All pull requests must be tested (unit tests where possible with accompanying cassettes, or provide a screenshot of end-to-end testing when unit tests are not possible) - New features must get a new unit test - Bug fixes/refactors must re-record existing cassettes --> # Pull Request Type Please select the option(s) that are relevant to this PR. - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Improvement (fixing a typo, updating readme, renaming a variable name, etc)
1 parent 573b55e commit f1e2b97

File tree

5 files changed

+92
-92
lines changed

5 files changed

+92
-92
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,49 +10,52 @@ jobs:
1010
lint:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v5
13+
- uses: actions/checkout@v6
14+
- uses: extractions/setup-just@v3
1415
- uses: actions/setup-python@v6
1516
with:
1617
python-version: '3.14'
1718
- name: Install Dependencies
18-
run: make install
19+
run: just install
1920
- name: Lint
20-
run: make lint
21+
run: just lint
2122
run-tests:
2223
runs-on: ubuntu-latest
2324
strategy:
2425
matrix:
2526
# vcrpy is not compatible with Python 3.14 yet so we cannot test against it
2627
pythonversion: ['3.9', '3.10', '3.11', '3.12', '3.13']
2728
steps:
28-
- uses: actions/checkout@v5
29+
- uses: actions/checkout@v6
30+
- uses: extractions/setup-just@v3
2931
- uses: actions/setup-python@v6
3032
with:
3133
python-version: ${{ matrix.pythonversion }}
3234
- name: Install Dependencies
33-
run: make install
35+
run: just install
3436
- name: Run Tests
35-
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make coverage
37+
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just coverage
3638
- name: Coveralls
3739
if: github.ref == 'refs/heads/master'
3840
uses: coverallsapp/github-action@master
3941
with:
4042
github-token: ${{ secrets.GITHUB_TOKEN }}
4143
path-to-lcov: './coverage.lcov'
4244
- name: Run security analysis
43-
run: make scan
45+
run: just scan
4446
docs:
4547
if: github.ref == 'refs/heads/master'
4648
runs-on: ubuntu-latest
4749
steps:
48-
- uses: actions/checkout@v5
50+
- uses: actions/checkout@v6
51+
- uses: extractions/setup-just@v3
4952
- uses: actions/setup-python@v6
5053
with:
5154
python-version: '3.14'
5255
- name: Install Dependencies
53-
run: make install
56+
run: just install
5457
- name: Generate Docs
55-
run: make docs
58+
run: just docs
5659
- name: Deploy Docs
5760
uses: peaceiris/actions-gh-pages@v3
5861
with:

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ jobs:
99
release:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v5
12+
- uses: actions/checkout@v6
13+
- uses: extractions/setup-just@v3
1314
- uses: actions/setup-python@v6
1415
with:
1516
python-version: '3.14'
1617
- name: Build package
17-
run: make install build
18+
run: just install build
1819
- name: Publish to PyPI
1920
uses: pypa/gh-action-pypi-publish@release/v1
2021
with:

Makefile

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

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ You can also unsubscribe your functions in a similar manner by using the `unsubs
8484

8585
API documentation can be found at: <https://docs.easypost.com>.
8686

87-
Library documentation can be found on the web at: <https://easypost.github.io/easypost-python/> or by building them locally via the `make docs` command.
87+
Library documentation can be found on the web at: <https://easypost.github.io/easypost-python/> or by building them locally via the `just docs` command.
8888

8989
Upgrading major versions of this project? Refer to the [Upgrade Guide](UPGRADE_GUIDE.md).
9090

@@ -98,24 +98,24 @@ For additional support, see our [org-wide support policy](https://github.com/Eas
9898

9999
```bash
100100
# Install dependencies
101-
make install
101+
just install
102102

103103
# Lint project
104-
make lint
105-
make lint-fix
104+
just lint
105+
just lint-fix
106106

107107
# Run tests
108-
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... make test
109-
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... make coverage
108+
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... just test
109+
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... just coverage
110110

111111
# Run security analysis
112-
make scan
112+
just scan
113113

114114
# Generate library documentation
115-
make docs
115+
just docs
116116

117117
# Update submodules
118-
make update-examples-submodule
118+
just update-examples-submodule
119119
```
120120

121121
### Testing

justfile

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
PYTHON_BINARY := "python3"
2+
VIRTUAL_ENV := "venv"
3+
VIRTUAL_BIN := VIRTUAL_ENV / "bin"
4+
PROJECT_NAME := "easypost"
5+
TEST_DIR := "tests"
6+
7+
# Build the project for release
8+
build:
9+
{{VIRTUAL_BIN}}/python -m build
10+
11+
# Clean the project
12+
clean:
13+
rm -rf {{VIRTUAL_ENV}} dist/ *.egg-info/ .*cache htmlcov *.lcov .coverage
14+
find . -name '*.pyc' -delete
15+
16+
# Test with coverage and generate HTML report
17+
coverage:
18+
{{VIRTUAL_BIN}}/pytest --cov={{PROJECT_NAME}} --cov-branch --cov-report=html --cov-report=lcov --cov-report=term-missing --cov-fail-under=87
19+
20+
# Generate docs
21+
22+
docs:
23+
{{VIRTUAL_BIN}}/pdoc {{PROJECT_NAME}} -o docs
24+
25+
# Initialize the examples submodule
26+
init-examples-submodule:
27+
git submodule init
28+
git submodule update
29+
30+
# Install the project locally (dev mode)
31+
install: init-examples-submodule
32+
{{PYTHON_BINARY}} -m venv {{VIRTUAL_ENV}}
33+
{{VIRTUAL_BIN}}/pip install -e ."[dev]"
34+
35+
# Update the examples submodule
36+
update-examples-submodule:
37+
git submodule init
38+
git submodule update --remote
39+
40+
# Lint the project
41+
lint:
42+
{{VIRTUAL_BIN}}/ruff check {{PROJECT_NAME}}/ {{TEST_DIR}}/
43+
{{VIRTUAL_BIN}}/ruff format --check {{PROJECT_NAME}}/ {{TEST_DIR}}/
44+
45+
# Fix lint issues
46+
lint-fix:
47+
{{VIRTUAL_BIN}}/ruff check --fix {{PROJECT_NAME}}/ {{TEST_DIR}}/
48+
{{VIRTUAL_BIN}}/ruff format {{PROJECT_NAME}}/ {{TEST_DIR}}/
49+
50+
# Run mypy type checking
51+
mypy:
52+
{{VIRTUAL_BIN}}/mypy {{PROJECT_NAME}}/ {{TEST_DIR}}/ --install-types --non-interactive
53+
54+
# Cuts a release for the project on GitHub (requires GitHub CLI)
55+
# tag = The associated tag title of the release
56+
# target = Target branch or full commit SHA
57+
release tag target:
58+
gh release create {{tag}} dist/* --target {{target}}
59+
60+
# Scan for security issues with Bandit
61+
scan:
62+
{{VIRTUAL_BIN}}/bandit -r {{PROJECT_NAME}}
63+
64+
# Run tests
65+
66+
test:
67+
{{VIRTUAL_BIN}}/pytest

0 commit comments

Comments
 (0)