diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b1f06674..1e97128b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,6 +8,17 @@ on: - pull_request jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + - uses: pre-commit/action@v3.0.0 + - uses: pre-commit-ci/lite-action@v1.0.1 + if: always() + tests: runs-on: ubuntu-latest strategy: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 60d0600b..11b83cab 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.2.0 + rev: "v4.4.0" hooks: # - id: trailing-whitespace # - id: end-of-file-fixer @@ -8,17 +8,17 @@ repos: - id: check-added-large-files - repo: https://github.com/asottile/pyupgrade - rev: v2.38.4 + rev: "v3.3.2" hooks: - id: pyupgrade - args: [--py36-plus] + args: [--py37-plus] - repo: https://github.com/pycqa/isort - rev: "5.10.1" + rev: "5.12.0" hooks: - id: isort - repo: https://github.com/psf/black - rev: "22.8.0" + rev: "23.3.0" hooks: - id: black diff --git a/django_countries/data.py b/django_countries/data.py index dda83769..8fc33f07 100755 --- a/django_countries/data.py +++ b/django_countries/data.py @@ -563,7 +563,6 @@ def self_generate( # Sort countries. def sort_key(row): - return ( unicodedata.normalize("NFKD", row[0]) .encode("ascii", "ignore") diff --git a/django_countries/tests/test_countries.py b/django_countries/tests/test_countries.py index 612ad3d5..2502ba3a 100644 --- a/django_countries/tests/test_countries.py +++ b/django_countries/tests/test_countries.py @@ -398,7 +398,6 @@ def test_translation_fallback_override_names(self): } } ): - lang = translation.get_language() try: translation.activate("eo") diff --git a/django_countries/tests/test_tags.py b/django_countries/tests/test_tags.py index 1848da21..71669efc 100644 --- a/django_countries/tests/test_tags.py +++ b/django_countries/tests/test_tags.py @@ -8,7 +8,6 @@ class TestCountriesTags(TestCase): - TEMPLATE_COUNTRY = Template( "{% load countries %}{% get_country code as country %}{{ country }}" )