Skip to content

Commit

Permalink
Add support for django official versions (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
irtazaakram authored Jul 26, 2023
1 parent f5231ba commit 69ece12
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 23 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,24 @@ on: [push,pull_request]
jobs:
build:

runs-on: ubuntu-latest
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
python-version: [3.8, 3.9, "3.10", "3.11"]
os: [ ubuntu-latest]

# Python 3.6 & 3.7 are no longer available in ubuntu-latest
include:
- python-version: '3.6'
os: ubuntu-20.04
- python-version: '3.7'
os: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
9 changes: 5 additions & 4 deletions .python-version
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
3.8.12
3.9.9
3.10.0
3.7.12
3.8.17
3.9.17
3.10.12
3.11.4
3.7.16
3.6.15
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Supported Django Versions

``django-statici18n`` works with all the Django versions officially
supported by the Django project. At this time of writing, these are the
3.2 (LTS), 4.0 and 4.1 series.
3.2 (LTS), 4.1, 4.2 series.

Installation
------------
Expand Down Expand Up @@ -109,9 +109,9 @@ The following step assumes you're using `django.contrib.staticfiles`_.
<script>{% inlinei18n LANGUAGE_CODE %}</script>

.. _PyPI: http://pypi.python.org/pypi/django-statici18n
.. _translated: https://docs.djangoproject.com/en/2.2/topics/i18n/translation/#message-files
.. _compiled: https://docs.djangoproject.com/en/2.2/topics/i18n/translation/#compiling-message-files
.. _django.core.context_processors.i18n: https://docs.djangoproject.com/en/2.2/ref/templates/api/#django-template-context-processors-i18n
.. _translated: https://docs.djangoproject.com/en/4.2/topics/i18n/translation/#message-files
.. _compiled: https://docs.djangoproject.com/en/4.2/topics/i18n/translation/#compiling-message-files
.. _django.core.context_processors.i18n: https://docs.djangoproject.com/en/4.2/ref/templates/api/#django-template-context-processors-i18n
.. _Upgrading templates to Django 1.8: https://docs.djangoproject.com/en/2.2/ref/templates/upgrading/
.. _dynamically generated script: https://docs.djangoproject.com/en/2.2/topics/i18n/translation/#using-the-javascript-translation-catalog
.. _django.contrib.staticfiles: https://docs.djangoproject.com/en/2.2/ref/contrib/staticfiles/
.. _dynamically generated script: https://docs.djangoproject.com/en/4.2/topics/i18n/translation/#using-the-javascript-translation-catalog
.. _django.contrib.staticfiles: https://docs.djangoproject.com/en/4.2/ref/contrib/staticfiles/
7 changes: 7 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

Unreleased
--------------------

* Add support for Django 4.1 & 4.2
* Add support for Python 3.11
* Drop support for Django 4.0

v2.3.1 (2022 Aug 14)
--------------------

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
include_package_data=True,
zip_safe=False,
install_requires=[
"Django>=2.2",
"Django>=3.2",
"django-appconf>=1.0",
],
license="BSD",
Expand All @@ -32,6 +32,7 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],
project_urls={
"Source": "https://github.com/zyegfryed/django-statici18n",
Expand Down
10 changes: 5 additions & 5 deletions tests/test_project/project/urls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django.conf.urls import patterns, url
from django.urls import path
from django.views.generic.base import TemplateView

urlpatterns = patterns(
urlpatterns = [
"",
url(r"^$", TemplateView.as_view(template_name="base.html")),
url(r"^jsi18n/$", "django.views.i18n.javascript_catalog", name="jsi18n"),
)
path("", TemplateView.as_view(template_name="base.html")),
path("jsi18n/", "django.views.i18n.javascript_catalog", name="jsi18n"),
]
8 changes: 5 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[tox]
envlist =
py{36,37,38,39,310}-django32,
py{38,39,310}-django{40,41},
py{38,39,310}-django{41,42},
py{311}-django{41,42},
coverage

[gh-actions]
Expand All @@ -11,6 +12,7 @@ python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311

[testenv]
passenv =
Expand All @@ -23,15 +25,15 @@ deps =
pytest
pytest-django
django32: Django>=3.2,<3.3
django40: Django>=4.0,<4.1
django41: Django>=4.1,<4.2
django42: Django>=4.2,<4.3

[testenv:coverage]
basepython = python3.8
commands =
pytest -q --cov=statici18n --cov-report=xml tests
deps =
Django>=2.2,<3.0
Django>=4.2,<5.0
pytest
pytest-cov
pytest-django

0 comments on commit 69ece12

Please sign in to comment.