Skip to content
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

Drop Django 3.2 and 4.1 from the build matrix, add Django master #112

Merged
merged 9 commits into from
Apr 12, 2024
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
33 changes: 17 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,22 @@ jobs:
steps:
- uses: actions/[email protected]
- uses: actions/checkout@v4
- run: python -m pip install psycopg2-binary isort==5.6.4
- run: python -m pip install psycopg isort==5.13.2
- run: isort --diff --check .

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/checkout@v4
- run: python -m pip install -r docs/requirements.txt
- run: cd docs/ && make html && make spelling

tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12.8
image: postgres:13.13
env:
POSTGRES_USER: modeltrans
POSTGRES_PASSWORD: modeltrans
Expand All @@ -40,20 +48,8 @@ jobs:
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", 3.11, 3.12]
django-version: [3.2, 4.1, 4.2, 5.0]
django-version: [4.2, 5.0, master]
exclude:
# Django 3.2
- python-version: "3.10"
django-version: 3.2
- python-version: 3.11
django-version: 3.2
- python-version: 3.12
django-version: 3.2

# Django 4.1
- python-version: 3.12
django-version: 4.1

# Django 4.2
- python-version: 3.12
django-version: 4.2
Expand All @@ -64,6 +60,11 @@ jobs:
- python-version: 3.9
django-version: 5.0

# master
- python-version: 3.8
django-version: master
- python-version: 3.9
django-version: master

steps:
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -77,5 +78,5 @@ jobs:
if: matrix.django-version == 'master'
- run: |
python -m pip install coverage
python -m pip install psycopg2-binary==2.9.5
python -m pip install psycopg==3.1.8
- run: coverage run --source=modeltrans manage.py test
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Translates Django model fields in a `JSONField` using a registration approach.
# Features/requirements

- Uses one PostgreSQL `jsonb`-field per model (via `django.db.models.JSONField`)
- Django 3.2, 4.0, 4.1, 4.2 (with their supported python versions)
- PostgreSQL >= 9.5 and Psycopg2 >= 2.5.4.
- Django 4.2, 5.0 (with their supported python versions)
- PostgreSQL >= 13 and the appropriate `psycopg` version for your Django version
- [Available on pypi](https://pypi.python.org/pypi/django-modeltrans)
- [Documentation](http://django-modeltrans.readthedocs.io/en/latest/)

Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ django-modeltrans - Translate model fields using a `JSONField`
==============================================================

- Uses one `django.db.models.JSONField` (PostgreSQL JSONB field) for every record.
- Django Django 3.2, 4.0, 4.1, 4.2 (with their supported python versions)
- PostgreSQL >= 9.5 and Psycopg2 >= 2.5.4.
- Django Django 4.2, 5.0 (with their supported python versions)
- PostgreSQL >= 13 and the appropriate `psycopg` version for your Django version

About the app:

Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ django
sphinxcontrib-spelling==8.0.0
pyenchant==3.2.2
myst-parser==2.0.0
recommonmark
18 changes: 9 additions & 9 deletions example/example/settings.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""
Django settings for example project.

Generated by 'django-admin startproject' using Django 1.11.
Generated by 'django-admin startproject' using Django stable.

For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
https://docs.djangoproject.com/en/stable/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
https://docs.djangoproject.com/en/stable/ref/settings/
"""

import os
Expand All @@ -17,7 +17,7 @@


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
# See https://docs.djangoproject.com/en/stable/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = ")wv_qhm6r^ynx24c1t*#!y+qz)c_l*wm5rog^9xwwjsu$1*3u5"
Expand Down Expand Up @@ -77,10 +77,10 @@


# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
# https://docs.djangoproject.com/en/stable/ref/settings/#databases
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"ENGINE": "django.db.backends.postgresql",
"NAME": "model-translation",
"USER": "postgres",
"PASSWORD": "test1234",
Expand All @@ -92,7 +92,7 @@
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"

# Password validation
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
# https://docs.djangoproject.com/en/stable/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"},
Expand All @@ -102,7 +102,7 @@
]

# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/
# https://docs.djangoproject.com/en/stable/topics/i18n/

LANGUAGE_CODE = "en"

Expand All @@ -118,7 +118,7 @@


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/
# https://docs.djangoproject.com/en/stable/howto/static-files/

STATIC_URL = "/static/"
DJANGO_TABLES2_TEMPLATE = "django_tables2/bootstrap.html"
Expand Down
4 changes: 2 additions & 2 deletions example/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Django==3.2.*
psycopg2-binary
Django==5.0.*
psycopg
pytz==2021.1
wheel==0.38.1
django-tables2==2.4.0
Expand Down
5 changes: 1 addition & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,10 @@
url="https://github.com/zostera/django-modeltrans/",
packages=find_packages(exclude=["tests.*", "tests", "example.*", "example"]),
include_package_data=True, # declarations in MANIFEST.in
install_requires=["Django>=3.2"],
install_requires=["Django>=4.2"],
classifiers=[
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 3.2", # Until April 2024
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Intended Audience :: Developers",
Expand Down
2 changes: 1 addition & 1 deletion test_migrations/migrate_test/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"ENGINE": "django.db.backends.postgresql",
"NAME": "modeltrans-migration",
"USER": "postgres",
"PASSWORD": "test1234",
Expand Down
4 changes: 2 additions & 2 deletions test_migrations/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Django==2.2.*
psycopg2==2.7.1
Django==5.0.*
psycopg
django-modeltranslation==0.12.1
14 changes: 7 additions & 7 deletions tests/app/settings.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""
Django settings for example project.

Generated by 'django-admin startproject' using Django 1.11.
Generated by 'django-admin startproject' using Django stable.

For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
https://docs.djangoproject.com/en/stable/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
https://docs.djangoproject.com/en/stable/ref/settings/
"""

import os
Expand All @@ -17,7 +17,7 @@


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
# See https://docs.djangoproject.com/en/stable/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = ")wv_qhm6r^ynx24c1t*#!y+qz)c_l*wm5rog^9xwwjsu$1*3u5"
Expand Down Expand Up @@ -73,10 +73,10 @@


# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
# https://docs.djangoproject.com/en/stable/ref/settings/#databases
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"ENGINE": "django.db.backends.postgresql",
"NAME": "modeltrans",
"USER": "modeltrans",
"PASSWORD": "modeltrans",
Expand All @@ -88,7 +88,7 @@
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"

# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/
# https://docs.djangoproject.com/en/stable/topics/i18n/

LANGUAGE_CODE = "en"

Expand Down
41 changes: 19 additions & 22 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
[tox]
args_are_paths = false
envlist =
py35-{2.2},
py36-{2.2,3.1,master},
py37-{2.2,3.1,master},
py38-{3.1,3.2,master},
py39-{3.1,3.2,master},
py38-{4.2},
py39-{4.2},
py310-{4.2,5.0,master},
py311-{4.2,5.0,master},
py311-{4.2,5.0,master},
migrate,
flake8,
isort,
Expand All @@ -15,10 +15,11 @@ envlist =

[testenv]
basepython =
py35: python3.5
py36: python3.6
py37: python3.7
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11
py312: python3.12
usedevelop = true
pip_pre = true
setenv =
Expand All @@ -28,22 +29,18 @@ setenv =
commands =
coverage run ./manage.py test --no-input
deps =
2.2: Django==2.2.*
3.1: Django==3.1.*
3.2: Django==3.2.*
4.0: Django==4.0.*
4.1: Django==4.1.*
4.2: Django==4.2b1
4.2: Django==4.2.*
5.0: Django==5.0.*
master: https://github.com/django/django/archive/master.tar.gz
psycopg2-binary==2.9.5
psycopg
coverage

[testenv:migrate]
setenv =
PYTHONPATH={toxinidir}
PYTHONDONTWRITEBYTECODE=1
COVERAGE_FILE=../.coverage
basepython = python3.7
basepython = python3.11
recreate = true
skip_install = true
deps = coverage
Expand All @@ -52,7 +49,7 @@ commands =
python test_migrations/clean.py

[testenv:flake8]
basepython = python3.8
basepython = python3.11
deps = flake8==3.7.9
skip_install = True
commands = flake8
Expand All @@ -70,8 +67,8 @@ max-line-length = 120

[testenv:isort]
allowlist_externals = make
deps = isort==4.2.15
basepython = python3.8
deps = isort==5.13.2
basepython = python3.11
commands = make isort

[isort]
Expand All @@ -85,7 +82,7 @@ known_third_party = django,django_filters,django_tables2
known_first_party = modeltrans,app

[testenv:docs]
basepython = python3.8
basepython = python3.11
allowlist_externals = make
changedir = docs
setenv = PYTHONWARNINGS=once
Expand All @@ -97,7 +94,7 @@ deps =
-r{toxinidir}/docs/requirements.txt

[testenv:black]
basepython = python3.8
basepython = python3.11
passenv = LC_CTYPE
deps = black==19.10b0
deps = black
commands = black --check .
Loading