Skip to content

Commit

Permalink
feat(compat): drop support for python 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKevJames committed Apr 26, 2024
1 parent 03cdc30 commit 6570afa
Show file tree
Hide file tree
Showing 15 changed files with 189 additions and 160 deletions.
178 changes: 93 additions & 85 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,117 +1,125 @@
version: 2.1

orbs:
linter: talkiq/linter@3.1.0
linter: talkiq/linter@4

executors:
python-minimum:
py36:
docker:
# N.B. lowest common denominator, don't want to error on not using the
# latest syntax.
- image: python:3.10.7
- image: python:3.6-alpine
resource_class: small
py37:
docker:
- image: python:3.7-alpine
resource_class: small
py38:
docker:
- image: python:3.8-alpine
resource_class: small
py39:
docker:
- image: python:3.9-alpine
resource_class: small
py310:
docker:
- image: python:3.10-alpine
resource_class: small
pypy731: # py36
docker:
- image: pypy:3-7.3.1-slim
resource_class: small
pypy735: # py37
docker:
- image: pypy:3-7.3.5-slim
resource_class: small
pypy737: # py37+py38
docker:
- image: pypy:3-7.3.7-slim
resource_class: small
pypy7311: # py38+py39
docker:
- image: pypy:3-7.3.11-slim
resource_class: small
pypy73: # py39+py310
docker:
- image: pypy:3-7.3-slim
resource_class: small

jobs:
toxpylegacy:
executor: <<parameters.executor>>
parameters:
executor:
type: executor
steps:
- run: apk add --no-cache git
- checkout
- run: pip install --upgrade tox tox-factor
- run: tox run -f "${CIRCLE_JOB//test-}"
- run: tox run -e upload

toxpy:
docker:
- image: python:<<parameters.docker_image>>-alpine
executor: <<parameters.executor>>
parameters:
executor:
type: executor
steps:
- run: apk add --no-cache git
- checkout
- run: pip install --upgrade tox
- run: tox run -f "${CIRCLE_JOB//test-}"
- run: tox run -e upload

toxpypylegacy:
executor: <<parameters.executor>>
parameters:
cov_version:
default: ""
type: string
docker_image:
type: string
# TODO: figure out `<<parameters.docker_image>>.replace('.','')`
tox_environment:
type: string
executor:
type: executor
steps:
- run: apk add --no-cache gcc git libffi-dev musl-dev openssh-client openssl-dev
- run: apt-get update -qy
- run: apt-get install -qy --no-install-recommends git
- checkout
- run: pip install tox tox-factor
- unless:
condition: <<parameters.cov_version>>
steps:
- run: tox -f <<parameters.tox_environment>>
- run: tox -e coveralls41
- when:
condition: <<parameters.cov_version>>
steps:
- run: tox -f <<parameters.tox_environment>>-cov<<parameters.cov_version>>
- run: tox -e coveralls<<parameters.cov_version>>
- run: pip install --upgrade tox tox-factor
- run: tox run -f pypy3
- run: tox run -e upload

toxpypy:
docker:
- image: pypy:<<parameters.docker_image>>
executor: <<parameters.executor>>
parameters:
cov_version:
type: string
docker_image:
type: string
executor:
type: executor
steps:
- run: apt-get update -qy
- run: apt-get install -qy --no-install-recommends git
- checkout
- run: pip install tox tox-factor
- run: tox -f pypy3-cov<<parameters.cov_version>>
- run: tox -e coveralls<<parameters.cov_version>>
- run: pip install --upgrade tox
- run: tox run -f pypy3
- run: tox run -e upload

workflows:
lint:
test:
jobs:
- linter/pre-commit:
executor: python-minimum

test-cpython:
jobs:
- toxpy:
name: test-py3.5
docker_image: '3.5'
tox_environment: py35
- toxpy:
name: test-py3.6-cov<<matrix.cov_version>>
docker_image: '3.6'
tox_environment: py36
matrix:
parameters:
cov_version: ['41', '5', '6']
- toxpy:
name: test-py3.7-cov<<matrix.cov_version>>
docker_image: '3.7'
tox_environment: py37
matrix:
parameters:
cov_version: ['41', '5', '6']
- toxpy:
name: test-py3.8-cov<<matrix.cov_version>>
docker_image: '3.8'
tox_environment: py38
executor: py37
pre-steps:
- run: apk add --no-cache git
- toxpylegacy:
name: test-<<matrix.executor>>
matrix:
parameters:
cov_version: ['41', '5', '6']
executor: [py36]
- toxpy:
name: test-py3.9-cov<<matrix.cov_version>>
docker_image: '3.9'
tox_environment: py39
name: test-<<matrix.executor>>
matrix:
parameters:
cov_version: ['41', '5', '6']
- toxpy:
name: test-py3.10-cov<<matrix.cov_version>>
docker_image: '3.10'
tox_environment: py310
matrix:
parameters:
cov_version: ['41', '5', '6']

test-pypy:
jobs:
- toxpypy:
name: test-pypy<<matrix.docker_image>>-cov<<matrix.cov_version>>
executor: [py37, py38, py39, py310]
- toxpypylegacy:
name: test-<<matrix.executor>>
matrix:
parameters:
cov_version: ['41', '5']
docker_image: ['3-5', '3-6']
executor: [pypy731]
- toxpypy:
name: test-pypy3-7-cov<<matrix.cov_version>>
docker_image: '3-7'
name: test-<<matrix.executor>>
matrix:
parameters:
cov_version: ['41', '5', '6']
executor: [pypy735, pypy737, pypy7311, pypy73]
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build

on:
push:
branches:
tags:

jobs:
build:
name: Build sdist and wheels
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: python3 -m pip install wheel
- run: python3 setup.py sdist bdist_wheel
- uses: actions/upload-artifact@v4
with:
path: ./dist/*.tar.gz

publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
if: github.event_name == 'push' && github.ref_type == 'tag'
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- run: ls -la ./dist
# TODO: enable me
# - name: Publish package distributions to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
26 changes: 0 additions & 26 deletions .github/workflows/pythonpackage.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# TODO: 3.6 not supported on latest
python-version: ['3.7', '3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: python -m pip install --upgrade pip tox tox-gh-actions
- run: tox
- run: tox -e upload
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 5 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ ci:
autofix_commit_msg: 'refactor(lint): apply automatic lint fixes'
autoupdate_commit_msg: 'chore(deps): bump pre-commit linter versions'

default_language_version:
python: python3.7

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
Expand Down Expand Up @@ -58,7 +61,6 @@ repos:
- -d too-few-public-methods
- -d ungrouped-imports # conflicts with reorder-python-imports
- -d wrong-import-order # conflicts with reorder-python-imports
- -d consider-using-f-string # not py35 compatible
- -d unspecified-encoding # TODO: reevaluate
- -d disallowed-name # TODO: fix
exclude: example/.*
Expand All @@ -70,13 +72,13 @@ repos:
rev: v3.9.0
hooks:
- id: reorder-python-imports
args: [--py3-plus]
args: [--py36-plus]
exclude: nonunicode/.*
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.2
hooks:
- id: pyupgrade
args: [--py3-plus]
args: [--py36-plus]
exclude: nonunicode/.*
- repo: https://github.com/asottile/yesqa
rev: v1.4.0
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ sudo: false

language: python
python:
- 3.5
- 3.6
- 3.7
- 3.8
Expand Down
Loading

0 comments on commit 6570afa

Please sign in to comment.