diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3c3a8e..eb08c3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,14 +22,22 @@ jobs: steps: - uses: actions/setup-python@v5.1.0 - 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/setup-python@v5.1.0 + - 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 @@ -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 @@ -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 }} @@ -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 diff --git a/README.md b/README.md index 38876b7..235976f 100644 --- a/README.md +++ b/README.md @@ -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/) diff --git a/docs/index.rst b/docs/index.rst index b2e0f5d..a70cdc5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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: diff --git a/docs/requirements.txt b/docs/requirements.txt index db20c4b..454b574 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -4,3 +4,4 @@ django sphinxcontrib-spelling==8.0.0 pyenchant==3.2.2 myst-parser==2.0.0 +recommonmark diff --git a/example/example/settings.py b/example/example/settings.py index d3f7c40..85db8bf 100644 --- a/example/example/settings.py +++ b/example/example/settings.py @@ -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 @@ -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" @@ -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", @@ -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"}, @@ -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" @@ -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" diff --git a/example/requirements.txt b/example/requirements.txt index b0d56be..8a9c45e 100644 --- a/example/requirements.txt +++ b/example/requirements.txt @@ -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 diff --git a/setup.py b/setup.py index 20eba13..00b0723 100755 --- a/setup.py +++ b/setup.py @@ -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", diff --git a/test_migrations/migrate_test/settings.py b/test_migrations/migrate_test/settings.py index 05c4c00..53d3230 100644 --- a/test_migrations/migrate_test/settings.py +++ b/test_migrations/migrate_test/settings.py @@ -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", diff --git a/test_migrations/requirements.txt b/test_migrations/requirements.txt index 3a7e942..84e9ced 100644 --- a/test_migrations/requirements.txt +++ b/test_migrations/requirements.txt @@ -1,3 +1,3 @@ -Django==2.2.* -psycopg2==2.7.1 +Django==5.0.* +psycopg django-modeltranslation==0.12.1 diff --git a/tests/app/settings.py b/tests/app/settings.py index a0adb93..8b65f34 100644 --- a/tests/app/settings.py +++ b/tests/app/settings.py @@ -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 @@ -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" @@ -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", @@ -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" diff --git a/tox.ini b/tox.ini index 50afb64..c0a258b 100644 --- a/tox.ini +++ b/tox.ini @@ -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, @@ -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 = @@ -28,14 +29,10 @@ 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] @@ -43,7 +40,7 @@ setenv = PYTHONPATH={toxinidir} PYTHONDONTWRITEBYTECODE=1 COVERAGE_FILE=../.coverage -basepython = python3.7 +basepython = python3.11 recreate = true skip_install = true deps = coverage @@ -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 @@ -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] @@ -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 @@ -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 .