From 90028879662ff98514f9218117c68eb2d1835b32 Mon Sep 17 00:00:00 2001 From: Usama Sadiq Date: Tue, 8 Aug 2023 13:02:26 +0500 Subject: [PATCH] build: update django-simple-history package version (#324) * fix: update django-simple-history to latest version --------- Co-authored-by: Awais Qureshi --- Makefile | 2 + organizations/__init__.py | 2 +- .../migrations/0004_auto_20230727_2054.py | 21 ++++ organizations/tests/test_migrations.py | 21 ++++ requirements/base.txt | 52 +++++----- requirements/common_constraints.txt | 7 +- requirements/constraints.txt | 2 + requirements/pip-tools.txt | 15 +-- requirements/pip.txt | 10 +- test-requirements.txt | 96 +++++++++---------- test_settings.py | 3 + 11 files changed, 131 insertions(+), 100 deletions(-) create mode 100644 organizations/migrations/0004_auto_20230727_2054.py create mode 100644 organizations/tests/test_migrations.py diff --git a/Makefile b/Makefile index 7b2016d6..338a1219 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,8 @@ $(COMMON_CONSTRAINTS_TXT): upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade upgrade: $(COMMON_CONSTRAINTS_TXT) + sed 's/django-simple-history==3.0.0//g' requirements/common_constraints.txt > requirements/common_constraints.tmp + mv requirements/common_constraints.tmp requirements/common_constraints.txt ## update the requirements text files based on the requirements/*.in files pip install -qr requirements/pip-tools.txt pip-compile --upgrade --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in diff --git a/organizations/__init__.py b/organizations/__init__.py index adef9ef6..549c79c4 100644 --- a/organizations/__init__.py +++ b/organizations/__init__.py @@ -1,4 +1,4 @@ """ edx-organizations app initialization module """ -__version__ = '6.12.0' # pragma: no cover +__version__ = '6.12.1' # pragma: no cover diff --git a/organizations/migrations/0004_auto_20230727_2054.py b/organizations/migrations/0004_auto_20230727_2054.py new file mode 100644 index 00000000..c02547d1 --- /dev/null +++ b/organizations/migrations/0004_auto_20230727_2054.py @@ -0,0 +1,21 @@ +# Generated by Django 3.2.20 on 2023-07-27 20:54 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('organizations', '0003_historicalorganizationcourse'), + ] + + operations = [ + migrations.AlterModelOptions( + name='historicalorganization', + options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical organization', 'verbose_name_plural': 'historical organizations'}, + ), + migrations.AlterModelOptions( + name='historicalorganizationcourse', + options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical Link Course', 'verbose_name_plural': 'historical Link Courses'}, + ), + ] diff --git a/organizations/tests/test_migrations.py b/organizations/tests/test_migrations.py new file mode 100644 index 00000000..45fb1e8c --- /dev/null +++ b/organizations/tests/test_migrations.py @@ -0,0 +1,21 @@ +""" +Tests for migrations, especially potentially risky data migrations. +""" +from io import StringIO + +from django.core.management import call_command +from django.test.testcases import TestCase +from django.test.utils import override_settings + + +class MigrationTests(TestCase): + """ + Runs migration tests using Django Command interface. + """ + + @override_settings(MIGRATION_MODULES={}) + def test_migrations_are_in_sync(self): + out = StringIO() + call_command("makemigrations", dry_run=True, verbosity=3, stdout=out) + output = out.getvalue() + self.assertIn("No changes detected", output) diff --git a/requirements/base.txt b/requirements/base.txt index 47b01284..9b419423 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -4,26 +4,27 @@ # # make upgrade # -asgiref==3.6.0 +asgiref==3.7.2 # via django -certifi==2022.12.7 +certifi==2023.7.22 # via requests cffi==1.15.1 # via # cryptography # pynacl -charset-normalizer==3.1.0 +charset-normalizer==3.2.0 # via requests -click==8.1.3 +click==8.1.6 # via edx-django-utils -cryptography==40.0.2 +cryptography==41.0.2 # via pyjwt -django==3.2.18 +django==3.2.20 # via # -c requirements/common_constraints.txt # -r requirements/base.in # django-crum # django-model-utils + # django-waffle # djangorestframework # drf-jwt # edx-django-utils @@ -32,11 +33,11 @@ django-crum==0.7.9 # via edx-django-utils django-model-utils==4.3.1 # via -r requirements/base.in -django-simple-history==3.0.0 +django-simple-history==3.1.1 # via - # -c requirements/common_constraints.txt + # -c requirements/constraints.txt # -r requirements/base.in -django-waffle==3.0.0 +django-waffle==4.0.0 # via # edx-django-utils # edx-drf-extensions @@ -47,33 +48,27 @@ djangorestframework==3.14.0 # edx-drf-extensions drf-jwt==1.19.2 # via edx-drf-extensions -edx-django-utils==5.4.0 +edx-django-utils==5.6.0 # via edx-drf-extensions -edx-drf-extensions==8.6.0 +edx-drf-extensions==8.8.0 # via -r requirements/base.in edx-opaque-keys==2.3.0 # via # -r requirements/base.in # edx-drf-extensions -future==0.18.3 - # via pyjwkest idna==3.4 # via requests -newrelic==8.8.0 +newrelic==8.9.0 # via edx-django-utils pbr==5.11.1 # via stevedore -pillow==9.5.0 +pillow==10.0.0 # via -r requirements/base.in -psutil==5.9.4 +psutil==5.9.5 # via edx-django-utils pycparser==2.21 # via cffi -pycryptodomex==3.17 - # via pyjwkest -pyjwkest==1.4.2 - # via edx-drf-extensions -pyjwt[crypto]==2.6.0 +pyjwt[crypto]==2.8.0 # via # drf-jwt # edx-drf-extensions @@ -87,22 +82,21 @@ pytz==2023.3 # via # django # djangorestframework -requests==2.28.2 - # via - # edx-drf-extensions - # pyjwkest +requests==2.31.0 + # via edx-drf-extensions semantic-version==2.10.0 # via edx-drf-extensions six==1.16.0 # via # edx-drf-extensions - # pyjwkest # python-dateutil -sqlparse==0.4.3 +sqlparse==0.4.4 # via django -stevedore==5.0.0 +stevedore==5.1.0 # via # edx-django-utils # edx-opaque-keys -urllib3==1.26.15 +typing-extensions==4.7.1 + # via asgiref +urllib3==2.0.4 # via requests diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt index 7e39123f..163513c3 100644 --- a/requirements/common_constraints.txt +++ b/requirements/common_constraints.txt @@ -20,13 +20,8 @@ Django<4.0 elasticsearch<7.14.0 # django-simple-history>3.0.0 adds indexing and causes a lot of migrations to be affected -django-simple-history==3.0.0 + # tox>4.0.0 isn't yet compatible with many tox plugins, causing CI failures in almost all repos. # Details can be found in this discussion: https://github.com/tox-dev/tox/discussions/1810 tox<4.0.0 - -# edx-sphinx-theme is not compatible with latest Sphinx==6.0.0 version -# Pinning Sphinx version unless the compatibility issue gets resolved -# For details, see issue https://github.com/openedx/edx-sphinx-theme/issues/197 -sphinx<6.0.0 diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 74e6f2a6..f50ae5d4 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -11,3 +11,5 @@ # Common constraints for edx repos -c common_constraints.txt +# incremental upgrade plan. +django-simple-history<=3.1.1 \ No newline at end of file diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index 8620fabd..5748bf66 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -1,22 +1,25 @@ # -# This file is autogenerated by pip-compile with python 3.8 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.8 +# by the following command: # # make upgrade # build==0.10.0 # via pip-tools -click==8.1.3 +click==8.1.6 # via pip-tools packaging==23.1 # via build -pip-tools==6.13.0 +pip-tools==7.1.0 # via -r requirements/pip-tools.in pyproject-hooks==1.0.0 # via build tomli==2.0.1 - # via build -wheel==0.40.0 + # via + # build + # pip-tools + # pyproject-hooks +wheel==0.41.0 # via pip-tools # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/pip.txt b/requirements/pip.txt index 10d248a2..fb1908e6 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,14 +1,14 @@ # -# This file is autogenerated by pip-compile with python 3.8 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.8 +# by the following command: # # make upgrade # -wheel==0.40.0 +wheel==0.41.0 # via -r requirements/pip.in # The following packages are considered to be unsafe in a requirements file: -pip==23.1 +pip==23.2.1 # via -r requirements/pip.in -setuptools==67.6.1 +setuptools==68.0.0 # via -r requirements/pip.in diff --git a/test-requirements.txt b/test-requirements.txt index 5020fb47..d2aa698c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,15 +4,15 @@ # # make upgrade # -asgiref==3.6.0 +asgiref==3.7.2 # via # -r requirements/base.txt # django -astroid==2.15.3 +astroid==2.15.6 # via # pylint # pylint-celery -certifi==2022.12.7 +certifi==2023.7.22 # via # -r requirements/base.txt # requests @@ -21,11 +21,11 @@ cffi==1.15.1 # -r requirements/base.txt # cryptography # pynacl -charset-normalizer==3.1.0 +charset-normalizer==3.2.0 # via # -r requirements/base.txt # requests -click==8.1.3 +click==8.1.6 # via # -r requirements/base.txt # click-log @@ -34,27 +34,28 @@ click==8.1.3 # edx-lint click-log==0.4.0 # via edx-lint -code-annotations==1.3.0 +code-annotations==1.5.0 # via edx-lint -coverage[toml]==7.2.3 +coverage[toml]==7.2.7 # via # -r requirements/test.in # pytest-cov -cryptography==40.0.2 +cryptography==41.0.2 # via # -r requirements/base.txt # pyjwt ddt==1.6.0 # via -r requirements/test.in -dill==0.3.6 +dill==0.3.7 # via pylint -distlib==0.3.6 +distlib==0.3.7 # via virtualenv # via # -c requirements/common_constraints.txt # -r requirements/base.txt # django-crum # django-model-utils + # django-waffle # djangorestframework # drf-jwt # edx-django-utils @@ -65,11 +66,11 @@ django-crum==0.7.9 # edx-django-utils django-model-utils==4.3.1 # via -r requirements/base.txt -django-simple-history==3.0.0 +django-simple-history==3.1.1 # via - # -c requirements/common_constraints.txt + # -c requirements/constraints.txt # -r requirements/base.txt -django-waffle==3.0.0 +django-waffle==4.0.0 # via # -r requirements/base.txt # edx-django-utils @@ -83,11 +84,11 @@ drf-jwt==1.19.2 # via # -r requirements/base.txt # edx-drf-extensions -edx-django-utils==5.4.0 +edx-django-utils==5.6.0 # via # -r requirements/base.txt # edx-drf-extensions -edx-drf-extensions==8.6.0 +edx-drf-extensions==8.8.0 # via -r requirements/base.txt edx-lint==5.3.4 # via -r requirements/test.in @@ -95,20 +96,16 @@ edx-opaque-keys==2.3.0 # via # -r requirements/base.txt # edx-drf-extensions -exceptiongroup==1.1.1 +exceptiongroup==1.1.2 # via pytest -factory-boy==3.2.1 +factory-boy==3.3.0 # via -r requirements/test.in -faker==18.4.0 +faker==19.2.0 # via factory-boy -filelock==3.11.0 +filelock==3.12.2 # via # tox # virtualenv -future==0.18.3 - # via - # -r requirements/base.txt - # pyjwkest httpretty==0.9.7 # via -r requirements/test.in idna==3.4 @@ -123,11 +120,11 @@ jinja2==3.1.2 # via code-annotations lazy-object-proxy==1.9.0 # via astroid -markupsafe==2.1.2 +markupsafe==2.1.3 # via jinja2 mccabe==0.7.0 # via pylint -newrelic==8.8.0 +newrelic==8.9.0 # via # -r requirements/base.txt # edx-django-utils @@ -139,42 +136,34 @@ pbr==5.11.1 # via # -r requirements/base.txt # stevedore -pillow==9.5.0 +pillow==10.0.0 # via -r requirements/base.txt -platformdirs==3.2.0 +platformdirs==3.10.0 # via # pylint # virtualenv -pluggy==1.0.0 +pluggy==1.2.0 # via # pytest # tox -psutil==5.9.4 +psutil==5.9.5 # via # -r requirements/base.txt # edx-django-utils py==1.11.0 # via tox -pycodestyle==2.10.0 +pycodestyle==2.11.0 # via -r requirements/test.in pycparser==2.21 # via # -r requirements/base.txt # cffi -pycryptodomex==3.17 - # via - # -r requirements/base.txt - # pyjwkest -pyjwkest==1.4.2 - # via - # -r requirements/base.txt - # edx-drf-extensions -pyjwt[crypto]==2.6.0 +pyjwt[crypto]==2.8.0 # via # -r requirements/base.txt # drf-jwt # edx-drf-extensions -pylint==2.17.2 +pylint==2.17.5 # via # edx-lint # pylint-celery @@ -184,7 +173,7 @@ pylint-celery==0.3 # via edx-lint pylint-django==2.5.3 # via edx-lint -pylint-plugin-utils==0.7 +pylint-plugin-utils==0.8.2 # via # pylint-celery # pylint-django @@ -196,11 +185,11 @@ pynacl==1.5.0 # via # -r requirements/base.txt # edx-django-utils -pytest==7.3.1 +pytest==7.4.0 # via # pytest-cov # pytest-django -pytest-cov==4.0.0 +pytest-cov==4.1.0 # via -r requirements/test.in pytest-django==4.5.2 # via -r requirements/test.in @@ -216,13 +205,12 @@ pytz==2023.3 # -r requirements/base.txt # django # djangorestframework -pyyaml==6.0 +pyyaml==6.0.1 # via code-annotations -requests==2.28.2 +requests==2.31.0 # via # -r requirements/base.txt # edx-drf-extensions - # pyjwkest semantic-version==2.10.0 # via # -r requirements/base.txt @@ -233,14 +221,13 @@ six==1.16.0 # edx-drf-extensions # edx-lint # httpretty - # pyjwkest # python-dateutil # tox -sqlparse==0.4.3 +sqlparse==0.4.4 # via # -r requirements/base.txt # django -stevedore==5.0.0 +stevedore==5.1.0 # via # -r requirements/base.txt # code-annotations @@ -254,21 +241,24 @@ tomli==2.0.1 # pylint # pytest # tox -tomlkit==0.11.7 +tomlkit==0.12.1 # via pylint tox==3.28.0 # via # -c requirements/common_constraints.txt # -r requirements/test.in -typing-extensions==4.5.0 +typing-extensions==4.7.1 # via + # -r requirements/base.txt + # asgiref # astroid + # faker # pylint -urllib3==1.26.15 +urllib3==2.0.4 # via # -r requirements/base.txt # requests -virtualenv==20.21.0 +virtualenv==20.24.2 # via tox wrapt==1.15.0 # via astroid diff --git a/test_settings.py b/test_settings.py index d186a99f..dd4d8b9e 100644 --- a/test_settings.py +++ b/test_settings.py @@ -49,3 +49,6 @@ } }, ] + +# disable indexing on date field via django-simple-history. +SIMPLE_HISTORY_DATE_INDEX = False