Skip to content

Commit

Permalink
fix mypy python3.8 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
lsaavedr committed Oct 24, 2024
1 parent 092c16f commit 7ecea88
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
11 changes: 11 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include CHANGELOG.md
include INSTALL
include LICENSE
include README.md
include runtests.sh
recursive-include tests *
global-exclude *.py[cod] __pycache__
global-exclude .coverage
global-exclude .DS_Store
exclude .pre-commit-config.yaml
recursive-include rules *.typed
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ check = "mypy --install-types --non-interactive {args:src/drf_rules tests}"
line-length = 79

[tool.coverage.run]
source_pkgs = ["drf_rules", "tests"]
source_pkgs = ["drf_rules"]
branch = true
parallel = true
omit = ["src/drf_rules/__about__.py"]
omit = ["src/drf_rules/__about__.py", "tests/*"]

[tool.coverage.paths]
drf_rules = ["src/drf_rules", "*/drf-rules/src/drf_rules"]
Expand Down
6 changes: 6 additions & 0 deletions runtests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

# NOTE: Make sure you `pip install -e .` first
coverage run tests/manage.py test --failfast -v2 testapp "$@" \
&& echo \
&& coverage report -m
4 changes: 3 additions & 1 deletion tests/testapp/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Generated by Django 5.1.2 on 2024-10-24 01:30

from typing import List, Tuple

import rules.contrib.models
from django.db import migrations, models

Expand All @@ -8,7 +10,7 @@ class Migration(migrations.Migration):

initial = True

dependencies: list[tuple[str, str]] = []
dependencies: List[Tuple[str, str]] = []

operations = [
migrations.CreateModel(
Expand Down
4 changes: 3 additions & 1 deletion tests/testapp/tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# SPDX-FileCopyrightText: 2024-present Luis Saavedra <[email protected]>
#
# SPDX-License-Identifier: BSD-3-Clause
from typing import List

from django.core.exceptions import ImproperlyConfigured
from django.urls import URLPattern
from rest_framework.decorators import action
Expand All @@ -16,7 +18,7 @@


class AutoPermissionRequiredMixinTests(APITestCase, URLPatternsTestCase):
urlpatterns: list[URLPattern] = []
urlpatterns: List[URLPattern] = []

@classmethod
def setUpClass(cls):
Expand Down

0 comments on commit 7ecea88

Please sign in to comment.