Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,52 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: extractions/setup-just@v3
- uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Install Dependencies
run: make install
run: just install
- name: Lint
run: make lint
run: just lint
run-tests:
runs-on: ubuntu-latest
strategy:
matrix:
# vcrpy is not compatible with Python 3.14 yet so we cannot test against it
pythonversion: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: extractions/setup-just@v3
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.pythonversion }}
- name: Install Dependencies
run: make install
run: just install
- name: Run Tests
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make coverage
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just coverage
- name: Coveralls
if: github.ref == 'refs/heads/master'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: './coverage.lcov'
- name: Run security analysis
run: make scan
run: just scan
docs:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: extractions/setup-just@v3
- uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Install Dependencies
run: make install
run: just install
- name: Generate Docs
run: make docs
run: just docs
- name: Deploy Docs
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: extractions/setup-just@v3
- uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Build package
run: make install build
run: just install build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
71 changes: 0 additions & 71 deletions Makefile

This file was deleted.

18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ You can also unsubscribe your functions in a similar manner by using the `unsubs

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

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.
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.

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

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

```bash
# Install dependencies
make install
just install

# Lint project
make lint
make lint-fix
just lint
just lint-fix

# Run tests
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... make test
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... make coverage
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... just test
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... just coverage

# Run security analysis
make scan
just scan

# Generate library documentation
make docs
just docs

# Update submodules
make update-examples-submodule
just update-examples-submodule
```

### Testing
Expand Down
67 changes: 67 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
PYTHON_BINARY := "python3"
VIRTUAL_ENV := "venv"
VIRTUAL_BIN := VIRTUAL_ENV / "bin"
PROJECT_NAME := "easypost"
TEST_DIR := "tests"

# Build the project for release
build:
{{VIRTUAL_BIN}}/python -m build

# Clean the project
clean:
rm -rf {{VIRTUAL_ENV}} dist/ *.egg-info/ .*cache htmlcov *.lcov .coverage
find . -name '*.pyc' -delete

# Test with coverage and generate HTML report
coverage:
{{VIRTUAL_BIN}}/pytest --cov={{PROJECT_NAME}} --cov-branch --cov-report=html --cov-report=lcov --cov-report=term-missing --cov-fail-under=87

# Generate docs

docs:
{{VIRTUAL_BIN}}/pdoc {{PROJECT_NAME}} -o docs

# Initialize the examples submodule
init-examples-submodule:
git submodule init
git submodule update

# Install the project locally (dev mode)
install: init-examples-submodule
{{PYTHON_BINARY}} -m venv {{VIRTUAL_ENV}}
{{VIRTUAL_BIN}}/pip install -e ."[dev]"

# Update the examples submodule
update-examples-submodule:
git submodule init
git submodule update --remote

# Lint the project
lint:
{{VIRTUAL_BIN}}/ruff check {{PROJECT_NAME}}/ {{TEST_DIR}}/
{{VIRTUAL_BIN}}/ruff format --check {{PROJECT_NAME}}/ {{TEST_DIR}}/

# Fix lint issues
lint-fix:
{{VIRTUAL_BIN}}/ruff check --fix {{PROJECT_NAME}}/ {{TEST_DIR}}/
{{VIRTUAL_BIN}}/ruff format {{PROJECT_NAME}}/ {{TEST_DIR}}/

# Run mypy type checking
mypy:
{{VIRTUAL_BIN}}/mypy {{PROJECT_NAME}}/ {{TEST_DIR}}/ --install-types --non-interactive

# Cuts a release for the project on GitHub (requires GitHub CLI)
# tag = The associated tag title of the release
# target = Target branch or full commit SHA
release tag target:
gh release create {{tag}} dist/* --target {{target}}

# Scan for security issues with Bandit
scan:
{{VIRTUAL_BIN}}/bandit -r {{PROJECT_NAME}}

# Run tests

test:
{{VIRTUAL_BIN}}/pytest