From 230fb34f2dd20a55403c577737ba8a26771477c8 Mon Sep 17 00:00:00 2001 From: Richard Tibbles Date: Sat, 27 Jan 2024 09:41:48 -0800 Subject: [PATCH 1/3] Remove support for Python 2.7 --- .github/workflows/python2-lint.yml | 33 ---------------- .github/workflows/tox.yml | 61 ------------------------------ .pre-commit-config.yaml | 2 +- setup.py | 2 +- tests/testapp/tests/compat.py | 12 ++---- tox.ini | 4 +- 6 files changed, 7 insertions(+), 107 deletions(-) delete mode 100644 .github/workflows/python2-lint.yml diff --git a/.github/workflows/python2-lint.yml b/.github/workflows/python2-lint.yml deleted file mode 100644 index 81ae042b..00000000 --- a/.github/workflows/python2-lint.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Python 2 linting - -on: [push, pull_request] - -jobs: - pre_job: - name: Path match check - runs-on: ubuntu-latest - # Map a step output to a job output - outputs: - should_skip: ${{ steps.skip_check.outputs.should_skip }} - steps: - - id: skip_check - uses: fkirc/skip-duplicate-actions@master - with: - github_token: ${{ github.token }} - paths: '["morango/**.py"]' - lint: - name: Python 2 syntax checking - needs: pre_job - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} - runs-on: ubuntu-20.04 - container: - image: python:2.7.18-buster - steps: - - uses: actions/checkout@v2 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 - - name: Lint with flake8 - run: | - flake8 morango diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 80f00f8a..58786345 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -45,32 +45,6 @@ jobs: - name: Test with tox if: ${{ needs.pre_job.outputs.should_skip != 'true' }} run: tox -e py${{ matrix.python-version }} - unit_test_deprecated: - name: Python unit tests (deprecated python versions) - needs: pre_job - runs-on: ubuntu-20.04 - strategy: - max-parallel: 3 - matrix: - python-version: [2.7] - container: - image: python:${{ matrix.python-version }} - steps: - - uses: actions/checkout@v2 - - name: Install tox - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} - run: | - python -m pip install --upgrade pip - pip install tox - - name: tox env cache - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} - uses: actions/cache@v2 - with: - path: ${{ github.workspace }}/.tox/py${{ matrix.python-version }} - key: ${{ runner.os }}-tox-py${{ matrix.python-version }}-${{ hashFiles('setup.py', 'requirements/*.txt') }} - - name: Test with tox - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} - run: tox -e py${{ matrix.python-version }} cryptography: name: Python unit tests + cryptography needs: pre_job @@ -108,41 +82,6 @@ jobs: - name: Test with tox if: ${{ needs.pre_job.outputs.should_skip != 'true' }} run: tox -e py${{ matrix.python-version }}-cryptography${{ matrix.crypto-version }} - cryptography_deprecated: - name: Python unit tests (deprecated python versions) + cryptography - needs: pre_job - runs-on: ubuntu-20.04 - strategy: - max-parallel: 3 - matrix: - # Packages are no longer available for the distribution that comes with the - # python:3.4 image, so we can't install the necessary dependencies. Eventually, - # this will happen to the others as well. - # EOL: [3.4] - python-version: [2.7] - container: - image: python:${{ matrix.python-version }} - steps: - - uses: actions/checkout@v2 - - name: Install system dependencies - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} - run: | - apt-get -y -qq update - apt-get install -y openssl libssl-dev - - name: Install tox - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} - run: | - python -m pip install --upgrade pip - pip install tox - - name: tox env cache - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} - uses: actions/cache@v2 - with: - path: ${{ github.workspace }}/.tox/py${{ matrix.python-version }} - key: ${{ runner.os }}-tox-py${{ matrix.python-version }}-crypto3.3-${{ hashFiles('setup.py', 'requirements/*.txt') }} - - name: Test with tox - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} - run: tox -e py${{ matrix.python-version }}-cryptography3.3 postgres: name: Python postgres unit tests needs: pre_job diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1d1d5bab..15db1274 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,4 +13,4 @@ repos: rev: v1.4.0 hooks: - id: reorder-python-imports - language_version: python2.7 + language_version: python3 diff --git a/setup.py b/setup.py index 7ca4667b..cb94e133 100644 --- a/setup.py +++ b/setup.py @@ -44,7 +44,6 @@ 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Development Status :: 4 - Beta', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', @@ -52,4 +51,5 @@ 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', ], + python_requires=">=3.6, <3.12", ) diff --git a/tests/testapp/tests/compat.py b/tests/testapp/tests/compat.py index 16b1c8a1..7188093f 100644 --- a/tests/testapp/tests/compat.py +++ b/tests/testapp/tests/compat.py @@ -1,10 +1,6 @@ try: - # In the Python 2.7 GH workflows, we have to install backported version - from backports.test.support import EnvironmentVarGuard # noqa F401 + # For python >2.7 and <3.10 + from test.support import EnvironmentVarGuard # noqa F401 except ImportError: - try: - # For python >2.7 and <3.10 - from test.support import EnvironmentVarGuard # noqa F401 - except ImportError: - # In Python 3.10, this has been moved to test.support.os_helper - from test.support.os_helper import EnvironmentVarGuard # noqa F401 + # In Python 3.10, this has been moved to test.support.os_helper + from test.support.os_helper import EnvironmentVarGuard # noqa F401 diff --git a/tox.ini b/tox.ini index 3ddfee3a..be536961 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{2.7,3.6,3.7,3.8,3.9,3.10,3.11}-cryptography{3.3} + py{3.6,3.7,3.8,3.9,3.10,3.11}-cryptography{3.3} postgres windows @@ -13,7 +13,6 @@ setenv = PYTHONPATH = {toxinidir}{:}{toxinidir}/tests/testapp basepython = - py2.7: python2.7 py3.6: python3.6 py3.7: python3.7 py3.8: python3.8 @@ -26,7 +25,6 @@ basepython = deps = -r{toxinidir}/requirements/test.txt cryptography3.3: cryptography==3.3.2 - py2.7: backports.test.support==0.1.1 commands = sh -c '! tests/testapp/manage.py makemigrations --dry-run --exit --noinput' From b185521161778a8e81b045b66f88ce64f0cf18e5 Mon Sep 17 00:00:00 2001 From: Richard Tibbles Date: Sat, 27 Jan 2024 09:43:19 -0800 Subject: [PATCH 2/3] Bump version to 0.8.0 --- morango/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/morango/__init__.py b/morango/__init__.py index 167cc1d5..49c13fd1 100644 --- a/morango/__init__.py +++ b/morango/__init__.py @@ -3,4 +3,4 @@ from __future__ import unicode_literals default_app_config = "morango.apps.MorangoConfig" -__version__ = "0.7.1" +__version__ = "0.8.0" From 70713cf15090865e56b51a5f6e9b07ea47063f7c Mon Sep 17 00:00:00 2001 From: Richard Tibbles Date: Mon, 29 Jan 2024 09:31:06 -0800 Subject: [PATCH 3/3] Remove use of the future library. The future is now! --- morango/__init__.py | 4 ---- morango/apps.py | 2 -- morango/migrations/0001_initial.py | 2 -- morango/migrations/0002_auto_20170511_0400.py | 2 -- morango/migrations/0003_auto_20170519_0543.py | 2 -- morango/migrations/0004_auto_20170520_2112.py | 2 -- morango/migrations/0005_auto_20170629_2139.py | 2 -- .../0006_instanceidmodel_system_id.py | 2 -- morango/migrations/0007_auto_20171018_1615.py | 2 -- morango/migrations/0008_auto_20171114_2217.py | 2 -- morango/migrations/0009_auto_20171205_0252.py | 2 -- morango/migrations/0010_auto_20171206_1615.py | 2 -- morango/migrations/0011_sharedkey.py | 2 -- morango/migrations/0012_auto_20180927_1658.py | 2 -- morango/migrations/0013_auto_20190627_1513.py | 2 -- .../0014_syncsession_extra_fields.py | 2 -- morango/migrations/0015_auto_20200508_2104.py | 5 ++--- .../0016_store_deserialization_error.py | 5 ++--- .../0017_store_last_transfer_session_id.py | 3 +-- morango/migrations/0018_auto_20210714_2216.py | 5 ++--- morango/migrations/0019_auto_20220113_1807.py | 5 ++--- .../migrations/0020_postgres_fix_nullable.py | 2 -- .../0021_store_partition_index_create.py | 2 -- .../migrations/0022_rename_instance_fields.py | 2 -- .../migrations/0023_add_instance_id_fields.py | 2 -- morango/models/certificates.py | 5 ----- morango/models/core.py | 2 -- setup.py | 5 ----- tests/testapp/facility_profile/apps.py | 2 -- .../migrations/0001_initial.py | 21 +++++++++++++------ .../migrations/0002_auto_20220427_0449.py | 7 +++---- tests/testapp/facility_profile/models.py | 2 -- tests/testapp/testapp/postgres_settings.py | 4 ---- 33 files changed, 27 insertions(+), 86 deletions(-) diff --git a/morango/__init__.py b/morango/__init__.py index 49c13fd1..d2d00e16 100644 --- a/morango/__init__.py +++ b/morango/__init__.py @@ -1,6 +1,2 @@ -from __future__ import absolute_import -from __future__ import print_function -from __future__ import unicode_literals - default_app_config = "morango.apps.MorangoConfig" __version__ = "0.8.0" diff --git a/morango/apps.py b/morango/apps.py index 2d525e96..2d788700 100644 --- a/morango/apps.py +++ b/morango/apps.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.apps import AppConfig from morango.registry import session_middleware diff --git a/morango/migrations/0001_initial.py b/morango/migrations/0001_initial.py index 58e97408..5b50e69a 100644 --- a/morango/migrations/0001_initial.py +++ b/morango/migrations/0001_initial.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.9 on 2017-05-08 23:42 -from __future__ import unicode_literals - import django.db.models.deletion import django.utils.timezone from django.db import migrations diff --git a/morango/migrations/0002_auto_20170511_0400.py b/morango/migrations/0002_auto_20170511_0400.py index fd50d4dd..74756775 100644 --- a/morango/migrations/0002_auto_20170511_0400.py +++ b/morango/migrations/0002_auto_20170511_0400.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2017-05-11 04:00 -from __future__ import unicode_literals - import django.db.models.manager from django.db import migrations from django.db import models diff --git a/morango/migrations/0003_auto_20170519_0543.py b/morango/migrations/0003_auto_20170519_0543.py index 0d164f1a..f1281584 100644 --- a/morango/migrations/0003_auto_20170519_0543.py +++ b/morango/migrations/0003_auto_20170519_0543.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.9 on 2017-05-19 05:43 -from __future__ import unicode_literals - from django.db import migrations from django.db import models diff --git a/morango/migrations/0004_auto_20170520_2112.py b/morango/migrations/0004_auto_20170520_2112.py index b260a16d..46580a2c 100644 --- a/morango/migrations/0004_auto_20170520_2112.py +++ b/morango/migrations/0004_auto_20170520_2112.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.9 on 2017-05-20 21:12 -from __future__ import unicode_literals - from django.db import migrations diff --git a/morango/migrations/0005_auto_20170629_2139.py b/morango/migrations/0005_auto_20170629_2139.py index b0cddf90..3004fc73 100644 --- a/morango/migrations/0005_auto_20170629_2139.py +++ b/morango/migrations/0005_auto_20170629_2139.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2017-06-29 21:39 -from __future__ import unicode_literals - from django.db import migrations import morango.models.fields.crypto diff --git a/morango/migrations/0006_instanceidmodel_system_id.py b/morango/migrations/0006_instanceidmodel_system_id.py index f68b05e2..f521dd3d 100644 --- a/morango/migrations/0006_instanceidmodel_system_id.py +++ b/morango/migrations/0006_instanceidmodel_system_id.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.9 on 2017-06-30 00:15 -from __future__ import unicode_literals - from django.db import migrations from django.db import models diff --git a/morango/migrations/0007_auto_20171018_1615.py b/morango/migrations/0007_auto_20171018_1615.py index 509f0955..06625a77 100644 --- a/morango/migrations/0007_auto_20171018_1615.py +++ b/morango/migrations/0007_auto_20171018_1615.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.9.13 on 2017-10-18 21:15 -from __future__ import unicode_literals - import datetime import django.db.models.deletion diff --git a/morango/migrations/0008_auto_20171114_2217.py b/morango/migrations/0008_auto_20171114_2217.py index e5d8b7ea..9ee895f8 100644 --- a/morango/migrations/0008_auto_20171114_2217.py +++ b/morango/migrations/0008_auto_20171114_2217.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2017-11-14 22:17 -from __future__ import unicode_literals - import django.db.models.deletion import django.db.models.manager from django.db import migrations diff --git a/morango/migrations/0009_auto_20171205_0252.py b/morango/migrations/0009_auto_20171205_0252.py index 09764281..9e22eb6a 100644 --- a/morango/migrations/0009_auto_20171205_0252.py +++ b/morango/migrations/0009_auto_20171205_0252.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2017-12-05 08:52 -from __future__ import unicode_literals - from django.db import migrations diff --git a/morango/migrations/0010_auto_20171206_1615.py b/morango/migrations/0010_auto_20171206_1615.py index c0397a7c..276d5ef7 100644 --- a/morango/migrations/0010_auto_20171206_1615.py +++ b/morango/migrations/0010_auto_20171206_1615.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.9.13 on 2017-12-06 22:15 -from __future__ import unicode_literals - from django.db import migrations from django.db import models diff --git a/morango/migrations/0011_sharedkey.py b/morango/migrations/0011_sharedkey.py index 60201971..07761d42 100644 --- a/morango/migrations/0011_sharedkey.py +++ b/morango/migrations/0011_sharedkey.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-06-12 18:38 -from __future__ import unicode_literals - from django.db import migrations from django.db import models diff --git a/morango/migrations/0012_auto_20180927_1658.py b/morango/migrations/0012_auto_20180927_1658.py index 1617c362..f6ff5968 100644 --- a/morango/migrations/0012_auto_20180927_1658.py +++ b/morango/migrations/0012_auto_20180927_1658.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2018-09-27 16:58 -from __future__ import unicode_literals - from django.db import migrations from django.db import models diff --git a/morango/migrations/0013_auto_20190627_1513.py b/morango/migrations/0013_auto_20190627_1513.py index 6e040df5..e7f8457e 100644 --- a/morango/migrations/0013_auto_20190627_1513.py +++ b/morango/migrations/0013_auto_20190627_1513.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.21 on 2019-06-27 22:13 -from __future__ import unicode_literals - from django.db import migrations import morango.models.fields.uuids diff --git a/morango/migrations/0014_syncsession_extra_fields.py b/morango/migrations/0014_syncsession_extra_fields.py index c098d8e2..d0d25424 100644 --- a/morango/migrations/0014_syncsession_extra_fields.py +++ b/morango/migrations/0014_syncsession_extra_fields.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.27 on 2019-12-30 18:28 -from __future__ import unicode_literals - from django.db import migrations from django.db import models diff --git a/morango/migrations/0015_auto_20200508_2104.py b/morango/migrations/0015_auto_20200508_2104.py index e7efdb66..326d9738 100644 --- a/morango/migrations/0015_auto_20200508_2104.py +++ b/morango/migrations/0015_auto_20200508_2104.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2020-05-08 21:04 -from __future__ import unicode_literals - -from django.db import migrations, models +from django.db import migrations +from django.db import models class Migration(migrations.Migration): diff --git a/morango/migrations/0016_store_deserialization_error.py b/morango/migrations/0016_store_deserialization_error.py index 5317596c..3191b458 100644 --- a/morango/migrations/0016_store_deserialization_error.py +++ b/morango/migrations/0016_store_deserialization_error.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.28 on 2020-06-10 23:48 -from __future__ import unicode_literals - -from django.db import migrations, models +from django.db import migrations +from django.db import models class Migration(migrations.Migration): diff --git a/morango/migrations/0017_store_last_transfer_session_id.py b/morango/migrations/0017_store_last_transfer_session_id.py index adef790d..c5a73f37 100644 --- a/morango/migrations/0017_store_last_transfer_session_id.py +++ b/morango/migrations/0017_store_last_transfer_session_id.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.28 on 2021-06-25 23:13 -from __future__ import unicode_literals - from django.db import migrations + import morango.models.fields.uuids diff --git a/morango/migrations/0018_auto_20210714_2216.py b/morango/migrations/0018_auto_20210714_2216.py index bc8bc9ec..51277dc5 100644 --- a/morango/migrations/0018_auto_20210714_2216.py +++ b/morango/migrations/0018_auto_20210714_2216.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2021-07-14 22:16 -from __future__ import unicode_literals - -from django.db import migrations, models +from django.db import migrations +from django.db import models class Migration(migrations.Migration): diff --git a/morango/migrations/0019_auto_20220113_1807.py b/morango/migrations/0019_auto_20220113_1807.py index b73ad4c7..f187461a 100644 --- a/morango/migrations/0019_auto_20220113_1807.py +++ b/morango/migrations/0019_auto_20220113_1807.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2022-01-13 18:07 -from __future__ import unicode_literals - -from django.db import migrations, models +from django.db import migrations +from django.db import models class Migration(migrations.Migration): diff --git a/morango/migrations/0020_postgres_fix_nullable.py b/morango/migrations/0020_postgres_fix_nullable.py index bcacf178..f35db4d1 100644 --- a/morango/migrations/0020_postgres_fix_nullable.py +++ b/morango/migrations/0020_postgres_fix_nullable.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2022-01-13 18:07 -from __future__ import unicode_literals - from django.db import migrations diff --git a/morango/migrations/0021_store_partition_index_create.py b/morango/migrations/0021_store_partition_index_create.py index 32c21dfd..f96ed79c 100644 --- a/morango/migrations/0021_store_partition_index_create.py +++ b/morango/migrations/0021_store_partition_index_create.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2022-04-27 16:59 -from __future__ import unicode_literals - from django.db import migrations from django.db import models diff --git a/morango/migrations/0022_rename_instance_fields.py b/morango/migrations/0022_rename_instance_fields.py index 82965cb2..115df24d 100644 --- a/morango/migrations/0022_rename_instance_fields.py +++ b/morango/migrations/0022_rename_instance_fields.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2023-01-31 18:53 -from __future__ import unicode_literals - from django.db import migrations diff --git a/morango/migrations/0023_add_instance_id_fields.py b/morango/migrations/0023_add_instance_id_fields.py index bb9cf6fd..bc9f12a5 100644 --- a/morango/migrations/0023_add_instance_id_fields.py +++ b/morango/migrations/0023_add_instance_id_fields.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2023-01-31 19:03 -from __future__ import unicode_literals - from django.db import migrations from django.db import models diff --git a/morango/models/certificates.py b/morango/models/certificates.py index 88d39ccb..19c8ac19 100644 --- a/morango/models/certificates.py +++ b/morango/models/certificates.py @@ -3,8 +3,6 @@ Each certificate has a ``private_key`` used for signing (child) certificates (thus giving certain permissions) and a ``public_key`` used for verifying that a certificate(s) was properly signed. """ -from __future__ import unicode_literals - import json import string @@ -14,7 +12,6 @@ from django.db import transaction from django.utils import timezone from django.utils.six import string_types -from future.utils import python_2_unicode_compatible from .fields.crypto import Key from .fields.crypto import PrivateKeyField @@ -30,7 +27,6 @@ from morango.utils import _assert -@python_2_unicode_compatible class Certificate(mptt.models.MPTTModel, UUIDModelMixin): uuid_input_fields = ("public_key", "profile", "salt") @@ -329,7 +325,6 @@ def get_description(self, params): return string.Template(self.description).safe_substitute(params) -@python_2_unicode_compatible class Filter(object): def __init__(self, template, params={}): # ensure params have been deserialized diff --git a/morango/models/core.py b/morango/models/core.py index ad801031..816f33b2 100644 --- a/morango/models/core.py +++ b/morango/models/core.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import functools import json import logging diff --git a/setup.py b/setup.py index cb94e133..6b96075b 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,5 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from __future__ import absolute_import -from __future__ import print_function -from __future__ import unicode_literals - import io from setuptools import find_packages @@ -32,7 +28,6 @@ "rsa>=3.4.2,<3.5", "djangorestframework==3.9.1", "django-ipware>=1.1.6,<1.2", - "future==0.16.0", "requests", "ifcfg", ], diff --git a/tests/testapp/facility_profile/apps.py b/tests/testapp/facility_profile/apps.py index 1c9be94d..dc5c4f31 100644 --- a/tests/testapp/facility_profile/apps.py +++ b/tests/testapp/facility_profile/apps.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.apps import AppConfig diff --git a/tests/testapp/facility_profile/migrations/0001_initial.py b/tests/testapp/facility_profile/migrations/0001_initial.py index e8f6c561..cdf6e7f0 100644 --- a/tests/testapp/facility_profile/migrations/0001_initial.py +++ b/tests/testapp/facility_profile/migrations/0001_initial.py @@ -1,15 +1,16 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2022-04-12 20:43 -from __future__ import unicode_literals +import uuid -from django.conf import settings -from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import facility_profile.models -import morango.models.fields.uuids import mptt.fields -import uuid +from django.conf import settings +from django.db import migrations +from django.db import models + +import morango.models.fields.uuids class Migration(migrations.Migration): @@ -53,7 +54,15 @@ class Migration(migrations.Migration): ('rght', models.PositiveIntegerField(db_index=True, editable=False)), ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)), ('level', models.PositiveIntegerField(db_index=True, editable=False)), - ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='facility_profile.Facility')), + ( + 'parent', mptt.fields.TreeForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name='children', + to='facility_profile.Facility' + ) + ), ], options={ 'abstract': False, diff --git a/tests/testapp/facility_profile/migrations/0002_auto_20220427_0449.py b/tests/testapp/facility_profile/migrations/0002_auto_20220427_0449.py index 40655df6..7b7a231f 100644 --- a/tests/testapp/facility_profile/migrations/0002_auto_20220427_0449.py +++ b/tests/testapp/facility_profile/migrations/0002_auto_20220427_0449.py @@ -1,10 +1,9 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2022-04-27 04:49 -from __future__ import unicode_literals - -from django.conf import settings -from django.db import migrations, models import django.db.models.deletion +from django.conf import settings +from django.db import migrations +from django.db import models class Migration(migrations.Migration): diff --git a/tests/testapp/facility_profile/models.py b/tests/testapp/facility_profile/models.py index ea658811..f2b405dc 100644 --- a/tests/testapp/facility_profile/models.py +++ b/tests/testapp/facility_profile/models.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import uuid from django.contrib.auth.models import AbstractBaseUser diff --git a/tests/testapp/testapp/postgres_settings.py b/tests/testapp/testapp/postgres_settings.py index 73e0c944..535b3a30 100644 --- a/tests/testapp/testapp/postgres_settings.py +++ b/tests/testapp/testapp/postgres_settings.py @@ -1,10 +1,6 @@ """ A settings module for running tests using a postgres db backend. """ -from __future__ import absolute_import -from __future__ import print_function -from __future__ import unicode_literals - from .settings import * # noqa DATABASES = {