Skip to content

Commit

Permalink
try fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
bckohan committed Jan 24, 2024
1 parent 602fa11 commit d91e995
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 24 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ jobs:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
django-version:
- 'Django~=3.2.0' # LTS April 2024
- 'Django~=4.2.0' # LTS April 2026
- 'Django~=5.0.0' # April 2025
- '3.2.0' # LTS April 2024
- '4.2.0' # LTS April 2026
- '5.0.0' # April 2025
exclude:
- python-version: '3.11'
django-version: 'Django~=3.2.0'
django-version: '3.2.0'
- python-version: '3.12'
django-version: 'Django~=3.2.0'
django-version: '3.2.0'
- python-version: '3.8'
django-version: 'Django~=5.0.0'
django-version: '5.0.0'
- python-version: '3.9'
django-version: 'Django~=5.0.0'
django-version: '5.0.0'

steps:
- uses: actions/checkout@v3
Expand All @@ -91,10 +91,11 @@ jobs:
poetry config virtualenvs.in-project true
poetry run pip install --upgrade pip
poetry install -E all
poetry run pip install -U "${{ matrix.django-version }}"
poetry run pip install -U "Django~=${{ matrix.django-version }}"
- name: Run Unit Tests
run: |
poetry run pytest
mv .coverage py${{ matrix.python-version }}-dj${{ matrix.django-version }}.coverage
- name: Store coverage files
uses: actions/upload-artifact@v4
Expand Down
4 changes: 1 addition & 3 deletions render_static/loaders/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ def get_dirs(self) -> List[str]:
Return a priority ordered list of directories on the search path of
this loader.
"""
raise NotImplementedError(
f"{self.__class__.__name__} must implement get_dirs!"
)
raise NotImplementedError(f"{self.__class__.__name__} must implement get_dirs!")

def select_templates(self, selector: str) -> Generator[List[str], None, None]:
"""
Expand Down
5 changes: 1 addition & 4 deletions render_static/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@

# Distinguishing between different versions of Python:
if sys.version_info >= (3, 9):
from importlib.resources import ( # pylint: disable=E0611
as_file,
files,
)
from importlib.resources import as_file, files # pylint: disable=E0611
else:
try:
from importlib_resources import as_file, files
Expand Down
4 changes: 1 addition & 3 deletions render_static/transpilers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
from django.utils.safestring import SafeString

if TYPE_CHECKING:
from render_static.templatetags.render_static import (
OverrideNode,
)
from render_static.templatetags.render_static import OverrideNode


__all__ = [
Expand Down
8 changes: 2 additions & 6 deletions render_static/transpilers/urls_to_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,7 @@ def _build_branch( # pylint: disable=R0913
),
)
else:
raise NotImplementedError(
f"Unknown pattern type: {type(pattern)}"
)
raise NotImplementedError(f"Unknown pattern type: {type(pattern)}")

return branch

Expand Down Expand Up @@ -410,9 +408,7 @@ def get_params(pattern: Union[RoutePattern, RegexPattern]) -> Dict[str, Any]:
var: {"app_name": app_name}
for var in pattern.regex.groupindex.keys()
}
raise URLGenerationFailed(
f"Unrecognized pattern type: {type(pattern)}"
)
raise URLGenerationFailed(f"Unrecognized pattern type: {type(pattern)}")

params = get_params(endpoint.pattern)

Expand Down

0 comments on commit d91e995

Please sign in to comment.