generated from yunojuno/poetry-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7249685
commit 814b0fe
Showing
14 changed files
with
157 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,97 @@ | ||
name: Python / Django | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
push: | ||
branches: | ||
- master | ||
|
||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
format: | ||
name: Check formatting | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
toxenv: [fmt, lint, mypy] | ||
env: | ||
TOXENV: ${{ matrix.toxenv }} | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install and run tox | ||
run: | | ||
pip install tox | ||
tox | ||
test: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: ["3.8", "3.10", "3.11"] | ||
django: ["32", "41", main] | ||
|
||
env: | ||
TOXENV: py${{ matrix.python }}-django${{ matrix.django }} | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Install and run tox | ||
run: | | ||
pip install tox | ||
tox | ||
format: | ||
name: Check formatting | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
toxenv: [fmt, lint, mypy] | ||
env: | ||
TOXENV: ${{ matrix.toxenv }} | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python (3.11) | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install and run tox | ||
run: | | ||
pip install tox | ||
tox | ||
checks: | ||
name: Run Django checks | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
toxenv: ["django-checks"] | ||
env: | ||
TOXENV: ${{ matrix.toxenv }} | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python (3.11) | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install and run tox | ||
run: | | ||
pip install tox | ||
tox | ||
test: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
# build LTS version, next version, HEAD | ||
django: ["32", "42", "50", "main"] | ||
exclude: | ||
- python: "3.8" | ||
django: "50" | ||
- python: "3.8" | ||
django: "main" | ||
- python: "3.9" | ||
django: "50" | ||
- python: "3.9" | ||
django: "main" | ||
- python: "3.10" | ||
django: "main" | ||
- python: "3.11" | ||
django: "32" | ||
- python: "3.12" | ||
django: "32" | ||
|
||
env: | ||
TOXENV: django${{ matrix.django }}-py${{ matrix.python }} | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Install and run tox | ||
run: | | ||
pip install tox | ||
tox |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,26 @@ | ||
repos: | ||
# python import sorting - will amend files | ||
- repo: https://github.com/pre-commit/mirrors-isort | ||
rev: v5.10.1 | ||
hooks: | ||
- id: isort | ||
|
||
# python code formatting - will amend files | ||
- repo: https://github.com/ambv/black | ||
rev: 22.10.0 | ||
rev: 23.10.1 | ||
hooks: | ||
- id: black | ||
|
||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v3.1.0 | ||
hooks: | ||
- id: pyupgrade | ||
|
||
# Flake8 includes pyflakes, pycodestyle, mccabe, pydocstyle, bandit | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.9.2 | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
# Ruff version. | ||
rev: "v0.1.5" | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: | ||
- flake8-bandit | ||
- flake8-blind-except | ||
- flake8-docstrings | ||
- flake8-logging-format | ||
- flake8-print | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
|
||
# python static type checking | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.982 | ||
rev: v1.7.0 | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: | ||
- types-geoip2 | ||
args: | ||
- --disallow-untyped-defs | ||
- --disallow-incomplete-defs | ||
- --check-untyped-defs | ||
- --no-implicit-optional | ||
- --ignore-missing-imports | ||
- --follow-imports=silent | ||
exclude: ^tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import time | ||
import re | ||
import time | ||
|
||
ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.