From 36af32578bdcdef93836e88d073d3a36d34af05f Mon Sep 17 00:00:00 2001 From: Olivier Bellone Date: Wed, 19 Jan 2022 11:11:23 -0800 Subject: [PATCH] Start testing Python 3.10 --- .github/workflows/python-package.yml | 96 +++++++++++++++------------- setup.py | 1 + tox.ini | 2 +- 3 files changed, 55 insertions(+), 44 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 8451b37db..a414cd838 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -2,67 +2,77 @@ name: Python package on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 2 - uses: actions/setup-python@v2 - with: - python-version: 2.7 - - name: lint - run: make lint - + - uses: actions/checkout@v2 + - name: Set up Python 2 + uses: actions/setup-python@v2 + with: + python-version: "2.7" + - name: lint + run: make lint fmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 3 - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: fmtcheck - run: make fmtcheck + - uses: actions/checkout@v2 + - name: Set up Python 3 + uses: actions/setup-python@v2 + with: + python-version: "3.10" + - name: fmtcheck + run: make fmtcheck build: runs-on: ubuntu-latest strategy: matrix: - python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, pypy-2.7, pypy-3.7] + python-version: + [ + "2.7", + "3.5", + "3.6", + "3.7", + "3.8", + "3.9", + "3.10", + "pypy-2.7", + "pypy-3.7", + ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - 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- + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - 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- - # Might be sensible to cache the docker image but this seems to be - # not fully supported by github actions yet, as of Feb 2021 - # https://github.com/actions/cache/issues/81 - - name: Start stripe-mock - run: docker run -d -p 12111-12112:12111-12112 stripe/stripe-mock && sleep 5 + # Might be sensible to cache the docker image but this seems to be + # not fully supported by github actions yet, as of Feb 2021 + # https://github.com/actions/cache/issues/81 + - name: Start stripe-mock + run: docker run -d -p 12111-12112:12111-12112 stripe/stripe-mock && sleep 5 - - name: Test with pytest - run: make test + - name: Test with pytest + run: make test diff --git a/setup.py b/setup.py index e74cd01ff..207479a54 100644 --- a/setup.py +++ b/setup.py @@ -55,6 +55,7 @@ "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules", ], diff --git a/tox.ini b/tox.ini index e6a1bdd6c..e80424713 100644 --- a/tox.ini +++ b/tox.ini @@ -36,7 +36,7 @@ passenv = LDFLAGS CFLAGS [testenv:fmt] description = run code formatting using black -basepython = python3.9 +basepython = python3.10 deps = black==21.10b0 commands = black . {posargs} skip_install = true