Skip to content

Commit

Permalink
chore: upgrade django-simple-history package version
Browse files Browse the repository at this point in the history
feat: add new migrations with simple-history package
  • Loading branch information
UsamaSadiq committed Oct 10, 2023
1 parent 0756267 commit 5c19cfb
Show file tree
Hide file tree
Showing 14 changed files with 303 additions and 93 deletions.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,16 @@ migrate: ## apply database migrations
html_coverage: ## generate and view HTML coverage report
coverage html && open htmlcov/index.html

COMMON_CONSTRAINTS_TXT=requirements/common_constraints.txt
.PHONY: $(COMMON_CONSTRAINTS_TXT)
$(COMMON_CONSTRAINTS_TXT):
wget -O "$(@)" https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt || touch "$(@)"
echo "$(COMMON_CONSTRAINTS_TEMP_COMMENT)" | cat - $(@) > temp && mv temp $(@)

upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: piptools ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
upgrade: piptools $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
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
# Make sure to compile files after any other files they include!
pip-compile --upgrade --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in
pip-compile --upgrade -o requirements/pip-tools.txt requirements/pip-tools.in
Expand Down
21 changes: 21 additions & 0 deletions edx_exams/apps/core/migrations/0020_auto_20231010_1442.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 3.2.22 on 2023-10-10 14:42

from django.db import migrations


class Migration(migrations.Migration):

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

operations = [
migrations.AlterModelOptions(
name='historicalexam',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical exam', 'verbose_name_plural': 'historical exams'},
),
migrations.AlterModelOptions(
name='historicalexamattempt',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical exam attempt', 'verbose_name_plural': 'historical exam attempts'},
),
]
3 changes: 3 additions & 0 deletions edx_exams/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,6 @@ def root(*path_fragments):

# Event Bus Settings
EXAM_ATTEMPT_EVENTS_KAFKA_TOPIC_NAME = 'learning-exam-attempt-lifecycle'

# disable indexing on history_date
SIMPLE_HISTORY_DATE_INDEX = False
28 changes: 16 additions & 12 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ appdirs==1.4.4
# via fs
asgiref==3.7.2
# via django
async-timeout==4.0.3
# via redis
attrs==23.1.0
# via
# lti-consumer-xblock
# openedx-events
bleach==6.0.0
bleach==6.1.0
# via lti-consumer-xblock
boto3==1.28.59
boto3==1.28.62
# via fs-s3fs
botocore==1.31.59
botocore==1.31.62
# via
# boto3
# s3transfer
Expand Down Expand Up @@ -50,7 +52,7 @@ defusedxml==0.8.0rc2
# social-auth-core
django==3.2.22
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/common_constraints.txt
# -r requirements/base.in
# django-appconf
# django-config-models
Expand Down Expand Up @@ -97,10 +99,8 @@ django-model-utils==4.3.1
# via -r requirements/base.in
django-rest-swagger==2.2.0
# via -r requirements/base.in
django-simple-history==3.0.0
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.in
django-simple-history==3.4.0
# via -r requirements/base.in
django-statici18n==2.4.0
# via lti-consumer-xblock
django-waffle==4.0.0
Expand Down Expand Up @@ -200,6 +200,7 @@ lxml==4.9.3
mako==1.2.4
# via
# lti-consumer-xblock
# xblock
# xblock-utils
markupsafe==2.1.3
# via
Expand All @@ -221,7 +222,7 @@ openedx-django-pyfs==3.4.0
# via
# lti-consumer-xblock
# xblock
openedx-events==8.9.0
openedx-events==9.0.0
# via
# -r requirements/base.in
# edx-event-bus-kafka
Expand Down Expand Up @@ -293,9 +294,10 @@ s3transfer==0.7.0
# via boto3
semantic-version==2.10.0
# via edx-drf-extensions
simplejson==3.19.1
simplejson==3.19.2
# via
# django-rest-swagger
# xblock
# xblock-utils
six==1.16.0
# via
Expand Down Expand Up @@ -325,7 +327,9 @@ stevedore==5.1.0
text-unidecode==1.3
# via python-slugify
typing-extensions==4.8.0
# via edx-opaque-keys
# via
# asgiref
# edx-opaque-keys
uritemplate==4.1.1
# via
# coreapi
Expand All @@ -344,7 +348,7 @@ webencodings==0.5.1
# via bleach
webob==1.8.7
# via xblock
xblock[django]==1.8.0
xblock[django]==1.8.1
# via
# lti-consumer-xblock
# xblock-utils
Expand Down
4 changes: 3 additions & 1 deletion requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ py==1.11.0
# via tox
six==1.16.0
# via tox
tomli==2.0.1
# via tox
tox==3.28.0
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/common_constraints.txt
# -r requirements/ci.in
virtualenv==20.24.5
# via tox
28 changes: 28 additions & 0 deletions requirements/common_constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

# A central location for most common version constraints
# (across edx repos) for pip-installation.
#
# Similar to other constraint files this file doesn't install any packages.
# It specifies version constraints that will be applied if a package is needed.
# When pinning something here, please provide an explanation of why it is a good
# idea to pin this package across all edx repos, Ideally, link to other information
# that will help people in the future to remove the pin when possible.
# Writing an issue against the offending project and linking to it here is good.
#
# Note: Changes to this file will automatically be used by other repos, referencing
# this file from Github directly. It does not require packaging in edx-lint.


# using LTS django version
Django<4.0

# elasticsearch>=7.14.0 includes breaking changes in it which caused issues in discovery upgrade process.
# elastic search changelog: https://www.elastic.co/guide/en/enterprise-search/master/release-notes-7.14.0.html
elasticsearch<7.14.0

# django-simple-history>3.0.0 adds indexing and causes a lot of migrations to be affected


# 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
4 changes: 1 addition & 3 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@
# linking to it here is good.

# Common constraints for edx repos
-c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt


-c common_constraints.txt
53 changes: 44 additions & 9 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,24 @@ astroid==2.15.8
# -r requirements/validation.txt
# pylint
# pylint-celery
async-timeout==4.0.3
# via
# -r requirements/validation.txt
# redis
attrs==23.1.0
# via
# -r requirements/validation.txt
# lti-consumer-xblock
# openedx-events
bleach==6.0.0
bleach==6.1.0
# via
# -r requirements/validation.txt
# lti-consumer-xblock
boto3==1.28.59
boto3==1.28.62
# via
# -r requirements/validation.txt
# fs-s3fs
botocore==1.31.59
botocore==1.31.62
# via
# -r requirements/validation.txt
# boto3
Expand Down Expand Up @@ -168,7 +172,7 @@ django-model-utils==4.3.1
# via -r requirements/validation.txt
django-rest-swagger==2.2.0
# via -r requirements/validation.txt
django-simple-history==3.0.0
django-simple-history==3.4.0
# via -r requirements/validation.txt
django-statici18n==2.4.0
# via
Expand Down Expand Up @@ -226,7 +230,7 @@ edx-event-bus-kafka==5.5.0
# via -r requirements/validation.txt
edx-event-bus-redis==0.3.2
# via -r requirements/validation.txt
edx-i18n-tools==1.2.0
edx-i18n-tools==1.3.0
# via -r requirements/dev.in
edx-lint==5.3.4
# via -r requirements/validation.txt
Expand All @@ -246,9 +250,13 @@ edx-toggles==5.1.0
# edx-event-bus-redis
edx-token-utils==0.2.1
# via -r requirements/validation.txt
exceptiongroup==1.1.3
# via
# -r requirements/validation.txt
# pytest
factory-boy==3.3.0
# via -r requirements/validation.txt
faker==19.6.2
faker==19.8.0
# via
# -r requirements/validation.txt
# factory-boy
Expand Down Expand Up @@ -283,9 +291,15 @@ idna==3.4
# requests
importlib-metadata==6.8.0
# via
# -r requirements/pip-tools.txt
# -r requirements/validation.txt
# build
# keyring
# twine
importlib-resources==6.1.0
# via
# -r requirements/validation.txt
# keyring
inflection==0.5.1
# via
# -r requirements/validation.txt
Expand Down Expand Up @@ -339,12 +353,14 @@ lti-consumer-xblock==9.6.2
lxml==4.9.3
# via
# -r requirements/validation.txt
# edx-i18n-tools
# lti-consumer-xblock
# xblock
mako==1.2.4
# via
# -r requirements/validation.txt
# lti-consumer-xblock
# xblock
# xblock-utils
markdown-it-py==3.0.0
# via
Expand Down Expand Up @@ -395,7 +411,7 @@ openedx-django-pyfs==3.4.0
# -r requirements/validation.txt
# lti-consumer-xblock
# xblock
openedx-events==8.9.0
openedx-events==9.0.0
# via
# -r requirements/validation.txt
# edx-event-bus-kafka
Expand Down Expand Up @@ -596,10 +612,11 @@ semantic-version==2.10.0
# via
# -r requirements/validation.txt
# edx-drf-extensions
simplejson==3.19.1
simplejson==3.19.2
# via
# -r requirements/validation.txt
# django-rest-swagger
# xblock
# xblock-utils
six==1.16.0
# via
Expand Down Expand Up @@ -646,6 +663,17 @@ text-unidecode==1.3
# via
# -r requirements/validation.txt
# python-slugify
tomli==2.0.1
# via
# -r requirements/pip-tools.txt
# -r requirements/validation.txt
# build
# coverage
# pip-tools
# pylint
# pyproject-hooks
# pytest
# tox
tomlkit==0.12.1
# via
# -r requirements/validation.txt
Expand All @@ -661,7 +689,12 @@ types-pyyaml==6.0.12.12
typing-extensions==4.8.0
# via
# -r requirements/validation.txt
# asgiref
# astroid
# edx-opaque-keys
# faker
# pylint
# rich
uritemplate==4.1.1
# via
# -r requirements/validation.txt
Expand Down Expand Up @@ -703,7 +736,7 @@ wrapt==1.15.0
# via
# -r requirements/validation.txt
# astroid
xblock[django]==1.8.0
xblock[django]==1.8.1
# via
# -r requirements/validation.txt
# lti-consumer-xblock
Expand All @@ -714,8 +747,10 @@ xblock-utils==4.0.0
# lti-consumer-xblock
zipp==3.17.0
# via
# -r requirements/pip-tools.txt
# -r requirements/validation.txt
# importlib-metadata
# importlib-resources

# The following packages are considered to be unsafe in a requirements file:
# pip
Expand Down
Loading

0 comments on commit 5c19cfb

Please sign in to comment.