From 8f32a2814253eff26a8986e2f1b5d99f8901c1c6 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sat, 13 Jan 2024 15:33:39 -0500 Subject: [PATCH 1/5] Support Django 4.1, 4.2 and Python 3.11 (#485) * Support Django 4.1 and 4.2 and Python 3.11 * Upgrade to tox 4 * Update precommit isort * Suppress linting on Python 3.7 --- .github/workflows/build.yml | 7 +++++-- .pre-commit-config.yaml | 2 +- dbbackup/tests/test_storage.py | 6 +++++- requirements/build.txt | 2 +- requirements/tests.txt | 2 +- setup.py | 3 +++ tox.ini | 17 ++++++++++------- 7 files changed, 26 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4115766f..82b8aae2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -24,7 +24,10 @@ jobs: python -m pip install --upgrade pip python -m pip install -r requirements/tests.txt python -m pip install -r requirements.txt - - name: Linting + # TODO: Remove this conditional when Python 3.7 is dropped and Flake8 executes on + # all Python versions in matrix. + - if: matrix.python-version == '3.8' + name: Linting run: flake8 # Environments are selected using tox-gh-actions configuration in tox.ini. - name: Test with tox diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 50944fbd..d79957ab 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: hooks: - id: yesqa - repo: https://github.com/pycqa/isort - rev: "5.10.1" + rev: "5.12.0" hooks: - id: isort args: ["--profile", "black"] diff --git a/dbbackup/tests/test_storage.py b/dbbackup/tests/test_storage.py index e9b38558..e5ba32fb 100644 --- a/dbbackup/tests/test_storage.py +++ b/dbbackup/tests/test_storage.py @@ -23,7 +23,11 @@ def test_set_path(self): @patch("dbbackup.settings.STORAGE", DEFAULT_STORAGE_PATH) def test_set_options(self, *args): storage = get_storage(options=STORAGE_OPTIONS) - self.assertEqual(storage.storage.__module__, "django.core.files.storage") + self.assertIn( + storage.storage.__module__, + # TODO: Remove "django.core.files.storage" case when dropping support for Django < 4.2. + ("django.core.files.storage", "django.core.files.storage.filesystem"), + ) class StorageTest(TestCase): diff --git a/requirements/build.txt b/requirements/build.txt index 82e745cf..b1434cfc 100644 --- a/requirements/build.txt +++ b/requirements/build.txt @@ -1,5 +1,5 @@ build setuptools -tox +tox>=4.0.0 twine wheel diff --git a/requirements/tests.txt b/requirements/tests.txt index e975d619..a189f4c9 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -9,5 +9,5 @@ python-dotenv python-gnupg>=0.5.0 pytz testfixtures -tox +tox>=4.0.0 tox-gh-actions diff --git a/setup.py b/setup.py index ce7fc362..82ed9e67 100644 --- a/setup.py +++ b/setup.py @@ -51,6 +51,8 @@ def get_test_requirements(): "Framework :: Django :: 2.2", "Framework :: Django :: 3.2", "Framework :: Django :: 4.0", + "Framework :: Django :: 4.1", + "Framework :: Django :: 4.2", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: BSD License", @@ -61,6 +63,7 @@ def get_test_requirements(): "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Topic :: Database", "Topic :: System :: Archiving", "Topic :: System :: Archiving :: Backup", diff --git a/tox.ini b/tox.ini index da3732f2..68e6b0c7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{37,38,39}-django22,py{37,38,39,310}-django{32,40,master},lint,docs,functional +envlist = py{37,38,39}-django22,py{37,38,39,310,311}-django{32,40,41,42,master},lint,docs,functional [testenv] passenv = * @@ -10,6 +10,8 @@ deps = django22: django>=2.2,<2.3 django32: django>=3.2,<3.3 django40: django>=4.0,<4.1 + django41: django>=4.1,<4.2 + django42: django>=4.2,<4.3 djangomaster: https://github.com/django/django/archive/master.zip commands = {posargs:coverage run runtests.py} @@ -17,9 +19,10 @@ commands = {posargs:coverage run runtests.py} [gh-actions] python = 3.7: py37-django{22,32},functional - 3.8: py38-django{22,32,40},functional - 3.9: py39-django{22,32,40},functional - 3.10: py310-django{22,32,40},functional + 3.8: py38-django{22,32,40,41,42},functional + 3.9: py39-django{22,32,40,41,42},functional + 3.10: py310-django{22,32,40,41,42},functional + 3.11: py311-django{40,41,42},functional [testenv:lint] basepython = python @@ -29,14 +32,14 @@ commands = prospector dbbackup -0 [testenv:docs] basepython = python -whitelist_externals=make +allowlist_externals=make deps = -rrequirements/docs.txt commands = make docs [testenv:functional] basepython = python passenv = * -whitelist_externals = bash +allowlist_externals = bash deps = -rrequirements/tests.txt django @@ -48,7 +51,7 @@ commands = {posargs:bash -x functional.sh} [testenv:functional-mongodb] basepython = python passenv = * -whitelist_externals = bash +allowlist_externals = bash deps = -rrequirements/tests.txt djongo From feade1fbb4212a2db1e4e9d1824798619957920c Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sat, 13 Jan 2024 19:50:46 -0500 Subject: [PATCH 2/5] Support Python 3.12 and Django 5.0 (#499) * Support Python 3.12 * Support Django 5.0 --- .github/workflows/build.yml | 2 +- setup.py | 2 ++ tox.ini | 8 +++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 82b8aae2..53d5f6e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/setup.py b/setup.py index 82ed9e67..395b6a46 100644 --- a/setup.py +++ b/setup.py @@ -53,6 +53,7 @@ def get_test_requirements(): "Framework :: Django :: 4.0", "Framework :: Django :: 4.1", "Framework :: Django :: 4.2", + "Framework :: Django :: 5.0", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: BSD License", @@ -64,6 +65,7 @@ def get_test_requirements(): "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Database", "Topic :: System :: Archiving", "Topic :: System :: Archiving :: Backup", diff --git a/tox.ini b/tox.ini index 68e6b0c7..89cc8965 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{37,38,39}-django22,py{37,38,39,310,311}-django{32,40,41,42,master},lint,docs,functional +envlist = py{37,38,39}-django22,py{37,38,39,310,311,312}-django{32,40,41,42,50,master},lint,docs,functional [testenv] passenv = * @@ -12,6 +12,7 @@ deps = django40: django>=4.0,<4.1 django41: django>=4.1,<4.2 django42: django>=4.2,<4.3 + django50: django>=5.0,<5.1 djangomaster: https://github.com/django/django/archive/master.zip commands = {posargs:coverage run runtests.py} @@ -21,8 +22,9 @@ python = 3.7: py37-django{22,32},functional 3.8: py38-django{22,32,40,41,42},functional 3.9: py39-django{22,32,40,41,42},functional - 3.10: py310-django{22,32,40,41,42},functional - 3.11: py311-django{40,41,42},functional + 3.10: py310-django{22,32,40,41,42,50},functional + 3.11: py311-django{40,41,42,50},functional + 3.12: py312-django{42,50},functional [testenv:lint] basepython = python From 6083171f2b5373e7f5a06fb6a95b630c83e53be3 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sun, 14 Jan 2024 19:13:26 -0500 Subject: [PATCH 3/5] Release 4.1.0 (#500) --- dbbackup/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbbackup/VERSION b/dbbackup/VERSION index 4d54dadd..ee74734a 100644 --- a/dbbackup/VERSION +++ b/dbbackup/VERSION @@ -1 +1 @@ -4.0.2 +4.1.0 From d6c7a8900828fd78d9d88a862d64f7df653b4902 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Mon, 15 Jan 2024 06:52:11 -0500 Subject: [PATCH 4/5] Drop support for end of life Django releases (#501) --- .github/ISSUE_TEMPLATE/bug_report.md | 6 +++--- docs/index.rst | 2 +- requirements.txt | 2 +- setup.py | 3 --- tox.ini | 15 ++++++--------- 5 files changed, 11 insertions(+), 17 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 579cf09a..8b16233a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -26,10 +26,10 @@ If applicable, add screenshots (errors, example of the behavior, etc.) to help e ## Versions ### Django-dbbackup -- pypi: [e.g. 3.3.0] +- pypi: [e.g. 4.1.0] ### External tools -- Python: [e.g. 3.7] -- Django: [e.g. 2.2.0] +- Python: [e.g. 3.8] +- Django: [e.g. 4.2.0] - OS: [Linux, MacOS, Windows] diff --git a/docs/index.rst b/docs/index.rst index 93c23370..236dcdb0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -42,7 +42,7 @@ Compatibility As we want to ensure a lot of platforms will be able to save data before upgrading, Django-DBBackup supports PyPy, 3.2 to 3.5 and Django -greater than 2.2 +greater than 3.2. Other Resources =============== diff --git a/requirements.txt b/requirements.txt index 8053d290..b39b5e0c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -django>=2.2 +django>=3.2 pytz diff --git a/setup.py b/setup.py index 395b6a46..c60490c2 100644 --- a/setup.py +++ b/setup.py @@ -48,10 +48,7 @@ def get_test_requirements(): "Development Status :: 4 - Beta", "Environment :: Web Environment", "Environment :: Console", - "Framework :: Django :: 2.2", "Framework :: Django :: 3.2", - "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 89cc8965..bafe8999 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{37,38,39}-django22,py{37,38,39,310,311,312}-django{32,40,41,42,50,master},lint,docs,functional +envlist = py{37,38,39,310,311,312}-django{32,42,50,master},lint,docs,functional [testenv] passenv = * @@ -7,10 +7,7 @@ setenv = PYTHONDONTWRITEBYTECODE=1 deps = -rrequirements/tests.txt - django22: django>=2.2,<2.3 django32: django>=3.2,<3.3 - django40: django>=4.0,<4.1 - django41: django>=4.1,<4.2 django42: django>=4.2,<4.3 django50: django>=5.0,<5.1 djangomaster: https://github.com/django/django/archive/master.zip @@ -19,11 +16,11 @@ commands = {posargs:coverage run runtests.py} # Configure which test environments are run for each Github Actions Python version. [gh-actions] python = - 3.7: py37-django{22,32},functional - 3.8: py38-django{22,32,40,41,42},functional - 3.9: py39-django{22,32,40,41,42},functional - 3.10: py310-django{22,32,40,41,42,50},functional - 3.11: py311-django{40,41,42,50},functional + 3.7: py37-django{32},functional + 3.8: py38-django{32,42},functional + 3.9: py39-django{32,42},functional + 3.10: py310-django{32,42,50},functional + 3.11: py311-django{42,50},functional 3.12: py312-django{42,50},functional [testenv:lint] From 276191c016434f57691761dca6327d81cf05a18f Mon Sep 17 00:00:00 2001 From: Mark Bakhit Date: Mon, 15 Jan 2024 15:52:03 -0800 Subject: [PATCH 5/5] New templates for issues, features, & PRs (#502) --- .github/ISSUE_TEMPLATE/bug-report.yml | 22 ++++++++++++++ .github/ISSUE_TEMPLATE/bug_report.md | 35 ---------------------- .github/ISSUE_TEMPLATE/feature-request.yml | 16 ++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 24 --------------- .github/PULL_REQUEST_TEMPLATE.md | 17 +++++------ 5 files changed, 46 insertions(+), 68 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug-report.yml delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature-request.yml delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 00000000..e911e842 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,22 @@ +name: Bug Report +description: Create a report to help us improve. +labels: ["bug"] +body: + - type: textarea + attributes: + label: Current Situation + description: Discuss what the current issue is, how to reproduce, and link to any relevant prior discussion/context. + validations: + required: true + - type: textarea + attributes: + label: Proposed Actions + description: Describe what ought to be done, and why that will address the reasons for action mentioned above. + validations: + required: false + - type: textarea + attributes: + label: System Information + description: Versions for things such as... Django-dbbackup, Python, Django, Operating System, etc. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 8b16233a..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve ---- - -# Bug Report - -_Please help us help you by filling out any applicable information in this template and removing the rest!_ - -## Describe the bug - -A clear and concise description of what the bug is. - -## To Reproduce - -Steps to reproduce the behavior - -## Expected behavior - -A clear and concise description of what you expected to happen. - -## Screenshots or reproduction - -If applicable, add screenshots (errors, example of the behavior, etc.) to help explain your problem or post a link to a repository that replicates the issue. - -## Versions - -### Django-dbbackup -- pypi: [e.g. 4.1.0] - -### External tools - -- Python: [e.g. 3.8] -- Django: [e.g. 4.2.0] -- OS: [Linux, MacOS, Windows] diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 00000000..7d7a4084 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,16 @@ +name: Feature request +description: Suggest an idea for this project. +labels: ["feature-request"] +body: + - type: textarea + attributes: + label: Feature description + description: Describe what the feature is, why it is needed, and link any relevant prior discussion/context. + validations: + required: true + - type: textarea + attributes: + label: Alternatives options + description: Describe any alternatives to this feature, and why they were not chosen. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 49c3a9cc..00000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project ---- - -# Feature Request - -_Please help us help you by filling out any applicable information in this template and removing the rest!_ - -## Is your feature request related to a problem? - -A clear and concise description of what the problem is. If this is a bug, please open a bug report instead of a feature request! - -## Describe the solution you'd like - -A clear and concise description of what you want to happen. Please also include alternative solutions or features you've considered. - -## Additional context - -Add any other context or screenshots about the feature request here. - -## PR link - -If you have opened a pull request to address the issue, please link it here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 11f99dc1..a5553200 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,15 +1,14 @@ -# Type of PR (feature, enhancement, bug fix, etc.) - ## Description -Please include a summary of the change and which issue is fixed. - -Fixes # (issue) + -## Why should this be added +## Checklist -Explain value. +Please update this checklist as you complete each item: -## Checklist +- [ ] Tests have been developed for bug fixes or new functionality. +- [ ] The changelog has been updated, if necessary. +- [ ] Documentation has been updated, if necessary. +- [ ] GitHub Issues closed by this PR have been linked. -- [ ] Documentation has been added or amended for this feature / update +By submitting this pull request I agree that all contributions comply with this project's open source license(s).