Skip to content

Commit

Permalink
feat: upgrading django-history package (#4130)
Browse files Browse the repository at this point in the history
  • Loading branch information
irtazaakram authored Oct 5, 2023
1 parent 4fb52f9 commit 7cf07b8
Show file tree
Hide file tree
Showing 11 changed files with 172 additions and 45 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ $(COMMON_CONSTRAINTS_TXT):


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
pip install -q -r requirements/pip_tools.txt
pip-compile --allow-unsafe --upgrade -o requirements/pip.txt requirements/pip.in
pip-compile --upgrade -o requirements/pip_tools.txt requirements/pip_tools.in
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.2.5 on 2023-10-05 05:51

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('core', '0019_alter_user_first_name'),
]

operations = [
migrations.AlterModelOptions(
name='historicalpartner',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical Partner', 'verbose_name_plural': 'historical Partners'},
),
migrations.AlterModelOptions(
name='historicalsalesforceconfiguration',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical salesforce configuration', 'verbose_name_plural': 'historical salesforce configurations'},
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Generated by Django 4.2.5 on 2023-10-05 05:51

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('ietf_language_tags', '0004_auto_20200804_1401'),
('course_metadata', '0336_update_microbachelors_seat_types'),
]

operations = [
migrations.AlterModelOptions(
name='historicalcourse',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical course', 'verbose_name_plural': 'historical courses'},
),
migrations.AlterModelOptions(
name='historicalcourseentitlement',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical course entitlement', 'verbose_name_plural': 'historical course entitlements'},
),
migrations.AlterModelOptions(
name='historicalcourserun',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical course run', 'verbose_name_plural': 'historical course runs'},
),
migrations.AlterModelOptions(
name='historicalcourseruntype',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical course run type', 'verbose_name_plural': 'historical course run types'},
),
migrations.AlterModelOptions(
name='historicalcoursetype',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical course type', 'verbose_name_plural': 'historical course types'},
),
migrations.AlterModelOptions(
name='historicalcurriculum',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical curriculum', 'verbose_name_plural': 'historical curriculums'},
),
migrations.AlterModelOptions(
name='historicalcurriculumcoursemembership',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical curriculum course membership', 'verbose_name_plural': 'historical curriculum course memberships'},
),
migrations.AlterModelOptions(
name='historicalcurriculumcourserunexclusion',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical curriculum course run exclusion', 'verbose_name_plural': 'historical curriculum course run exclusions'},
),
migrations.AlterModelOptions(
name='historicalcurriculumprogrammembership',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical curriculum program membership', 'verbose_name_plural': 'historical curriculum program memberships'},
),
migrations.AlterModelOptions(
name='historicaldegreecost',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical degree cost', 'verbose_name_plural': 'historical degree costs'},
),
migrations.AlterModelOptions(
name='historicaldegreedeadline',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical degree deadline', 'verbose_name_plural': 'historical degree deadlines'},
),
migrations.AlterModelOptions(
name='historicalmode',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical mode', 'verbose_name_plural': 'historical modes'},
),
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='historicalprogram',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical program', 'verbose_name_plural': 'historical programs'},
),
migrations.AlterModelOptions(
name='historicalprogramtype',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical program type', 'verbose_name_plural': 'historical program types'},
),
migrations.AlterModelOptions(
name='historicalseat',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical seat', 'verbose_name_plural': 'historical seats'},
),
migrations.AlterModelOptions(
name='historicaltrack',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical track', 'verbose_name_plural': 'historical tracks'},
),
migrations.AlterField(
model_name='courserun',
name='video_translation_languages',
field=models.ManyToManyField(blank=True, related_name='+', to='ietf_language_tags.languagetag'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.2.5 on 2023-10-05 05:51

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('publisher', '0002_auto_20200804_1401'),
]

operations = [
migrations.AlterModelOptions(
name='historicalorganizationextension',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical organization extension', 'verbose_name_plural': 'historical organization extensions'},
),
migrations.AlterModelOptions(
name='historicalorganizationuserrole',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical organization user role', 'verbose_name_plural': 'historical organization user roles'},
),
]
3 changes: 3 additions & 0 deletions course_discovery/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,4 +769,7 @@

NOTIFY_SLUG_UPDATE_RECIPIENTS = []

# disable indexing on history_date
SIMPLE_HISTORY_DATE_INDEX = False

CSRF_TRUSTED_ORIGINS_WITH_SCHEME = [] # just for Django 4.2 upgrade
2 changes: 1 addition & 1 deletion requirements/common_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ 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
Expand Down
5 changes: 2 additions & 3 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ authlib==1.0.0rc1
# The latest version require Django 4.0, remove once we have upgraded to Django 4.0
django-admin-sortable2<2.0.0

# The latest versions of django-simple-history & django-stdimage have breaking changes
# The latest versions of django-stdimage has breaking changes
# Remove this pin after fixing them.
django-simple-history<=3.0.0
django-stdimage<=5.3.0

semgrep==0.102.0
Expand Down Expand Up @@ -56,5 +55,5 @@ pillow < 10.0.0
# Awaiting fix https://github.com/Benoss/django-elasticsearch-debug-toolbar/pull/21 to be merged
django-debug-toolbar < 4.2.0

# selenium==4.13.0 causing test failures
# selenium==4.13.0 causing test failures
selenium==4.12.0
2 changes: 1 addition & 1 deletion requirements/django.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
django==3.2.21
django==3.2.22
django-admin-sortable2==1.0.4
4 changes: 2 additions & 2 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ accessible-pygments==0.0.4
# via pydata-sphinx-theme
alabaster==0.7.13
# via sphinx
babel==2.12.1
babel==2.13.0
# via
# pydata-sphinx-theme
# sphinx
Expand Down Expand Up @@ -93,7 +93,7 @@ sphinxcontrib-serializinghtml==1.1.5
# via sphinx
typing-extensions==4.8.0
# via pydata-sphinx-theme
urllib3==1.26.16
urllib3==1.26.17
# via
# elasticsearch
# requests
Expand Down
39 changes: 18 additions & 21 deletions requirements/local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ attrs==21.4.0
# semgrep
# trio
# zeep
babel==2.12.1
babel==2.13.0
# via
# pydata-sphinx-theme
# sphinx
Expand All @@ -74,9 +74,9 @@ boltons==21.0.0
# face
# glom
# semgrep
boto3==1.28.57
boto3==1.28.60
# via django-ses
botocore==1.31.57
botocore==1.31.60
# via
# boto3
# s3transfer
Expand Down Expand Up @@ -141,7 +141,7 @@ colorama==0.4.6
# via semgrep
contentful==2.1.1
# via -r requirements/base.in
coverage[toml]==7.3.1
coverage[toml]==7.3.2
# via
# -r requirements/test.in
# pytest-cov
Expand Down Expand Up @@ -292,11 +292,8 @@ django-parler==2.3
# via -r requirements/base.in
django-ses==3.5.0
# via taxonomy-connector
django-simple-history==3.0.0
# via
# -c requirements/common_constraints.txt
# -c requirements/constraints.txt
# -r requirements/base.in
django-simple-history==3.4.0
# via -r requirements/base.in
django-solo==2.1.0
# via
# -r requirements/base.in
Expand Down Expand Up @@ -390,7 +387,7 @@ edx-drf-extensions==8.2.0
# -r requirements/base.in
edx-event-bus-kafka==5.5.0
# via -r requirements/base.in
edx-event-bus-redis==0.3.1
edx-event-bus-redis==0.3.2
# via -r requirements/base.in
edx-i18n-tools==1.2.0
# via -r requirements/local.in
Expand Down Expand Up @@ -437,7 +434,7 @@ factory-boy==3.3.0
# via -r requirements/test.in
faker==19.6.2
# via factory-boy
fastavro==1.8.3
fastavro==1.8.4
# via openedx-events
filelock==3.12.4
# via
Expand All @@ -458,7 +455,7 @@ glom==22.1.0
# via semgrep
google-api-core==2.12.0
# via google-api-python-client
google-api-python-client==2.101.0
google-api-python-client==2.102.0
# via -r requirements/base.in
google-auth==2.23.2
# via
Expand Down Expand Up @@ -561,7 +558,7 @@ openai==0.28.1
# via taxonomy-connector
openedx-atlas==0.5.0
# via -r requirements/base.in
openedx-events==8.6.0
openedx-events==8.9.0
# via
# edx-event-bus-kafka
# edx-event-bus-redis
Expand Down Expand Up @@ -599,7 +596,7 @@ pillow==9.5.0
# -r requirements/base.in
# cairosvg
# django-stdimage
platformdirs==3.8.1
platformdirs==3.11.0
# via
# pylint
# snowflake-connector-python
Expand All @@ -613,7 +610,7 @@ polib==1.2.0
# via edx-i18n-tools
prompt-toolkit==3.0.39
# via click-repl
protobuf==4.24.3
protobuf==4.24.4
# via
# google-api-core
# googleapis-common-protos
Expand Down Expand Up @@ -809,9 +806,9 @@ rjsmin==1.2.1
# via django-compressor
rsa==4.9
# via google-auth
ruamel-yaml==0.17.33
ruamel-yaml==0.17.35
# via semgrep
ruamel-yaml-clib==0.2.7
ruamel-yaml-clib==0.2.8
# via ruamel-yaml
s3transfer==0.7.0
# via boto3
Expand Down Expand Up @@ -855,7 +852,7 @@ sniffio==1.3.0
# via trio
snowballstemmer==2.2.0
# via sphinx
snowflake-connector-python==3.2.0
snowflake-connector-python==3.2.1
# via -r requirements/base.in
social-auth-app-django==5.3.0
# via
Expand Down Expand Up @@ -906,7 +903,7 @@ testfixtures==7.2.0
# via -r requirements/test.in
text-unidecode==1.3
# via python-slugify
texttable==1.6.7
texttable==1.7.0
# via docker-compose
tinycss2==1.2.1
# via
Expand Down Expand Up @@ -963,7 +960,7 @@ uritemplate==4.1.1
# via
# drf-yasg
# google-api-python-client
urllib3[socks]==1.26.16
urllib3[socks]==1.26.17
# via
# botocore
# docker
Expand All @@ -978,7 +975,7 @@ vine==5.0.0
# amqp
# celery
# kombu
virtualenv==20.24.1
virtualenv==20.24.5
# via tox
walrus==0.9.3
# via edx-event-bus-redis
Expand Down
Loading

0 comments on commit 7cf07b8

Please sign in to comment.