Skip to content

Commit

Permalink
feat: Bump Python dev version to 3.12.2 (and drop Python 3.7) (#195)
Browse files Browse the repository at this point in the history
As well as bump project deps to their latest versions, as well as sync
common project files and fix some new flake8 warnings.

And yeah, drop support for Python 3.7, bye bye, old buddy!
  • Loading branch information
playpauseandstop authored Feb 11, 2024
1 parent 1701fae commit 7afb207
Show file tree
Hide file tree
Showing 15 changed files with 594 additions and 662 deletions.
6 changes: 6 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
[flake8]
ban-relative-imports = true
classmethod-decorators =
classmethod
validator
extend-ignore = E501, PIE786
extend-select = TC, TC1
inline-quotes = double
max-complexity = 15
multiline-quotes = double
per-file-ignores =
*/models.py: TC
*/models/*.py: TC
type-checking-strict = true
2 changes: 1 addition & 1 deletion .github/actions/install_badabump/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:
steps:
- id: "python"
name: "Install Python"
uses: "actions/setup-python@v4.7.1"
uses: "actions/setup-python@v5.0.0"
with:
python-version-file: ".python-version"

Expand Down
6 changes: 3 additions & 3 deletions .github/actions/install_python_and_poetry/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ inputs:
poetry-version:
description: "Poetry version to use"
required: false
default: "1.4.2"
default: "1.7.1"

outputs:
python-path:
Expand All @@ -39,7 +39,7 @@ runs:
steps:
- id: "python"
name: "Install Python"
uses: "actions/setup-python@v4.7.1"
uses: "actions/setup-python@v5.0.0"
with:
python-version: "${{ inputs.python-version }}"
python-version-file: "${{ inputs.python-version-file }}"
Expand All @@ -49,7 +49,7 @@ runs:
run: "pipx install --python='${{ steps.python.outputs.python-path }}' poetry==${{ inputs.poetry-version }}"

- name: "Cache venv"
uses: "actions/cache@v3.3.2"
uses: "actions/cache@v4.0.0"
with:
path: "./.venv/"
key: "venv-${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}${{ inputs.cache-key-suffix }}"
4 changes: 2 additions & 2 deletions .github/actions/run_pre_commit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ runs:
shell: "bash"

- name: "Cache mypy"
uses: "actions/cache@v3.3.2"
uses: "actions/cache@v4.0.0"
with:
path: "./.mypy_cache/"
key: "mypy-${{ runner.os }}-${{ inputs.python-version }}"

- name: "Run pre-commit"
uses: "pre-commit/[email protected].0"
uses: "pre-commit/[email protected].1"
6 changes: 3 additions & 3 deletions .github/actions/run_tox/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ inputs:
tox-version:
description: "Tox version to use"
required: false
default: "4.4.8"
default: "4.12.1"

tox-gh-actions-version:
description: "Tox GitHub Actions plugin version to use"
required: false
default: "3.1.0"
default: "3.2.0"

use-coveralls:
description: "Send coverage to Coveralls"
Expand All @@ -41,7 +41,7 @@ runs:
shell: "bash"

- name: "Cache tox"
uses: "actions/cache@v3.3.2"
uses: "actions/cache@v4.0.0"
with:
path: ".tox/"
key: "tox-${{ inputs.python-version }}"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ jobs:
test:
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
include:
- python-version: "3.11"
- python-version: "3.12"
dev: "true"

name: "Python ${{ matrix.python-version }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

- name: "Publish package"
if: "${{ startsWith(github.ref, 'refs/tags/') }}"
uses: "pypa/[email protected].10"
uses: "pypa/[email protected].11"
with:
user: "${{ secrets.pypi-user }}"
password: "${{ secrets.pypi-password }}"
2 changes: 1 addition & 1 deletion .github/workflows/release_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
private_key: "${{ secrets.BADABUMP_APP_PRIVATE_KEY }}"

- name: "Create pull request with changed files"
uses: "peter-evans/create-pull-request@v5.0.2"
uses: "peter-evans/create-pull-request@v6.0.0"
with:
token: "${{ steps.token.outputs.token }}"
commit-message: |
Expand Down
25 changes: 16 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,26 @@ dmypy.json

# End of https://www.toptal.com/developers/gitignore/api/python

# AWS CDK files
/cdk.out
# Profiler files
*.prof

# DotENV files
.env.*
!.env.dev
!.env.test
# macOS Finder files
.*DS_Store*

# Makefile target
# Local DotEnv files
.env*.local

# Makefile install targets
.install*

# Sublime Text 3 workspace
*.sublime-workspace
# AWS CDK files
/cdk.out

# Shared Data files
data/shared/

# Media files
media/

# Auto-generated .gz static files
static/**/*.gz
Expand Down
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
default_language_version:
python: &python_version "python3.11"
python: &python_version "python3.12"
exclude: ^(archive|assets|migrations)/.*|.*/(migrations|test-data|vendor)/.*|.*\.svg$
minimum_pre_commit_version: "1.17.0"

repos:
- repo: "https://github.com/commitizen-tools/commitizen"
rev: "3.12.0"
rev: "v3.14.1"
hooks:
- id: "commitizen"
# By default commitizen using `python3` language version, so
Expand All @@ -20,14 +20,14 @@ repos:
name: "Format code (no-optional)"

- repo: "https://github.com/PyCQA/isort"
rev: "5.12.0"
rev: "5.13.2"
hooks:
- id: "isort"
name: "Format code (isort)"
exclude: ^docs/.*$

- repo: "https://github.com/psf/black"
rev: "23.11.0"
- repo: "https://github.com/psf/black-pre-commit-mirror"
rev: "24.1.1"
hooks:
- id: "black"
name: "Format code (black)"
Expand All @@ -40,7 +40,7 @@ repos:
name: "Format docs (blacken-docs)"
args: ["-l", "64"]
additional_dependencies:
- "black==23.3.0"
- "black==23.7.0"

- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: "v4.5.0"
Expand All @@ -61,12 +61,12 @@ repos:
- id: "rst-inline-touching-normal"

- repo: "https://github.com/PyCQA/flake8"
rev: "6.1.0"
rev: "7.0.0"
hooks:
- id: "flake8"
name: "Lint code (flake8)"
additional_dependencies: &flake8_additional_dependencies
- "flake8-bugbear==23.9.16"
- "flake8-bugbear==24.2.6"
- "flake8-builtins==2.2.0"
- "flake8-comprehensions==3.14.0"
- "flake8-implicit-str-concat==0.4.0"
Expand All @@ -77,7 +77,7 @@ repos:
- "flake8-string-format==0.3.0"
- "flake8-tidy-imports==4.10.0"
- "flake8-variables-names==0.0.6"
- "flake8==6.1.0"
- "flake8==7.0.0"
- "pep8-naming==0.13.3"
exclude: ^docs/.*$

Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11.6
3.12.2
Loading

0 comments on commit 7afb207

Please sign in to comment.