From 0ad7eb6c35ec342c58adecdd5b5df3b15056c150 Mon Sep 17 00:00:00 2001 From: Jan Pieter Waagmeester Date: Thu, 11 Apr 2024 21:01:12 +0200 Subject: [PATCH 1/9] Drop django 3.2 and 4.1 from the build matrix --- .github/workflows/ci.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3c3a8e..c4ffe81 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,20 +40,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 From 559e38635d644a130f7e50b9bfbee388a98bc823 Mon Sep 17 00:00:00 2001 From: Jan Pieter Waagmeester Date: Thu, 11 Apr 2024 21:04:07 +0200 Subject: [PATCH 2/9] Exclude py 3.8 and 3.9 for django master --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4ffe81..4c4a5a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,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 }} From a2c43bd0729a5fc06411a0a341b73ed7697bb490 Mon Sep 17 00:00:00 2001 From: Jan Pieter Waagmeester Date: Thu, 11 Apr 2024 21:06:56 +0200 Subject: [PATCH 3/9] Bump postgres in CI because django 5.1 requires at least 13 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c4a5a0..22464c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest services: postgres: - image: postgres:12.8 + image: postgres:13.13 env: POSTGRES_USER: modeltrans POSTGRES_PASSWORD: modeltrans From e2d04c63754df215d55b316be6e6813f29e1e57d Mon Sep 17 00:00:00 2001 From: Jan Pieter Waagmeester Date: Thu, 11 Apr 2024 21:10:34 +0200 Subject: [PATCH 4/9] Update documentation and tox --- README.md | 4 ++-- docs/index.rst | 4 ++-- setup.py | 5 +---- tox.ini | 16 +++++++--------- 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 38876b7..30499b6 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 Psycopg2 >= 2.5.4. - [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..4ac254d 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 Psycopg2 >= 2.5.4. About the app: 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/tox.ini b/tox.ini index 50afb64..48446ff 100644 --- a/tox.ini +++ b/tox.ini @@ -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,12 +29,9 @@ 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.x + 5.0: Django==5.0.x master: https://github.com/django/django/archive/master.tar.gz psycopg2-binary==2.9.5 coverage From 0eb3d16472fda44f160bddfd01f1436b77a6069b Mon Sep 17 00:00:00 2001 From: Jan Pieter Waagmeester Date: Thu, 11 Apr 2024 21:16:13 +0200 Subject: [PATCH 5/9] more --- .github/workflows/ci.yml | 2 +- README.md | 2 +- docs/index.rst | 2 +- example/requirements.txt | 4 ++-- test_migrations/requirements.txt | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22464c0..e6e9320 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,5 +70,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 30499b6..235976f 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Translates Django model fields in a `JSONField` using a registration approach. - Uses one PostgreSQL `jsonb`-field per model (via `django.db.models.JSONField`) - Django 4.2, 5.0 (with their supported python versions) -- PostgreSQL >= 13 and Psycopg2 >= 2.5.4. +- 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 4ac254d..a70cdc5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,7 +6,7 @@ django-modeltrans - Translate model fields using a `JSONField` - Uses one `django.db.models.JSONField` (PostgreSQL JSONB field) for every record. - Django Django 4.2, 5.0 (with their supported python versions) -- PostgreSQL >= 13 and Psycopg2 >= 2.5.4. +- PostgreSQL >= 13 and the appropriate `psycopg` version for your Django version About the app: 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/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 From 9e713cd22f3ebe316c943d566f759dc317b2efb7 Mon Sep 17 00:00:00 2001 From: Jan Pieter Waagmeester Date: Thu, 11 Apr 2024 21:26:55 +0200 Subject: [PATCH 6/9] Simpler --- .github/workflows/ci.yml | 2 +- example/example/settings.py | 18 +++++++++--------- test_migrations/migrate_test/settings.py | 2 +- tests/app/settings.py | 14 +++++++------- tox.ini | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6e9320..eb9ac63 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ 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.6.4 - run: isort --diff --check . tests: 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/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/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 48446ff..4af777d 100644 --- a/tox.ini +++ b/tox.ini @@ -33,7 +33,7 @@ deps = 4.2: Django==4.2.x 5.0: Django==5.0.x master: https://github.com/django/django/archive/master.tar.gz - psycopg2-binary==2.9.5 + psycopg coverage [testenv:migrate] From f94cc4f054d32e111ce9bb7f63e6eec7c363f586 Mon Sep 17 00:00:00 2001 From: Jan Pieter Waagmeester Date: Fri, 12 Apr 2024 09:59:46 +0200 Subject: [PATCH 7/9] An attempt to fix tox.ini too --- .github/workflows/ci.yml | 2 +- docs/requirements.txt | 1 + tox.ini | 29 ++++++++++++++--------------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb9ac63..113e657 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: steps: - uses: actions/setup-python@v5.1.0 - uses: actions/checkout@v4 - - run: python -m pip install psycopg isort==5.6.4 + - run: python -m pip install psycopg isort==5.13.2 - run: isort --diff --check . tests: 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/tox.ini b/tox.ini index 4af777d..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, @@ -29,9 +29,8 @@ setenv = commands = coverage run ./manage.py test --no-input deps = - - 4.2: Django==4.2.x - 5.0: Django==5.0.x + 4.2: Django==4.2.* + 5.0: Django==5.0.* master: https://github.com/django/django/archive/master.tar.gz psycopg coverage @@ -41,7 +40,7 @@ setenv = PYTHONPATH={toxinidir} PYTHONDONTWRITEBYTECODE=1 COVERAGE_FILE=../.coverage -basepython = python3.7 +basepython = python3.11 recreate = true skip_install = true deps = coverage @@ -50,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 @@ -68,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] @@ -83,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 @@ -95,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 . From 29578a872ae4a0d419b52c6daf1d99df73b139b3 Mon Sep 17 00:00:00 2001 From: Jan Pieter Waagmeester Date: Fri, 12 Apr 2024 10:01:37 +0200 Subject: [PATCH 8/9] Also build docs in CI --- .github/workflows/ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 113e657..c535716 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,13 @@ jobs: - uses: actions/checkout@v4 - 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: From 73fe953c53b0c020f44eb77331c3afac33b955cb Mon Sep 17 00:00:00 2001 From: Jan Pieter Waagmeester Date: Fri, 12 Apr 2024 10:45:00 +0200 Subject: [PATCH 9/9] spaces --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c535716..eb08c3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,7 @@ jobs: - uses: actions/checkout@v4 - run: python -m pip install psycopg isort==5.13.2 - run: isort --diff --check . + docs: runs-on: ubuntu-latest steps: @@ -31,6 +32,7 @@ jobs: - 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: