-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add justfile, update readme, remove coveralls (#1440)
* remove virtualenv * unremove virtualenv version * messy justfile, but maybe CI works? * remove quote * actually run tests with correct versions * fix comment * better logging, less mypy * skip tox, different pyright approach on older versions * break out test jobs * fix justfile * another CI run * install this package * remvove tox, makefile, update CI a bunch * fix mypy * fix pyright dep * final pass
- Loading branch information
1 parent
39ce6f4
commit bd73a32
Showing
11 changed files
with
172 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
include .coveragerc .flake8 CHANGELOG.md LICENSE LONG_DESCRIPTION.rst README.md VERSION pytest.ini tox.ini | ||
# this file specifies what's included in a source distribution (https://packaging.python.org/en/latest/glossary/#term-Source-Distribution-or-sdist) | ||
# see also: https://setuptools.pypa.io/en/latest/userguide/miscellaneous.html | ||
include .flake8 CHANGELOG.md LICENSE LONG_DESCRIPTION.rst README.md VERSION pytest.ini justfile | ||
recursive-include tests *.py | ||
recursive-include examples *.txt *.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# packages needed to package & release | ||
|
||
twine | ||
setuptools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# packages needed to run static analysis (lints, types, etc) | ||
# version requirements: any modern python version (currently 3.10) | ||
|
||
# typechecking for all versions | ||
pyright == 1.1.336 | ||
# general typechecking | ||
mypy == 1.7.0 | ||
# formatting | ||
ruff == 0.4.4 | ||
# linting | ||
flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
set quiet | ||
|
||
import? '../sdk-codegen/justfile' | ||
|
||
VENV_NAME := ".venv" | ||
|
||
export PATH := `pwd` / VENV_NAME / "bin:" + env('PATH') | ||
|
||
_default: | ||
just --list --unsorted | ||
|
||
# ⭐ run all unit tests | ||
test *args: install-test-deps | ||
# configured in pyproject.toml | ||
pytest {{ args }} | ||
|
||
# ⭐ check for potential mistakes | ||
lint: install-dev-deps | ||
python -m flake8 --show-source stripe tests setup.py | ||
|
||
# verify types. optional argument to test as of a specific minor python version (e.g. `8` to test `python 3.8`); otherwise uses current version | ||
typecheck minor_py_version="": install-test-deps install-dev-deps | ||
# suppress version update warnings | ||
PYRIGHT_PYTHON_IGNORE_WARNINGS=1 pyright {{ if minor_py_version == "" { "" } else { "--pythonversion 3." + minor_py_version } }} | ||
|
||
# ⭐ format all code | ||
format: install-dev-deps | ||
ruff format . --quiet | ||
|
||
# verify formatting, but don't modify files | ||
format-check: install-dev-deps | ||
ruff format . --check --quiet | ||
|
||
# remove venv | ||
clean: | ||
# clear old files too | ||
rm -rf {{ VENV_NAME }} venv .tox | ||
|
||
# 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 | ||
# given that we don't care about universal 2 and 3 packages, we probably don't need it? | ||
python -I setup.py clean --all sdist bdist_wheel --universal | ||
python -m twine check dist/* | ||
|
||
# typecheck some examples w/ mypy | ||
typecheck-examples: _install-all | ||
# configured in pyproject.toml | ||
mypy | ||
|
||
# install the tools for local development & static checks | ||
install-dev-deps: (install "dev") | ||
|
||
# install everything for unit tests | ||
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 {""} }} | ||
|
||
# create a virtualenv if it doesn't exist; always installs the local package | ||
[private] | ||
venv: | ||
[ -d {{ VENV_NAME }} ] || ( \ | ||
python -m venv {{ VENV_NAME }} && \ | ||
{{ VENV_NAME }}/bin/python -I -m pip install -e . --quiet --disable-pip-version-check \ | ||
) | ||
|
||
# called by tooling | ||
[private] | ||
update-version version: | ||
@echo "{{ version }}" > VERSION | ||
@perl -pi -e 's|VERSION = "[.\d\w]+"|VERSION = "{{ version }}"|' stripe/_version.py |
Oops, something went wrong.