Skip to content

Commit

Permalink
fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
xavdid-stripe committed Jan 14, 2025
1 parent 9adb712 commit 61dceb6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 24 deletions.
40 changes: 19 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: install tools
run: just install-dev-deps
# skip deps on all these since we just installed everything
- name: check types (mypy, [email protected])
run: just --no-deps mypy
run: just typecheck-mypy
# skip deps on all these since mypy installed everything
- name: check linting
run: just --no-deps lint
- name: check formatting
Expand Down Expand Up @@ -77,29 +75,29 @@ jobs:
strategy:
fail-fast: false
matrix:
python:
- { version: "3.6", env: "py36" }
- { version: "3.7", env: "py37" }
- { version: "3.8", env: "py38" }
- { version: "3.9", env: "py39" }
- { version: "3.10", env: "py310" }
- { version: "3.11", env: "py311" }
- { version: "3.12", env: "py312" }
- { version: "pypy-3.7", env: "py3.7" }
- { version: "pypy-3.8", env: "py3.8" }
- { version: "pypy-3.9", env: "py3.9" }
- { version: "pypy-3.10", env: "py3.10" }
name: Test (${{ matrix.python.version }})
python_version:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "pypy-3.7"
- "pypy-3.8"
- "pypy-3.9"
- "pypy-3.10"
name: Test (${{ matrix.python.python_version }})
steps:
- uses: extractions/setup-just@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python.version }}
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python.version }}
python-version: ${{ matrix.python_version }}
- uses: stripe/openapi/actions/stripe-mock@master

- name: "Install test deps"
- name: "run tests"
run: just test

publish:
Expand Down Expand Up @@ -135,7 +133,7 @@ jobs:
# could probably move this into a just recipe too?
run: |
set -ex
source venv/bin/activate
source .venv/bin/activate
export VERSION=$(cat VERSION)
gpg --detach-sign --local-user $GPG_SIGNING_KEYID --pinentry-mode loopback --passphrase $GPG_SIGNING_PASSPHRASE -a dist/stripe-$VERSION.tar.gz
gpg --detach-sign --local-user $GPG_SIGNING_KEYID --pinentry-mode loopback --passphrase $GPG_SIGNING_PASSPHRASE -a dist/stripe-$VERSION-py2.py3-none-any.whl
Expand Down
15 changes: 12 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ set quiet

import? '../sdk-codegen/justfile'

VENV_NAME := "venv"
VENV_NAME := ".venv"

export PATH := `pwd` / VENV_NAME / "bin:" + env('PATH')

Expand Down Expand Up @@ -31,6 +31,13 @@ format: install-dev-deps
format-check: install-dev-deps
ruff format . --check --quiet

# remove venv
clean:
rm -rf {{ VENV_NAME }}

# blow away and reinstall virtual env
reset: clean && venv

# build the package for upload
build: install-build-deps
# --universal is deprecated, so we'll probably need to look at this eventually
Expand All @@ -39,10 +46,10 @@ build: install-build-deps
python -m twine check dist/*

# run backup type checker
mypy: install-dev-deps
typecheck-mypy: _install-all
mypy

# install the tools for CI & static checks
# install the tools for local development & static checks
install-dev-deps: (install "dev")

# install everything for unit tests
Expand All @@ -51,6 +58,8 @@ install-test-deps: (install "test")
# install dependencies to build the package
install-build-deps: (install "build")

_install-all: install-dev-deps install-test-deps install-build-deps

# installs files out of a {group}-requirements.txt into the local venv; mostly used by other recipes
install group: venv
python -I -m pip install -r deps/{{ group }}-requirements.txt --disable-pip-version-check {{ if is_dependency() == "true" {"--quiet"} else {""} }}
Expand Down

0 comments on commit 61dceb6

Please sign in to comment.