From bd0b095cd97270bc7b0093285fa42fe023417c66 Mon Sep 17 00:00:00 2001 From: Sumanth Ratna Date: Mon, 7 Dec 2020 18:06:58 -0500 Subject: [PATCH 01/18] Update CHANGELOG --- docs/changelog.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index f456b0d1..0739d8f5 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,6 +4,10 @@ Changelog Unreleased ----------- * Replace ugettext_lazy with gettext_lazy `#342`_ +* Changed logging settings from settings.py to late init `#332`_ +* Fix authentication error when postgres is password protected `#361`_ +* Use exclude-table-data instead of exclude-table `#363`_ +* Add support for exclude tables data in the command interface `#375`_ * Documentation fixes `#341`_ `#333`_ `#349`_ `#348`_ `#337`_ @@ -21,6 +25,10 @@ Unreleased * Quick fix for proper selection of DB name to restore `#260`_ .. _`#342`: https://github.com/django-dbbackup/django-dbbackup/pull/342 +.. _`#332`: https://github.com/django-dbbackup/django-dbbackup/pull/332 +.. _`#361`: https://github.com/django-dbbackup/django-dbbackup/pull/361 +.. _`#363`: https://github.com/django-dbbackup/django-dbbackup/pull/363 +.. _`#375`: https://github.com/django-dbbackup/django-dbbackup/pull/375 .. _`#341`: https://github.com/django-dbbackup/django-dbbackup/pull/341 .. _`#333`: https://github.com/django-dbbackup/django-dbbackup/pull/333 .. _`#328`: https://github.com/django-dbbackup/django-dbbackup/pull/328 From 9d1909c30a3271c8c9c8450add30d6e0b996e145 Mon Sep 17 00:00:00 2001 From: Ajay saini <36501961+Ajaysainisd@users.noreply.github.com> Date: Fri, 25 Dec 2020 23:09:41 +0530 Subject: [PATCH 02/18] =?UTF-8?q?auth=20source=20added=20in=20mongodb.=20a?= =?UTF-8?q?uthentication=20issue=20fixed=20with=20mongodb=E2=80=A6=20(#379?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * auth source added in mongodb. authentication issue fixed with mongodb connections * unused utils import removed in db/postgresql.py * Documentation added for auth enabled mongoDB Connection Co-authored-by: Ajay Saini --- dbbackup/db/mongodb.py | 4 ++++ dbbackup/db/postgresql.py | 1 - docs/databases.rst | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/dbbackup/db/mongodb.py b/dbbackup/db/mongodb.py index 0a38e472..5b318964 100644 --- a/dbbackup/db/mongodb.py +++ b/dbbackup/db/mongodb.py @@ -21,6 +21,8 @@ def _create_dump(self): cmd += ' --username {}'.format(self.settings['USER']) if self.settings.get('PASSWORD'): cmd += ' --password {}'.format(utils.get_escaped_command_arg(self.settings['PASSWORD'])) + if self.settings.get('AUTH_SOURCE'): + cmd += ' --authenticationDatabase {}'.format(self.settings['AUTH_SOURCE']) for collection in self.exclude: cmd += ' --excludeCollection {}'.format(collection) cmd += ' --archive' @@ -37,6 +39,8 @@ def _restore_dump(self, dump): cmd += ' --username {}'.format(self.settings['USER']) if self.settings.get('PASSWORD'): cmd += ' --password {}'.format(utils.get_escaped_command_arg(self.settings['PASSWORD'])) + if self.settings.get('AUTH_SOURCE'): + cmd += ' --authenticationDatabase {}'.format(self.settings['AUTH_SOURCE']) if self.object_check: cmd += ' --objcheck' if self.drop: diff --git a/dbbackup/db/postgresql.py b/dbbackup/db/postgresql.py index d263e4ea..89707ca0 100644 --- a/dbbackup/db/postgresql.py +++ b/dbbackup/db/postgresql.py @@ -1,7 +1,6 @@ from urllib.parse import quote import logging -from dbbackup import utils from .base import BaseCommandDBConnector from .exceptions import DumpError diff --git a/docs/databases.rst b/docs/databases.rst index 7bab7dfa..3174b8f8 100644 --- a/docs/databases.rst +++ b/docs/databases.rst @@ -197,6 +197,25 @@ MongoDB MongoDB uses by default :class:`dbbackup.db.mongodb.MongoDumpConnector`. it uses ``mongodump`` and ``mongorestore`` for its job. +For AuthEnabled MongoDB Connection, you need to add one custom option ``AUTH_SOURCE`` in your ``DBBACKUP_CONNECTORS``. :: + + DBBACKUP_CONNECTORS = { + 'default': { + ... + 'AUTH_SOURCE': 'admin', + } + } + +Or in ``DATABASES`` one: :: + + DATABASES = { + 'default': { + ... + 'AUTH_SOURCE': 'admin', + } + } + + OBJECT_CHECK ~~~~~~~~~~~~ From 8ea0e20c701d935ec916bccfcd42c7d632509866 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sat, 23 Oct 2021 11:04:47 -0400 Subject: [PATCH 03/18] Add support for Python 3.9-3.10 and Django 3.2 --- tox.ini | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index f1ebf6bb..a7821558 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{3.6,3.7,3.8,nightly}-django2.2,py{3.6,3.7,3.8,nightly}-django{3.0,master},lint,docs,functional +envlist = py{3.6,3.7,3.8,nightly}-django2.2,py{3.6,3.7,3.8,3.9,3.10,nightly}-django{3.0,3.1,3.2,master},lint,docs,functional [testenv] passenv = * @@ -9,6 +9,8 @@ basepython = py3.6: python3.6 py3.7: python3.7 py3.8: python3.8 + py3.9: python3.9 + py3.10: python3.10 pypypy: pypy pypypy3: pypy3 pynightly: python @@ -17,6 +19,7 @@ deps = django2.2: Django>=2.2,<2.3 django3.0: Django>=3.0,<3.1 django3.1: Django>=3.1,<3.2 + django3.2: Django>=3.2,<3.3 djangomaster: https://github.com/django/django/archive/master.zip commands = {posargs:coverage run runtests.py} @@ -25,6 +28,8 @@ python = 3.6: py36 3.7: py37 3.8: py38 + 3.9: py39 + 3.10: py310 [testenv:lint] basepython = python From 3fb05e442cbc60de81458847da4e0eafd0355ebf Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sat, 23 Oct 2021 11:06:55 -0400 Subject: [PATCH 04/18] Add Python 3.9-3.10 and Django 3.2 to test matrix --- .github/workflows/build.yml | 4 ++-- setup.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 52a356c9..89c5139c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,8 +12,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.6, 3.7, 3.8] - django: ["2.2", "3.0", "3.1"] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] + django: ["2.2", "3.0", "3.1", "3.2"] steps: - uses: actions/checkout@v2 diff --git a/setup.py b/setup.py index a70dc60c..c61a8ffd 100644 --- a/setup.py +++ b/setup.py @@ -46,6 +46,8 @@ def get_test_requirements(): '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', 'Topic :: Database', 'Topic :: System :: Archiving', 'Topic :: System :: Archiving :: Backup', From 55cb628d3e6dcc557af31baa0dafd64ae7bed05f Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sun, 19 Dec 2021 13:25:11 -0500 Subject: [PATCH 05/18] Clean up README --- .github/workflows/build.yml | 2 +- README.rst | 35 +++++++++++++---------------------- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 89c5139c..6489c134 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Running unittests +name: Lint and Unit Test on: push: diff --git a/README.rst b/README.rst index 7accfa10..0ce642bf 100644 --- a/README.rst +++ b/README.rst @@ -1,21 +1,16 @@ Django Database Backup ====================== -.. image:: https://api.travis-ci.org/django-dbbackup/django-dbbackup.svg - :target: https://travis-ci.org/django-dbbackup/django-dbbackup +.. image:: https://github.com/django-dbbackup/django-dbbackup/actions/workflows/build.yml/badge.svg + :target: https://github.com/django-dbbackup/django-dbbackup/actions -.. image:: https://readthedocs.org/projects/django-dbbackup/badge/?version=latest - :target: http://django-dbbackup.readthedocs.io/ +.. image:: https://readthedocs.org/projects/django-dbbackup/badge/?version=stable + :target: https://django-dbbackup.readthedocs.io/ :alt: Documentation Status .. image:: https://coveralls.io/repos/django-dbbackup/django-dbbackup/badge.svg?branch=master&service=github :target: https://coveralls.io/github/django-dbbackup/django-dbbackup?branch=master -.. image:: https://landscape.io/github/django-dbbackup/django-dbbackup/master/landscape.svg?style=flat - :target: https://landscape.io/github/django-dbbackup/django-dbbackup/master - :alt: Code Health - - This Django application provides management commands to help backup and restore your project database and media files with various storages such as Amazon S3, Dropbox, local file storage or any Django storage. @@ -31,7 +26,7 @@ It is made for: Docs ==== -See our offical documentation at `Read The Docs`_. +See our official documentation at `Read The Docs`_. Why use DBBackup ================ @@ -149,21 +144,17 @@ Contributing ============ All contribution are very welcomed, propositions, problems, bugs and -enhancement are tracked with `GitHub issues`_ system and patch are submitted +enhancement are tracked with `GitHub issues`_ system and patches are submitted via `pull requests`_. -We use `Travis`_ coupled with `Coveralls`_ as continious integration tools. +We use GitHub Actions as continuous integration tools. -.. _`Read The Docs`: http://django-dbbackup.readthedocs.org/ +.. _`Read The Docs`: https://django-dbbackup.readthedocs.org/ .. _`GitHub issues`: https://github.com/django-dbbackup/django-dbbackup/issues .. _`pull requests`: https://github.com/django-dbbackup/django-dbbackup/pulls -.. _Travis: https://travis-ci.org/django-dbbackup/django-dbbackup +.. _`GitHub Actions`: https://github.com/django-dbbackup/django-dbbackup/actions .. _Coveralls: https://coveralls.io/github/django-dbbackup/django-dbbackup - -.. image:: https://ga-beacon.appspot.com/UA-87461-7/django-dbbackup/home - :target: https://github.com/igrigorik/ga-beacon - Tests ===== @@ -182,7 +173,7 @@ are available. So you could launch: For get a Python shell configured with the test project. Also all test command options are available and usable for run only some chosen tests. -See `Django test command documentation`_ for more informations about it. +See `Django test command documentation`_ for more information about it. .. _`Django test command documentation`: https://docs.djangoproject.com/en/stable/topics/testing/overview/#running-tests @@ -201,11 +192,11 @@ can use Tox. Firstly install Tox: To run the tests just use the command ``tox`` in the command line. If you want to run the tests against just one specific test environment you can run -``tox -e ``. For example, to run the tests with Python3.3 and -Django1.9 you would run: +``tox -e ``. For example, to run the tests with Python3.9 and +Django3.2 you would run: :: - tox -e py3.3-django1.9 + tox -e py3.9-django3.2 The available test environments can be found in ``tox.ini``. From 1912e00ed9d060dadf5b98ffa3eb1ff160d4b5e9 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sun, 19 Dec 2021 13:32:54 -0500 Subject: [PATCH 06/18] Add support for Django 4.0 --- .github/workflows/build.yml | 2 +- tox.ini | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 89c5139c..78edfc18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] - django: ["2.2", "3.0", "3.1", "3.2"] + django: ["2.2", "3.0", "3.1", "3.2", "4.0"] steps: - uses: actions/checkout@v2 diff --git a/tox.ini b/tox.ini index a7821558..1a2c7f28 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{3.6,3.7,3.8,nightly}-django2.2,py{3.6,3.7,3.8,3.9,3.10,nightly}-django{3.0,3.1,3.2,master},lint,docs,functional +envlist = py{3.6,3.7,3.8,nightly}-django2.2,py{3.6,3.7,3.8,3.9,3.10,nightly}-django{3.0,3.1,3.2,4.0,master},lint,docs,functional [testenv] passenv = * @@ -20,6 +20,7 @@ deps = django3.0: Django>=3.0,<3.1 django3.1: Django>=3.1,<3.2 django3.2: Django>=3.2,<3.3 + django4.0: Django>=4.0,<4.1 djangomaster: https://github.com/django/django/archive/master.zip commands = {posargs:coverage run runtests.py} From 2d7151f5c2615517e6686576e1d53e0c89cfd549 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sun, 19 Dec 2021 13:41:00 -0500 Subject: [PATCH 07/18] Officially test under only active (non EOL) Django releases --- .github/workflows/build.yml | 10 +++------- requirements.txt | 2 +- tox.ini | 15 +++++++-------- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 78edfc18..e62034b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,8 +13,6 @@ jobs: strategy: matrix: python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] - django: ["2.2", "3.0", "3.1", "3.2", "4.0"] - steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -28,8 +26,6 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Linting run: flake8 - - name: Run unittests - env: - TOX_ENV: py${{ matrix.python-version}}-django${{ matrix.django }} - run: | - tox -e $TOX_ENV + # Environments are selected using tox-gh-actions configuration in tox.ini. + - name: Test with tox + run: tox diff --git a/requirements.txt b/requirements.txt index 895d3c64..076335e5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ pytz -Django>=1.5 +Django>=2.2 diff --git a/tox.ini b/tox.ini index 1a2c7f28..5d924bf1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{3.6,3.7,3.8,nightly}-django2.2,py{3.6,3.7,3.8,3.9,3.10,nightly}-django{3.0,3.1,3.2,4.0,master},lint,docs,functional +envlist = py{3.6,3.7,3.8,nightly}-django2.2,py{3.6,3.7,3.8,3.9,3.10,nightly}-django{3.2,4.0,master},lint,docs,functional [testenv] passenv = * @@ -17,20 +17,19 @@ basepython = deps = -rrequirements-tests.txt django2.2: Django>=2.2,<2.3 - django3.0: Django>=3.0,<3.1 - django3.1: Django>=3.1,<3.2 django3.2: Django>=3.2,<3.3 django4.0: Django>=4.0,<4.1 djangomaster: https://github.com/django/django/archive/master.zip commands = {posargs:coverage run runtests.py} +# Configure which test environments are run for each Github Actions Python version. [gh-actions] python = - 3.6: py36 - 3.7: py37 - 3.8: py38 - 3.9: py39 - 3.10: py310 + 3.6: py36-django{22,32} + 3.7: py37-django{22,32} + 3.8: py38-django{22,32,40} + 3.9: py39-django{22,32,40} + 3.10: py310-django{22,32,40} [testenv:lint] basepython = python From d8e7dc79863220c53c2db510aa346c728f9d9322 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sun, 19 Dec 2021 13:45:42 -0500 Subject: [PATCH 08/18] Set Python Requires and update trove classifiers --- setup.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index c61a8ffd..ba89185f 100644 --- a/setup.py +++ b/setup.py @@ -22,6 +22,7 @@ def get_test_requirements(): description=dbbackup.__doc__, author=dbbackup.__author__, author_email=dbbackup.__email__, + python_requires=">=3.6", install_requires=get_requirements(), tests_require=get_test_requirements(), license='BSD', @@ -32,17 +33,15 @@ def get_test_requirements(): 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Environment :: Console', - 'Framework :: Django', + 'Framework :: Django :: 2.2', + 'Framework :: Django :: 3.2', + 'Framework :: Django :: 4.0', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: BSD License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', From e43ce5706b590b77391dc049a2d2ac5548f9d5fb Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sun, 19 Dec 2021 13:49:29 -0500 Subject: [PATCH 09/18] Update changelog --- docs/changelog.rst | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 0739d8f5..28555d06 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -3,6 +3,8 @@ Changelog Unreleased ----------- +* Explicitly support Python 3.6+. `#408`_ +* Drop support for end of life Django versions. Currently support 2.2, 3.2, 4.0. `#408`_ * Replace ugettext_lazy with gettext_lazy `#342`_ * Changed logging settings from settings.py to late init `#332`_ * Fix authentication error when postgres is password protected `#361`_ @@ -50,9 +52,4 @@ Unreleased .. _`#349`: https://github.com/django-dbbackup/django-dbbackup/pull/349 .. _`#348`: https://github.com/django-dbbackup/django-dbbackup/pull/348 .. _`#337`: https://github.com/django-dbbackup/django-dbbackup/pull/337 -.. _`#`: -.. _`#`: -.. _`#`: -.. _`#`: -.. _`#`: -.. _`#`:_ +.. _`#408`: https://github.com/django-dbbackup/django-dbbackup/pull/408 From 26cba351ce6120e26a9637bcf1c62f7a9241c033 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sun, 19 Dec 2021 13:50:11 -0500 Subject: [PATCH 10/18] Remove test passing checklist which is automated by GitHub --- .github/PULL_REQUEST_TEMPLATE.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 9c38f297..11f99dc1 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -12,5 +12,4 @@ Explain value. ## Checklist -- [ ] Tests are passing - [ ] Documentation has been added or amended for this feature / update From 1ab64e237fd886b784604e1d6ab6ccd850c8df56 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sun, 19 Dec 2021 14:01:58 -0500 Subject: [PATCH 11/18] Update changelog for PRs merged since last release --- docs/changelog.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 28555d06..54954ceb 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -3,6 +3,9 @@ Changelog Unreleased ----------- + +* Add authentication database support for MongoDB `#379`_ +* Remove six dependency `#371`_ * Explicitly support Python 3.6+. `#408`_ * Drop support for end of life Django versions. Currently support 2.2, 3.2, 4.0. `#408`_ * Replace ugettext_lazy with gettext_lazy `#342`_ @@ -13,8 +16,8 @@ Unreleased * Documentation fixes `#341`_ `#333`_ `#349`_ `#348`_ `#337`_ -3.3.0 ------- +3.3.0 (2020-04-14) +------------------ * Documentation fixes `#341`_ `#333`_ `#328`_ `#320`_ `#305`_ `#303`_ `#302`_ `#298`_ `#281`_ `#266`_ `#349`_ `#348`_ `#337`_ * "output-filename" in mediabackup command `#324`_ @@ -53,3 +56,5 @@ Unreleased .. _`#348`: https://github.com/django-dbbackup/django-dbbackup/pull/348 .. _`#337`: https://github.com/django-dbbackup/django-dbbackup/pull/337 .. _`#408`: https://github.com/django-dbbackup/django-dbbackup/pull/408 +.. _`#371`: https://github.com/django-dbbackup/django-dbbackup/pull/371 +.. _`#379`: https://github.com/django-dbbackup/django-dbbackup/pull/379 From 281028ebde55aec25a525b0f789da263a73486b2 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sun, 19 Dec 2021 14:13:22 -0500 Subject: [PATCH 12/18] Include long description in package metadata --- setup.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/setup.py b/setup.py index ba89185f..44993dee 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,7 @@ #!/usr/bin/env python + +from pathlib import Path + from setuptools import setup, find_packages import dbbackup @@ -11,6 +14,9 @@ def get_test_requirements(): return open('requirements-tests.txt').read().splitlines() +project_dir = Path(__file__).parent + + keywords = [ 'django', 'database', 'media', 'backup', 'amazon', 's3' 'dropbox', @@ -22,6 +28,7 @@ def get_test_requirements(): description=dbbackup.__doc__, author=dbbackup.__author__, author_email=dbbackup.__email__, + long_description=project_dir.joinpath("README.rst").read_text(encoding="utf-8"), python_requires=">=3.6", install_requires=get_requirements(), tests_require=get_test_requirements(), From 68d7fd9dda05621ba06a4e6c459bc3d1086bed9c Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sun, 19 Dec 2021 14:14:53 -0500 Subject: [PATCH 13/18] Update changelog --- docs/changelog.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 54954ceb..464331ed 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -13,7 +13,7 @@ Unreleased * Fix authentication error when postgres is password protected `#361`_ * Use exclude-table-data instead of exclude-table `#363`_ * Add support for exclude tables data in the command interface `#375`_ -* Documentation fixes `#341`_ `#333`_ `#349`_ `#348`_ `#337`_ +* Documentation fixes `#341`_ `#333`_ `#349`_ `#348`_ `#337`_ `#411`_ 3.3.0 (2020-04-14) @@ -58,3 +58,4 @@ Unreleased .. _`#408`: https://github.com/django-dbbackup/django-dbbackup/pull/408 .. _`#371`: https://github.com/django-dbbackup/django-dbbackup/pull/371 .. _`#379`: https://github.com/django-dbbackup/django-dbbackup/pull/379 +.. _`#411`: https://github.com/django-dbbackup/django-dbbackup/pull/411 From 5e4a613decdab98055290a3c7af6005fb71a54bc Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sun, 19 Dec 2021 14:19:25 -0500 Subject: [PATCH 14/18] Add build environment --- README.rst | 15 +++++++++++++++ tox.ini | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/README.rst b/README.rst index 0ce642bf..c3ccf21c 100644 --- a/README.rst +++ b/README.rst @@ -200,3 +200,18 @@ Django3.2 you would run: tox -e py3.9-django3.2 The available test environments can be found in ``tox.ini``. + +Publishing +========== + +To build a source distribution and wheel: + +:: + + tox -e build + +To publish to PyPI: + +:: + + tox -e upload diff --git a/tox.ini b/tox.ini index 5d924bf1..82b58af1 100644 --- a/tox.ini +++ b/tox.ini @@ -63,3 +63,19 @@ deps = -rrequirements-tests.txt djongo commands = {posargs:bash -x functional.sh} + +[testenv:build] +basepython = python +skip_install = true +deps = + build +commands = + {envpython} -m build + +[testenv:upload] +basepython = python +skip_install = true +deps = + twine +commands = + {envpython} -m twine upload {toxinidir}/dist/* From 41dd32cb31c31c0779c145e816516cd5a96406e7 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sun, 19 Dec 2021 14:27:03 -0500 Subject: [PATCH 15/18] Fix RemovedInDjango41Warning related to default_app_config --- dbbackup/__init__.py | 9 +++++++-- docs/changelog.rst | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dbbackup/__init__.py b/dbbackup/__init__.py index a16ca50f..6ed1762a 100644 --- a/dbbackup/__init__.py +++ b/dbbackup/__init__.py @@ -1,7 +1,12 @@ -"Management commands to help backup and restore a project database and media" +"""Management commands to help backup and restore a project database and media""" + +import django + VERSION = (3, 3, 0) __version__ = '.'.join([str(i) for i in VERSION]) __author__ = 'Michael Shepanski' __email__ = 'mjs7231@gmail.com' __url__ = 'https://github.com/django-dbbackup/django-dbbackup' -default_app_config = 'dbbackup.apps.DbbackupConfig' + +if django.VERSION < (3, 2): + default_app_config = 'dbbackup.apps.DbbackupConfig' diff --git a/docs/changelog.rst b/docs/changelog.rst index 464331ed..32a9fc99 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,6 +4,7 @@ Changelog Unreleased ----------- +* Fix RemovedInDjango41Warning related to default_app_config `#413`_ * Add authentication database support for MongoDB `#379`_ * Remove six dependency `#371`_ * Explicitly support Python 3.6+. `#408`_ @@ -59,3 +60,4 @@ Unreleased .. _`#371`: https://github.com/django-dbbackup/django-dbbackup/pull/371 .. _`#379`: https://github.com/django-dbbackup/django-dbbackup/pull/379 .. _`#411`: https://github.com/django-dbbackup/django-dbbackup/pull/411 +.. _`#413`: https://github.com/django-dbbackup/django-dbbackup/pull/413 From ca53d629943c4ca4f7e00f1750150fe61e4ea6ca Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sun, 19 Dec 2021 14:41:16 -0500 Subject: [PATCH 16/18] Release 4.0.0b0 --- dbbackup/__init__.py | 6 ------ docs/changelog.rst | 9 ++++++--- setup.py | 11 +++++------ 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/dbbackup/__init__.py b/dbbackup/__init__.py index 6ed1762a..c04d41f5 100644 --- a/dbbackup/__init__.py +++ b/dbbackup/__init__.py @@ -2,11 +2,5 @@ import django -VERSION = (3, 3, 0) -__version__ = '.'.join([str(i) for i in VERSION]) -__author__ = 'Michael Shepanski' -__email__ = 'mjs7231@gmail.com' -__url__ = 'https://github.com/django-dbbackup/django-dbbackup' - if django.VERSION < (3, 2): default_app_config = 'dbbackup.apps.DbbackupConfig' diff --git a/docs/changelog.rst b/docs/changelog.rst index 32a9fc99..e9e085e2 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,8 +1,8 @@ Changelog -===== +========= -Unreleased ------------ +4.0.0b0 (2021-12-19) +-------------------- * Fix RemovedInDjango41Warning related to default_app_config `#413`_ * Add authentication database support for MongoDB `#379`_ @@ -14,6 +14,8 @@ Unreleased * Fix authentication error when postgres is password protected `#361`_ * Use exclude-table-data instead of exclude-table `#363`_ * Add support for exclude tables data in the command interface `#375`_ +* Move author and version information into setup.py to allow building package in isolated + environment (e.g. with the ``build`` package). `#414`_ * Documentation fixes `#341`_ `#333`_ `#349`_ `#348`_ `#337`_ `#411`_ @@ -61,3 +63,4 @@ Unreleased .. _`#379`: https://github.com/django-dbbackup/django-dbbackup/pull/379 .. _`#411`: https://github.com/django-dbbackup/django-dbbackup/pull/411 .. _`#413`: https://github.com/django-dbbackup/django-dbbackup/pull/413 +.. _`#414`: https://github.com/django-dbbackup/django-dbbackup/pull/414 diff --git a/setup.py b/setup.py index 44993dee..b5e7a52b 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,6 @@ from pathlib import Path from setuptools import setup, find_packages -import dbbackup def get_requirements(): @@ -24,16 +23,16 @@ def get_test_requirements(): setup( name='django-dbbackup', - version=dbbackup.__version__, - description=dbbackup.__doc__, - author=dbbackup.__author__, - author_email=dbbackup.__email__, + version="4.0.0b0", + description='Management commands to help backup and restore a project database and media', + author='Michael Shepanski', + author_email='mjs7231@gmail.com', long_description=project_dir.joinpath("README.rst").read_text(encoding="utf-8"), python_requires=">=3.6", install_requires=get_requirements(), tests_require=get_test_requirements(), license='BSD', - url=dbbackup.__url__, + url='https://github.com/django-dbbackup/django-dbbackup', keywords=keywords, packages=find_packages(), classifiers=[ From 9aab6c95e754e0c6487759fce26dc970c1eddb3d Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sun, 9 Jan 2022 13:48:34 -0500 Subject: [PATCH 17/18] Fix GitHub Actions configuration (#419) * Fix GitHub Actions configuration * Remove deprecated import --- dbbackup/tests/testapp/urls.py | 16 +++++----------- tox.ini | 17 ++++------------- 2 files changed, 9 insertions(+), 24 deletions(-) diff --git a/dbbackup/tests/testapp/urls.py b/dbbackup/tests/testapp/urls.py index 44ca7b73..df25a40a 100644 --- a/dbbackup/tests/testapp/urls.py +++ b/dbbackup/tests/testapp/urls.py @@ -1,11 +1,5 @@ -try: - from django.conf.urls import patterns, include, url - urlpatterns = patterns( - '', - # url(r'^admin/', include(admin.site.urls)), - ) -except ImportError: - from django.conf.urls import include, url - urlpatterns = ( - # url(r'^admin/', include(admin.site.urls)), - ) +from django.urls import include, re_path + +urlpatterns = ( + # url(r'^admin/', include(admin.site.urls)), +) diff --git a/tox.ini b/tox.ini index 82b58af1..97295bd5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,24 +1,15 @@ [tox] -envlist = py{3.6,3.7,3.8,nightly}-django2.2,py{3.6,3.7,3.8,3.9,3.10,nightly}-django{3.2,4.0,master},lint,docs,functional +envlist = py{36,37,38,39}-django22,py{36,37,38,39,310}-django{32,40,master},lint,docs,functional [testenv] passenv = * setenv = PYTHONDONTWRITEBYTECODE=1 -basepython = - py3.6: python3.6 - py3.7: python3.7 - py3.8: python3.8 - py3.9: python3.9 - py3.10: python3.10 - pypypy: pypy - pypypy3: pypy3 - pynightly: python deps = -rrequirements-tests.txt - django2.2: Django>=2.2,<2.3 - django3.2: Django>=3.2,<3.3 - django4.0: Django>=4.0,<4.1 + django22: Django>=2.2,<2.3 + django32: Django>=3.2,<3.3 + django40: Django>=4.0,<4.1 djangomaster: https://github.com/django/django/archive/master.zip commands = {posargs:coverage run runtests.py} From 3a4cdbf2b8a70ac319655ad08dd8fc5e8c0f38d8 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sun, 9 Jan 2022 15:22:24 -0500 Subject: [PATCH 18/18] Enable functional tests in CI (#420) --- tox.ini | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tox.ini b/tox.ini index 97295bd5..34b40423 100644 --- a/tox.ini +++ b/tox.ini @@ -16,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.6: py36-django{22,32} - 3.7: py37-django{22,32} - 3.8: py38-django{22,32,40} - 3.9: py39-django{22,32,40} - 3.10: py310-django{22,32,40} + 3.6: py36-django{22,32},functional + 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 [testenv:lint] basepython = python