Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade django simple history package #527

Merged
merged 2 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,7 @@ upgrade: piptools $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt fil
# This is a temporary solution to override the real common_constraints.txt
# In edx-lint, until the pyjwt constraint in edx-lint has been removed.
# See BOM-271 for more details.
sed 's/pyjwt\[crypto\]<2.0.0//g' requirements/common_constraints.txt > requirements/common_constraints.tmp
mv requirements/common_constraints.tmp requirements/common_constraints.txt
sed 's/social-auth-core<4.0.3//g' requirements/common_constraints.txt > requirements/common_constraints.tmp
mv requirements/common_constraints.tmp requirements/common_constraints.txt
sed 's/edx-auth-backends<4.0.0//g' requirements/common_constraints.txt > requirements/common_constraints.tmp
mv requirements/common_constraints.tmp requirements/common_constraints.txt
sed 's/edx-drf-extensions<7.0.0//g' requirements/common_constraints.txt > requirements/common_constraints.tmp
mv requirements/common_constraints.tmp requirements/common_constraints.txt
sed 's/drf-jwt<1.19.1//g' requirements/common_constraints.txt > requirements/common_constraints.tmp
sed 's/django-simple-history==3.0.0//g' requirements/common_constraints.txt > requirements/common_constraints.tmp
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Override the common constraint to upgrade the package to latest version.

mv requirements/common_constraints.tmp requirements/common_constraints.txt
# Make sure to compile files after any other files they include!
pip-compile --upgrade --rebuild --allow-unsafe -o requirements/pip.txt requirements/pip.in
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Generated by Django 3.2.21 on 2023-09-27 11:19

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('subscriptions', '0060_historicalsubscriptionlicensesource'),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new migration created with the latest version of django-simple-history package.

]

operations = [
migrations.AlterModelOptions(
name='historicalcustomeragreement',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical Customer Agreement', 'verbose_name_plural': 'historical Customer Agreements'},
),
migrations.AlterModelOptions(
name='historicallicense',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical license', 'verbose_name_plural': 'historical licenses'},
),
migrations.AlterModelOptions(
name='historicalnotification',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical notification', 'verbose_name_plural': 'historical notifications'},
),
migrations.AlterModelOptions(
name='historicalproduct',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical product', 'verbose_name_plural': 'historical products'},
),
migrations.AlterModelOptions(
name='historicalsubscriptionlicensesource',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical subscription license source', 'verbose_name_plural': 'historical subscription license sources'},
),
migrations.AlterModelOptions(
name='historicalsubscriptionplan',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical Subscription Plan', 'verbose_name_plural': 'historical Subscription Plans'},
),
migrations.AlterModelOptions(
name='historicalsubscriptionplanrenewal',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical Subscription Plan Renewal', 'verbose_name_plural': 'historical Subscription Plan Renewals'},
),
]
3 changes: 3 additions & 0 deletions license_manager/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,3 +435,6 @@

# Django Admin Settings
VALIDATE_FORM_EXTERNAL_FIELDS = True

# disable indexing on history_date
SIMPLE_HISTORY_DATE_INDEX = False
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added setting to avoid db_index change in migrations due to updated simple-history package.

6 changes: 2 additions & 4 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,8 @@ django-model-utils==4.3.1
# edx-rbac
django-ses==3.5.0
# via -r requirements/base.in
django-simple-history==3.0.0
# via
# -c requirements/common_constraints.txt
# -r requirements/base.in
django-simple-history==3.4.0
# via -r requirements/base.in
django-waffle==4.0.0
# via
# -r requirements/base.in
Expand Down
2 changes: 1 addition & 1 deletion requirements/common_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,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
6 changes: 2 additions & 4 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,8 @@ django-model-utils==4.3.1
# edx-rbac
django-ses==3.5.0
# via -r requirements/validation.txt
django-simple-history==3.0.0
# via
# -c requirements/common_constraints.txt
# -r requirements/validation.txt
django-simple-history==3.4.0
# via -r requirements/validation.txt
django-waffle==4.0.0
# via
# -r requirements/validation.txt
Expand Down
6 changes: 2 additions & 4 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,8 @@ django-model-utils==4.3.1
# edx-rbac
django-ses==3.5.0
# via -r requirements/test.txt
django-simple-history==3.0.0
# via
# -c requirements/common_constraints.txt
# -r requirements/test.txt
django-simple-history==3.4.0
# via -r requirements/test.txt
django-waffle==4.0.0
# via
# -r requirements/test.txt
Expand Down
6 changes: 2 additions & 4 deletions requirements/production.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,8 @@ django-model-utils==4.3.1
# edx-rbac
django-ses==3.5.0
# via -r requirements/base.txt
django-simple-history==3.0.0
# via
# -c requirements/common_constraints.txt
# -r requirements/base.txt
django-simple-history==3.4.0
# via -r requirements/base.txt
django-waffle==4.0.0
# via
# -r requirements/base.txt
Expand Down
6 changes: 2 additions & 4 deletions requirements/quality.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,8 @@ django-model-utils==4.3.1
# edx-rbac
django-ses==3.5.0
# via -r requirements/base.txt
django-simple-history==3.0.0
# via
# -c requirements/common_constraints.txt
# -r requirements/base.txt
django-simple-history==3.4.0
# via -r requirements/base.txt
django-waffle==4.0.0
# via
# -r requirements/base.txt
Expand Down
6 changes: 2 additions & 4 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,8 @@ django-model-utils==4.3.1
# edx-rbac
django-ses==3.5.0
# via -r requirements/base.txt
django-simple-history==3.0.0
# via
# -c requirements/common_constraints.txt
# -r requirements/base.txt
django-simple-history==3.4.0
# via -r requirements/base.txt
django-waffle==4.0.0
# via
# -r requirements/base.txt
Expand Down
3 changes: 1 addition & 2 deletions requirements/validation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,8 @@ django-ses==3.5.0
# via
# -r requirements/quality.txt
# -r requirements/test.txt
django-simple-history==3.0.0
django-simple-history==3.4.0
# via
# -c requirements/common_constraints.txt
# -r requirements/quality.txt
# -r requirements/test.txt
django-waffle==4.0.0
Expand Down
Loading