From caad6f9e35b5abaab6e2ad23c6466f7027c11a53 Mon Sep 17 00:00:00 2001 From: Marco Bonetti Date: Mon, 4 Dec 2023 16:48:07 +0100 Subject: [PATCH] preparing v0.10.0 --- .github/workflows/test.yml | 2 +- CHANGES | 5 +++-- docs/conf.py | 2 +- pyproject.toml | 2 +- rosetta/__init__.py | 10 +--------- rosetta/tests/tests.py | 3 ++- setup.py | 13 +++++-------- testproject/settings.py | 31 +++++++++---------------------- tox.ini | 14 +++++++------- 9 files changed, 30 insertions(+), 52 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8239350..94d03fe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.8, 3.9, "3.10"] + python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v1 diff --git a/CHANGES b/CHANGES index fdd8272..0b561af 100644 --- a/CHANGES +++ b/CHANGES @@ -1,10 +1,11 @@ Version History =============== -Version 0.9.10 (unreleased) ---------------------------- +Version 0.10.0 +-------------- * Fix link to polib. (#277, thanks @gamboz) * Deepl: use the PRO API endpoint when using a PRO API key. (#278, thanks @nullcode) +* Limit supported versions to Django 4.2 and 5.0, using Python 3.9, 3.10, 3.11 and 3.12 Version 0.9.9 diff --git a/docs/conf.py b/docs/conf.py index e21eca1..b62f5ae 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -73,7 +73,7 @@ release = get_version() # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = "en" # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: diff --git a/pyproject.toml b/pyproject.toml index 9a9c3de..7e03953 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ order_by_type = true known_django = "django" known_django_third_party = "django_*" known_first_party = "apps,rosetta" -sections = "FUTURE,STDLIB,THIRDPARTY,DJANGO,DJANGO_THIRD_PARTY,REST_FRAMEWORK,FIRSTPARTY,LOCALFOLDER" +sections = "FUTURE,STDLIB,THIRDPARTY,DJANGO,DJANGO_THIRD_PARTY,FIRSTPARTY,LOCALFOLDER" skip_glob= "**/migrations/**" diff --git a/rosetta/__init__.py b/rosetta/__init__.py index 6c5b9d3..ab09801 100644 --- a/rosetta/__init__.py +++ b/rosetta/__init__.py @@ -1,12 +1,4 @@ -try: - import django - - if django.VERSION[:3] <= (3, 2, 0): - default_app_config = "rosetta.apps.RosettaAppConfig" -except ImportError: - pass - -VERSION = (0, 9, 10) +VERSION = (0, 10, 0) def get_version(limit=3): diff --git a/rosetta/tests/tests.py b/rosetta/tests/tests.py index f1d43aa..ece2fc6 100644 --- a/rosetta/tests/tests.py +++ b/rosetta/tests/tests.py @@ -5,6 +5,8 @@ import shutil from unittest import mock from urllib.parse import urlencode +import vcr + from django import VERSION from django.conf import settings from django.core.exceptions import ImproperlyConfigured @@ -15,7 +17,6 @@ from django.test.client import Client from django.urls import resolve, reverse from django.utils.encoding import force_bytes -import vcr from rosetta import views from rosetta.poutil import find_pos from rosetta.signals import entry_changed, post_save diff --git a/setup.py b/setup.py index e8a1cf4..ec01032 100644 --- a/setup.py +++ b/setup.py @@ -52,19 +52,16 @@ setup( "Topic :: Software Development :: Localization", "Topic :: Software Development :: Internationalization", "Framework :: Django", - "Framework :: Django :: 3.0", - "Framework :: Django :: 3.1", - "Framework :: Django :: 3.2", - "Framework :: Django :: 4.0", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", + "Framework :: Django :: 4.2", + "Framework :: Django :: 5.0", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ], include_package_data=True, zip_safe=False, - install_requires=["Django >= 2.2", "requests >= 2.1.0", "polib >= 1.1.0"], + install_requires=["Django >= 4.2", "requests >= 2.30.0", "polib >= 1.1.0"], tests_require=["tox", "vcrpy"], cmdclass={"test": Tox}, ) diff --git a/testproject/settings.py b/testproject/settings.py index 0276dd3..c45aa7a 100644 --- a/testproject/settings.py +++ b/testproject/settings.py @@ -1,8 +1,6 @@ import os import sys -import django - SITE_ID = 1 @@ -17,22 +15,13 @@ DATABASES = { } } -if django.VERSION[:3] >= (3, 2, 0): - CACHES = { - "default": { - "BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache", - "LOCATION": "127.0.0.1:11211", - "KEY_PREFIX": "ROSETTA_TEST", - } - } -else: - CACHES = { - "default": { - "BACKEND": "django.core.cache.backends.memcached.MemcachedCache", - "LOCATION": "127.0.0.1:11211", - "KEY_PREFIX": "ROSETTA_TEST", - } +CACHES = { + "default": { + "BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache", + "LOCATION": "127.0.0.1:11211", + "KEY_PREFIX": "ROSETTA_TEST", } +} # CACHES = {'default': {'BACKEND': 'django.core.cache.backends.dummy.DummyCache'}} @@ -52,11 +41,9 @@ INSTALLED_APPS = [ "django.contrib.sites", "django.contrib.messages", "rosetta", + "rosetta.tests.test_app.apps.TestAppConfig", ] -if django.VERSION[0:2] >= (1, 7): - INSTALLED_APPS.append("rosetta.tests.test_app.apps.TestAppConfig") - LANGUAGE_CODE = "en" MIDDLEWARE = ( @@ -84,8 +71,6 @@ SILENCED_SYSTEM_CHECKS = ["translation.E002"] LOCALE_PATHS = [os.path.join(PROJECT_PATH, "locale")] -SOUTH_TESTS_MIGRATE = False - FIXTURE_DIRS = (os.path.join(PROJECT_PATH, "fixtures"),) STATIC_URL = "/static/" ROOT_URLCONF = "testproject.urls" @@ -112,6 +97,8 @@ TEMPLATES = [ } ] +USE_TZ = True + STATIC_URL = "/static/" # SESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies" diff --git a/tox.ini b/tox.ini index 6bdf633..dd04665 100644 --- a/tox.ini +++ b/tox.ini @@ -1,16 +1,18 @@ [tox] envlist = flake8, - py{38,39,310}-django{32,40,41,42}, + py{38,39,310}-django42, + py{310,311,312}-django50, gettext, docs [gh-actions] python = - 3.10: py310-django32, py310-django40, py310-django41, py310-django42 - 3.9: py39-django32, py39-django40, py39-django41, py39-django42 - 3.8: py38-django32, py38-django40, py38-django41, py38-django42 + 3.12: py312-django50 + 3.11: py311-django42, py311-django50 + 3.10: py310-django42, py310-django50 + 3.9: py39-django42 skipsdist = True @@ -27,10 +29,8 @@ setenv = PYTHONDONTWRITEBYTECODE=1 deps = - django32: Django>=3.2,<=3.2.99 - django40: Django>=4.0,<4.1 - django41: Django>=4.1a,<4.2 django42: Django>=4.2a,<4.3 + django50: Django>=5.0,<5.1 pymemcache requests