-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1439 from stripe/latest-codegen-beta
Update generated code for beta
- Loading branch information
Showing
47 changed files
with
1,139 additions
and
216 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,41 +19,47 @@ on: | |
|
||
jobs: | ||
lint: | ||
name: Lint & Mypy | ||
runs-on: ubuntu-latest | ||
name: Static Checks | ||
runs-on: "ubuntu-24.04" | ||
steps: | ||
- uses: extractions/setup-just@v2 | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: mypy | ||
run: make mypy | ||
- name: lint | ||
run: make lint | ||
- name: fmtcheck | ||
run: make fmtcheck | ||
- name: check examples w/ mypy (against [email protected]) | ||
run: just typecheck-examples | ||
# skip deps on all these since mypy installed everything | ||
- name: check linting | ||
run: just --no-deps lint | ||
- name: check formatting | ||
run: just --no-deps format-check | ||
# pyright depends on node, which it handles and installs for itself as needed | ||
# we _could_ run setup-node to make it available for it if we're having reliability problems | ||
- name: check types (all Python versions) | ||
run: | | ||
set -eox | ||
for minor in {6..12}; do | ||
just --no-deps typecheck $minor | ||
done | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
runs-on: "ubuntu-24.04" | ||
steps: | ||
- uses: extractions/setup-just@v2 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install tools | ||
run: make venv | ||
|
||
- name: Build and check package | ||
run: | | ||
set -x | ||
source venv/bin/activate | ||
python setup.py clean --all sdist bdist_wheel --universal | ||
python -m twine check dist/* | ||
just build | ||
- name: "Upload Artifact" | ||
uses: actions/upload-artifact@v3 | ||
|
@@ -69,45 +75,30 @@ 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_version }}) | ||
steps: | ||
- uses: extractions/setup-just@v2 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python.version }} and 3.10 | ||
- name: Set up Python ${{ matrix.python_version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: | | ||
${{ matrix.python.version }} | ||
3.10 | ||
python-version: ${{ matrix.python_version }} | ||
- uses: stripe/openapi/actions/stripe-mock@master | ||
|
||
- name: Typecheck with pyright | ||
run: PYRIGHT_ARGS="-- --pythonversion ${{ matrix.python.version }}" make pyright | ||
# Skip typecheking in pypy legs | ||
if: ${{ !contains(matrix.python.version, 'pypy') }} | ||
|
||
- name: Test with pytest | ||
run: TOX_ARGS="-e ${{ matrix.python.env }}" make ci-test | ||
|
||
- name: Calculate and publish coverage | ||
run: make coveralls | ||
if: env.COVERALLS_REPO_TOKEN && matrix.python.version == '3.10' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
- name: "run tests" | ||
run: just test | ||
|
||
publish: | ||
name: Publish | ||
|
@@ -116,7 +107,7 @@ jobs: | |
startsWith(github.ref, 'refs/tags/v') && | ||
endsWith(github.actor, '-stripe') | ||
needs: [build, test, lint] | ||
runs-on: ubuntu-latest | ||
runs-on: "ubuntu-24.04" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Download all workflow run artifacts | ||
|
@@ -137,11 +128,12 @@ jobs: | |
GPG_SIGNING_PRIVKEY: ${{ secrets.GPG_SIGNING_PRIVKEY }} | ||
GPG_SIGNING_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSPHRASE }} | ||
- name: Install tools | ||
run: make venv | ||
- name: Publish packages to PyPy | ||
run: just install-build-deps | ||
- name: Publish packages to PyPI | ||
# 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 | ||
|
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,25 @@ | ||
|
||
# Contributing | ||
|
||
We welcome bug reports, feature requests, and code contributions in a pull request. | ||
|
||
For most pull requests, we request that you identify or create an associated issue that has the necessary context. We use these issues to reach agreement on an approach and save the PR author from having to redo work. Fixing typos or documentation issues likely do not need an issue; for any issue that introduces substantial code changes, changes the public interface, or if you aren't sure, please find or [create an issue](https://www.github.com/stripe/stripe-python/issues/new/choose). | ||
|
||
## Contributor License Agreement | ||
|
||
All contributors must sign the Contributor License Agreement (CLA) before we can accept their contribution. If you have not yet signed the agreement, you will be given an option to do so when you open a pull request. You can then sign by clicking on the badge in the comment from @CLAassistant. | ||
|
||
## Generated code | ||
|
||
This project has a combination of manually maintained code and code generated from our private code generator. If your contribution involves changes to generated code, please call this out in the issue or pull request as we will likely need to make a change to our code generator before accepting the contribution. | ||
|
||
To identify files with purely generated code, look for the comment `File generated from our OpenAPI spec.` at the start of the file. Generated blocks of code within hand-written files will be between comments that say `The beginning of the section generated from our OpenAPI spec` and `The end of the section generated from our OpenAPI spec`. | ||
|
||
## Compatibility with supported language and runtime versions | ||
|
||
This project supports [many different langauge and runtime versions](README.md#requirements) and we are unable to accept any contribution that does not work on _all_ supported versions. If, after discussing the approach in the associated issue, your change must use an API / feature that isn't available in all supported versions, please call this out explicitly in the issue or pull request so we can help figure out the best way forward. | ||
|
||
## Set up your dev environment | ||
|
||
Please refer to this project's [README.md](README.md#development) for instructions on how to set up your development environment. | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v1436 | ||
v1454 |
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
Oops, something went wrong.