From 86bd268c2d6b6c4d75562a98194a9335ceae04db Mon Sep 17 00:00:00 2001 From: Almar Klein Date: Mon, 10 Jan 2022 23:53:10 +0100 Subject: [PATCH] Support for python 3.10 (#112) * refactor ci and include build for py310 * mention support for py3.10 --- .github/workflows/ci.yml | 60 +++++++++++++++++++--------------------- Dockerfile | 2 +- setup.py | 1 + 3 files changed, 30 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff802fdf..da5d1e94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,61 +8,64 @@ on: jobs: - build: + + lint: + name: linting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install dependencies + shell: bash + run: | + python -m pip install --upgrade pip + pip install black flake8 invoke + - name: Lint + shell: bash + run: | + invoke checkformat + invoke lint + + tests: name: ${{ matrix.name }} runs-on: ${{ matrix.os }} strategy: matrix: include: - - name: Lint - os: ubuntu-latest - pyversion: '3.7' - dolint: 1 - name: Linux py36 os: ubuntu-latest pyversion: '3.6' - tests: 1 - name: Linux py37 os: ubuntu-latest pyversion: '3.7' - tests: 1 - name: Linux py38 os: ubuntu-latest pyversion: '3.8' - tests: 1 - name: Linux py39 os: ubuntu-latest pyversion: '3.9' - tests: 1 + - name: Linux py310 + os: ubuntu-latest + pyversion: '3.10' - name: Linux pypy3 os: ubuntu-latest pyversion: 'pypy3' - tests: 1 - - name: Windows py38 + - name: Windows py39 os: windows-latest pyversion: '3.8' - tests: 1 - - name: MacOS py38 + - name: MacOS py39 os: macos-latest pyversion: '3.8' - tests: 1 - steps: - - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.pyversion }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.pyversion }} - - - name: Install dependencies (lint and docs) - if: matrix.dolint == 1 - shell: bash - run: | - python -m pip install --upgrade pip - pip install black flake8 invoke - - name: Install dependencies (unit tests) - if: matrix.tests == 1 + - name: Install dependencies shell: bash run: | python -m pip install --upgrade pip @@ -70,14 +73,7 @@ jobs: pip install pytest requests python setup.py install rm -rf ./timetagger ./build ./egg-info - - name: Lint - if: matrix.dolint == 1 - shell: bash - run: | - invoke checkformat - invoke lint - name: Test with pytest - if: matrix.tests == 1 shell: bash run: | python -c "import sys; print(sys.version, '\n', sys.prefix)"; diff --git a/Dockerfile b/Dockerfile index 81b81298..1ae3cec2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ # mypaas.maxmem = 256m -FROM python:3.8-slim-buster +FROM python:3.10-slim-buster # Install dependencies (including optional ones that make uvicorn faster) RUN pip --no-cache-dir install pip --upgrade && pip --no-cache-dir install \ diff --git a/setup.py b/setup.py index 3cc6b518..7244351a 100644 --- a/setup.py +++ b/setup.py @@ -55,5 +55,6 @@ "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", ], )