From 8ee0b9b50059158328d8cac6164a6a80850590ec Mon Sep 17 00:00:00 2001 From: Anton <44246099+antonblr@users.noreply.github.com> Date: Wed, 26 Apr 2023 19:44:40 +0000 Subject: [PATCH 1/2] ci: Fix gh action warnings (#962) --- .github/workflows/ci.yml | 35 ++++++++++++----------------------- Makefile | 2 +- tox.ini | 3 --- 3 files changed, 13 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e8c82d1d..a340ec11c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,9 +22,9 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python 3 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: "3.10" - name: lint @@ -36,10 +36,10 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python 3 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: "3.10" @@ -54,7 +54,7 @@ jobs: python -m twine check dist/* - name: 'Upload Artifact' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: dist path: dist/ @@ -81,29 +81,18 @@ jobs: ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + cache: "pip" + cache-dependency-path: "setup.py" - name: Upgrade pip and virtualenv to latest run: pip install --upgrade pip virtualenv - - name: Get pip cache dir - id: pip-cache - run: | - python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)" - - - name: pip cache - uses: actions/cache@v2 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - uses: stripe/openapi/actions/stripe-mock@master - name: Test with pytest @@ -125,14 +114,14 @@ jobs: needs: [build, test, lint] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Download all workflow run artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: dist path: dist - name: Set up Python 3 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: "3.10" diff --git a/Makefile b/Makefile index 5efca3bf3..c47149903 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ test-nomock: venv ci-test: venv ${VENV_NAME}/bin/python -m pip install -U tox-gh-actions - @${VENV_NAME}/bin/tox -p auto $(TOX_ARGS) + @${VENV_NAME}/bin/tox $(TOX_ARGS) coveralls: venv ${VENV_NAME}/bin/python -m pip install -U coveralls diff --git a/tox.ini b/tox.ini index a8ad1cef9..90c3f9893 100644 --- a/tox.ini +++ b/tox.ini @@ -73,10 +73,7 @@ passenv = GITHUB_* deps = coverage >= 4.5.3, < 5 # TODO: upgrade to coverage 5 when we drop support for Python 3.4 coveralls - pytest - pytest-mock commands = - coverage run --source=stripe -m pytest tests/ coverage combine coveralls --service=github depends = py{310,39,38,37,36,35,34,27,py3,py2} From 4d6011efcdd43a6420ae0e1dbaa2c3d103aec471 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 27 Apr 2023 15:44:17 +0000 Subject: [PATCH 2/2] Update generated code for v309 (#963) Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- tests/test_generated_examples.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 22402537f..8d9af222c 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v296 \ No newline at end of file +v309 \ No newline at end of file diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 2c0cc5413..4fe5ce206 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -1434,6 +1434,15 @@ def test_plan_create(self, request_mock): ) request_mock.assert_requested("post", "/v1/plans") + def test_plan_create2(self, request_mock): + stripe.Plan.create( + amount=2000, + currency="usd", + interval="month", + product={"name": "My product"}, + ) + request_mock.assert_requested("post", "/v1/plans") + def test_plan_delete(self, request_mock): stripe.Plan.delete("price_xxxxxxxxxxxxx") request_mock.assert_requested(