Skip to content

Commit

Permalink
improve py312 compatibility
Browse files Browse the repository at this point in the history
fix warnings

debug

improve tests

format files
  • Loading branch information
alex-oleshkevich committed Aug 13, 2024
1 parent 4fd4da6 commit 320c373
Show file tree
Hide file tree
Showing 12 changed files with 757 additions and 491 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,36 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ '3.10', '3.11' ]
python-version: [ '3.10', '3.11', '3.12' ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Run pre-commit
uses: pre-commit/action@v3.0.0
uses: pre-commit/action@v3.0.1

unit_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ '3.10', '3.11' ]
python-version: [ '3.10', '3.11', '3.12' ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: ${{ matrix.python-version }}

- name: Cache poetry
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cache/pypoetry
Expand All @@ -53,6 +54,15 @@ jobs:
poetry config virtualenvs.create false
poetry install --no-interaction
- name: Test with pytest
- name: Run tests
run: pytest --cov --cov-report xml --cov-report term-missing

- name: Upload coverage
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
verbose: true

- name: Generate coverage
run: |
pytest --no-cov-on-fail --cov starlette_babel/ --cov tests/
python -m coverage report --fail-under=100 -m
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'

Expand Down
37 changes: 11 additions & 26 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ default_stages: [ commit ]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -21,43 +21,28 @@ repos:
- id: check-merge-conflict
- id: check-docstring-first
- id: check-added-large-files
args: [ "--maxkb=1024" ]
- id: check-executables-have-shebangs

- repo: https://github.com/pycqa/isort
rev: 5.12.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.3
hooks:
- id: isort

- repo: https://github.com/psf/black.git
rev: 23.3.0
hooks:
- id: black

- repo: https://github.com/humitos/mirrors-autoflake.git
rev: v1.1
hooks:
- id: autoflake
args: [ '--in-place', '--remove-all-unused-imports', '--remove-unused-variable' ]


- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
- id: ruff
args: [ --fix ]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.2.0'
rev: 'v1.9.0'
hooks:
- id: mypy
files: "starlette_babel|examples|tests"
files: "starlette_babel"
additional_dependencies:
- starlette
- jinja2
- pytest
- babel
- types-babel

- repo: https://github.com/myint/docformatter.git
rev: v1.6.4
rev: v1.7.5
hooks:
- id: docformatter
args: [ '--in-place', '--wrap-summaries=120', '--wrap-descriptions=120', '--pre-summary-newline' ]
Loading

0 comments on commit 320c373

Please sign in to comment.