Skip to content

Commit 31cfb70

Browse files
committed
extend linting CI matrix, fix import order issue, update pyright config
1 parent 49b7ec2 commit 31cfb70

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

.github/workflows/lint.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,24 @@ jobs:
99
strategy:
1010
matrix:
1111
# run static analysis on bleeding and trailing edges
12-
python-version: [ '3.8', '3.12' ]
12+
python-version: [ '3.8', '3.10', '3.12' ]
1313
django-version:
14-
- 'Django~=3.2.0' # LTS April 2024
15-
- 'Django~=4.2.0' # LTS April 2026
14+
- '3.2' # LTS April 2024
15+
- '4.2' # LTS April 2026
16+
- '5.0' # April 2025
1617
exclude:
1718
- python-version: '3.8'
18-
django-version: 'Django~=4.2.0'
19+
django-version: '4.2'
1920
- python-version: '3.12'
20-
django-version: 'Django~=3.2.0'
21+
django-version: '4.2'
22+
- python-version: '3.12'
23+
django-version: '3.2'
24+
- python-version: '3.10'
25+
django-version: '3.2'
26+
- python-version: '3.8'
27+
django-version: '5.0'
28+
- python-version: '3.10'
29+
django-version: '5.0'
2130

2231
steps:
2332
- uses: actions/checkout@v4
@@ -35,7 +44,7 @@ jobs:
3544
poetry config virtualenvs.in-project true
3645
poetry run pip install --upgrade pip
3746
poetry install
38-
poetry run pip install -U "${{ matrix.django-version }}"
47+
poetry run pip install -U "django~=${{ matrix.django-version }}"
3948
- name: Run Static Analysis
4049
run: |
4150
poetry run isort django_typer --check

CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ certain errors or warnings where justified is acceptable:
6464
poetry run black django_typer
6565
poetry run pylint django_typer
6666
poetry run mypy django_typer
67-
pyright django_typer
67+
pyright
6868
poetry check
6969
poetry run pip check
7070
poetry run python -m readme_renderer ./README.rst

django_typer/parsers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
from click import Context, Parameter, ParamType
2929
from django.apps import AppConfig, apps
30-
from django.contrib.contenttypes.fields import GenericForeignKey
3130
from django.core.management import CommandError
3231
from django.db.models import Field, ForeignObjectRel, Model, UUIDField
3332
from django.utils.translation import gettext as _
@@ -91,6 +90,8 @@ def __init__(
9190
case_insensitive: bool = case_insensitive,
9291
on_error: t.Optional[error_handler] = on_error,
9392
):
93+
from django.contrib.contenttypes.fields import GenericForeignKey
94+
9495
self.model_cls = model_cls
9596
self.lookup_field = str(
9697
lookup_field or getattr(self.model_cls._meta.pk, "name", "id")

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,6 @@ exclude = [
195195
"django_typer/tests/**/*",
196196
"django_typer/examples/**/*"
197197
]
198+
include = [
199+
"django_typer"
200+
]

0 commit comments

Comments
 (0)