Skip to content

Commit d8fac97

Browse files
committed
feat: badge and unit test config
1 parent c1d9ef7 commit d8fac97

File tree

7 files changed

+29
-21
lines changed

7 files changed

+29
-21
lines changed

.github/workflows/test_full.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
15-
django-version: ['<2.1', '<2.2', '<3.0', '<3.1', '<3.2', '<3.3', '<4.1']
15+
django-version: ['>3.1', '<3.2', '<3.3', '<4.1']
1616

1717
steps:
1818
- uses: actions/checkout@v3
@@ -23,7 +23,7 @@ jobs:
2323
- name: Install core
2424
run: pip install "Django${{ matrix.django-version }}" pydantic
2525
- name: Install tests
26-
run: pip install pytest pytest-asyncio pytest-django django django-ninja-extra factory-boy
26+
run: pip install pytest pytest-asyncio pytest-django django django-ninja-extra factory-boy django-ninja-jwt
2727
- name: Test
2828
run: pytest
2929
codestyle:
@@ -45,5 +45,5 @@ jobs:
4545
run: isort --check easy tests
4646
- name: Flake8
4747
run: flake8 easy tests
48-
- name: mypy
49-
run: mypy easy
48+
# - name: mypy
49+
# run: mypy easy

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ install: ## Install dependencies
1515
flit install --deps develop --symlink
1616

1717
lint: ## Run code linters
18-
autoflake --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports -r easy
19-
black --check easy
20-
isort --check easy
18+
autoflake --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports -r easy tests
19+
black --check easy tests
20+
isort --check easy tests
2121
flake8
2222
mypy easy
2323

2424
fmt format: ## Run code formatters
25-
autoflake --in-place --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports -r easy
26-
isort easy
27-
black easy
25+
autoflake --in-place --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports -r easy tests
26+
isort easy tests
27+
black easy tests
2828

2929
test: ## Run tests
3030
pytest

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
![Test](https://github.com/freemindcore/django-api-framework/workflows/Test/badge.svg)
2+
[![PyPI version](https://badge.fury.io/py/django-api-framework.svg)](https://badge.fury.io/py/django-api-framework)
3+
[![PyPI version](https://img.shields.io/pypi/v/django-api-framework.svg)](https://pypi.python.org/pypi/django-api-framework)
4+
[![PyPI version](https://img.shields.io/pypi/pyversions/django-api-framework.svg)](https://pypi.python.org/pypi/django-api-framework)
5+
[![PyPI version](https://img.shields.io/pypi/djversions/django-api-framework.svg)](https://pypi.python.org/pypi/django-api-framework)
6+
[![Codecov](https://img.shields.io/codecov/c/gh/freemindcore/django-api-framework)](https://codecov.io/gh/freemindcore/django-api-framework)
7+
[![Downloads](https://pepy.tech/badge/django-api-framework/month)](https://pepy.tech/project/django-api-framework)
8+
19
# Django Easy API Framework
210

311
### Easy and Fast Django REST framework based on Django-ninja-extra
@@ -27,8 +35,8 @@ Plus Extra:
2735

2836
### Requirements
2937
- Python >= 3.6
30-
- Django >= 2.1
31-
- pydantic >= 1.6
38+
- Django >= 3.1
39+
- pydantic >= 1.6
3240
- Django-Ninja-extra >= 0.15.0
3341

3442
### Install

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ classifiers = [
4040
]
4141

4242
requires = [
43-
"Django >= 2.1",
43+
"Django >= 3.1",
4444
"django-ninja-extra >= 0.15.0",
4545
]
4646
description-file = "README.md"
@@ -62,7 +62,10 @@ test = [
6262
"flake8",
6363
"mypy==0.931",
6464
"django-stubs",
65-
"factory-boy==3.2.1 "
65+
"factory-boy==3.2.1",
66+
"django_coverage_plugin",
67+
"django-ninja-jwt",
68+
"Django >= 3.1",
6669
]
6770
doc = [
6871
"mkdocs >=1.1.2,<2.0.0",

tests/demo_app/tests/test_async_api_permissions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
import pytest
55
from asgiref.sync import sync_to_async
66

7-
from tests.demo_app.models import Event
8-
from tests.demo_app.schema import EventSchema
97
from tests.demo_app.controllers import (
108
EasyEventPermissionController,
119
EventControllerAPI,
1210
EventPermissionController,
1311
)
12+
from tests.demo_app.models import Event
13+
from tests.demo_app.schema import EventSchema
1414
from tests.demo_app.tests.test_async_crud_apis import dummy_data
1515

1616

tests/demo_app/tests/test_async_crud_admin_apis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import pytest
66
from asgiref.sync import sync_to_async
77

8-
from tests.demo_app.models import Event
98
from tests.demo_app.controllers import EventControllerAPI, EventSchema
9+
from tests.demo_app.models import Event
1010

1111
dummy_data = dict(
1212
title="AsyncAdminAPIEvent",

tests/demo_app/tests/test_async_crud_apis.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33
import django
44
import pytest
55

6+
from tests.demo_app.controllers import EventControllerTest2API, EventEasyControllerAPI
67
from tests.demo_app.services import EventService
7-
from tests.demo_app.controllers import (
8-
EventControllerTest2API,
9-
EventEasyControllerAPI,
10-
)
118

129
dummy_data = dict(
1310
title="AsyncAPIEvent",

0 commit comments

Comments
 (0)