From b4860568022edf8016985cd8346e85f5b6f46edb Mon Sep 17 00:00:00 2001 From: Sergei Iurchenko Date: Sat, 11 Mar 2023 17:58:13 +0300 Subject: [PATCH] fix_ci (#512) * fix_ci Co-authored-by: Iurchenko Sergei --- .github/workflows/release.yml | 6 +++--- .github/workflows/test.yml | 12 ++++++------ docs/changes.rst | 2 ++ example/cheeseshop/settings.py | 16 +++++++--------- example/cheeseshop/urls.py | 5 ++--- example/cheeseshop/wsgi.py | 9 --------- example/requirements.txt | 4 ++-- setup.py | 7 ++----- test_threads.py | 0 tox.ini | 18 +++++++++--------- 10 files changed, 33 insertions(+), 46 deletions(-) delete mode 100644 test_threads.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9e6f7fe..78783a3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,12 +11,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.8 @@ -26,7 +26,7 @@ jobs: echo "::set-output name=dir::$(pip cache dir)" - name: Cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.pip-cache.outputs.dir }} key: release-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/tox.ini') }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9f1ec1e..9af429a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,13 +9,13 @@ jobs: fail-fast: false max-parallel: 5 matrix: - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.8'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy-3.8'] 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 }} @@ -25,7 +25,7 @@ jobs: echo "::set-output name=dir::$(pip cache dir)" - name: Cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.pip-cache.outputs.dir }} key: @@ -36,13 +36,13 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install --upgrade tox tox-gh-actions + python -m pip install --upgrade 'tox<4' tox-gh-actions - name: Tox tests run: | tox -v - name: Upload coverage - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 with: name: Python ${{ matrix.python-version }} diff --git a/docs/changes.rst b/docs/changes.rst index 72a3452..3d57332 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -7,6 +7,8 @@ v3.0.0 (future) * Refactor database backend Backward incompatible changes: remove 'constance.backends.database' from INSTALLED_APPS +* Dropped support for python < 3.7 and django < 3.2 +* Example app now supports django 4.1 v2.10.0 (unreleased) ~~~~~~~~~~~~~~~~~~ diff --git a/example/cheeseshop/settings.py b/example/cheeseshop/settings.py index e71fd47..101f93e 100644 --- a/example/cheeseshop/settings.py +++ b/example/cheeseshop/settings.py @@ -1,13 +1,11 @@ """ Django settings for cheeseshop project. -Generated by 'django-admin startproject' using Django 1.8.14. - For more information on this file, see -https://docs.djangoproject.com/en/1.8/topics/settings/ +https://docs.djangoproject.com/en/4.1/topics/settings/ For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.8/ref/settings/ +https://docs.djangoproject.com/en/4.1/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) @@ -18,7 +16,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ +# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/ SITE_ID = 1 @@ -76,7 +74,7 @@ WSGI_APPLICATION = 'cheeseshop.wsgi.application' # Database -# https://docs.djangoproject.com/en/1.8/ref/settings/#databases +# https://docs.djangoproject.com/en/4.1/ref/settings/#databases DATABASES = { 'default': { @@ -124,14 +122,14 @@ CONSTANCE_BACKEND = 'constance.backends.database.DatabaseBackend' CACHES = { 'default': { - 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', + 'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache', 'LOCATION': '127.0.0.1:11211', } } CONSTANCE_DATABASE_CACHE_BACKEND = 'default' # Internationalization -# https://docs.djangoproject.com/en/1.8/topics/i18n/ +# https://docs.djangoproject.com/en/4.1/topics/i18n/ LANGUAGE_CODE = 'en-us' @@ -145,7 +143,7 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/1.8/howto/static-files/ +# https://docs.djangoproject.com/en/4.1/howto/static-files/ STATIC_URL = '/static/' diff --git a/example/cheeseshop/urls.py b/example/cheeseshop/urls.py index d683d63..d34ee72 100644 --- a/example/cheeseshop/urls.py +++ b/example/cheeseshop/urls.py @@ -1,14 +1,13 @@ -from django.conf.urls import url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin from django.conf import settings -from django.urls import path +from django.urls import re_path admin.autodiscover() urlpatterns = [ - path('admin/', admin.site.urls), + re_path('admin/', admin.site.urls), ] if settings.DEBUG: diff --git a/example/cheeseshop/wsgi.py b/example/cheeseshop/wsgi.py index 0c51c97..96a17c4 100644 --- a/example/cheeseshop/wsgi.py +++ b/example/cheeseshop/wsgi.py @@ -1,12 +1,3 @@ -""" -WSGI config for cheeseshop project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ -""" - import os from django.core.wsgi import get_wsgi_application diff --git a/example/requirements.txt b/example/requirements.txt index 69a82a7..a39f83c 100644 --- a/example/requirements.txt +++ b/example/requirements.txt @@ -1,2 +1,2 @@ -Django>=2.2 -python-memcached +Django>=3.2 +pymemcache diff --git a/setup.py b/setup.py index 0472042..47e2a20 100644 --- a/setup.py +++ b/setup.py @@ -34,9 +34,6 @@ setup( 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', - 'Framework :: Django :: 2.2', - 'Framework :: Django :: 3.0', - 'Framework :: Django :: 3.1', 'Framework :: Django :: 3.2', 'Framework :: Django :: 4.0', 'Framework :: Django :: 4.1', @@ -46,11 +43,11 @@ setup( 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3 :: Only', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', @@ -59,7 +56,7 @@ setup( packages=find_packages(exclude=['tests', 'tests.*']), include_package_data=True, zip_safe=False, - python_requires='>=3.6', + python_requires='>=3.7', install_requires=[ 'django-picklefield', ], diff --git a/test_threads.py b/test_threads.py deleted file mode 100644 index e69de29..0000000 diff --git a/tox.ini b/tox.ini index 6101b30..600099e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,20 +1,20 @@ [tox] +requires = + tox<4 envlist = - py{36,37,38,39,py3}-dj{22,30,31,32}-{unittest,pytest} - py{38,39,310}-dj{40,41,main}-{unittest,pytest} - py310-dj32-{unittest,pytest} - + py{37,38,39,310,py3}-dj{32}-{unittest,pytest} + py{38,39,310}-dj{40}-{unittest,pytest} + py{38,39,310,311}-dj{41}-{unittest,pytest} + py{310,311}-dj{main}-{unittest,pytest} + [testenv] deps = redis coverage django-picklefield - dj22: Django>=2.2,<3.0 - dj30: Django>=3.0,<3.1 - dj31: Django>=3.1,<3.2 dj32: Django>=3.2,<4 dj40: Django>=4.0,<4.1 - dj41: Django>=4.1b1,<4.2 + dj41: Django>=4.1,<4.2 djmain: https://github.com/django/django/archive/main.tar.gz pytest: pytest pytest: pytest-cov @@ -33,9 +33,9 @@ setenv = [gh-actions] python = - 3.6: py36 3.7: py37 3.8: py38 3.9: py39 3.10: py310 + 3.11: py311 pypy-3: pypy3