Skip to content

Repleace fussyfox with GH actions #166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .fussyfox.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@ on:

jobs:

lint:
runs-on: ubuntu-latest
strategy:
matrix:
lint-command:
- bandit -r . -x ./tests
- black --check --diff .
- flake8 .
- isort --check-only --diff .
- pydocstyle .
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
cache: 'pip'
cache-dependency-path: 'linter-requirements.txt'
- run: python -m pip install -r linter-requirements.txt
- run: ${{ matrix.lint-command }}

dist:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -41,6 +61,7 @@ jobs:

PyTest:
needs:
- lint
- standardjs
strategy:
matrix:
Expand All @@ -65,6 +86,7 @@ jobs:

Selenium:
needs:
- lint
- standardjs
strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion django_select2/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class Select2Conf(AppConf):
``settings.DJANGO_SELECT2_I18N`` refers to :attr:`.I18N_PATH`.
"""

JSON_ENCODER = 'django.core.serializers.json.DjangoJSONEncoder'
JSON_ENCODER = "django.core.serializers.json.DjangoJSONEncoder"
"""
A :class:`JSONEncoder<json.JSONEncoder>` used to generate the API response for the model widgets.

Expand Down
4 changes: 2 additions & 2 deletions django_select2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from django.core import signing
from django.core.signing import BadSignature
from django.http import Http404, JsonResponse
from django.views.generic.list import BaseListView
from django.utils.module_loading import import_string
from django.views.generic.list import BaseListView

from .cache import cache
from .conf import settings
Expand Down Expand Up @@ -45,7 +45,7 @@ def get(self, request, *args, **kwargs):
],
"more": context["page_obj"].has_next(),
},
encoder=import_string(settings.SELECT2_JSON_ENCODER)
encoder=import_string(settings.SELECT2_JSON_ENCODER),
)

def get_queryset(self):
Expand Down
5 changes: 5 additions & 0 deletions linter-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bandit==1.7.4
black==22.10.0
flake8==5.0.4
isort==5.10.1
pydocstyle[toml]==6.1.1
5 changes: 2 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@


def pytest_configure(config):
config.addinivalue_line(
"markers", "selenium: skip if selenium is not installed"
)
config.addinivalue_line("markers", "selenium: skip if selenium is not installed")


def random_string(n):
return "".join(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
HeavySelect2Widget,
ModelSelect2TagWidget,
ModelSelect2Widget,
Select2Widget,
Select2AdminMixin,
Select2Widget,
)
from tests.testapp import forms
from tests.testapp.forms import (
Expand Down