diff --git a/Makefile b/Makefile index 30efdb62..507aa1d4 100644 --- a/Makefile +++ b/Makefile @@ -102,8 +102,16 @@ html_coverage: ## generate and view HTML coverage report # Define PIP_COMPILE_OPTS=-v to get more information during make upgrade. PIP_COMPILE = pip-compile --upgrade $(PIP_COMPILE_OPTS) +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: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in +upgrade: $(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 pip install -qr requirements/pip-tools.txt # Make sure to compile files after any other files they include! $(PIP_COMPILE) --allow-unsafe -o requirements/pip.txt requirements/pip.in diff --git a/enterprise_subsidy/apps/subsidy/migrations/0018_alter_historicalsubsidy_options.py b/enterprise_subsidy/apps/subsidy/migrations/0018_alter_historicalsubsidy_options.py new file mode 100644 index 00000000..62184f6d --- /dev/null +++ b/enterprise_subsidy/apps/subsidy/migrations/0018_alter_historicalsubsidy_options.py @@ -0,0 +1,17 @@ +# Generated by Django 3.2.21 on 2023-09-27 12:41 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('subsidy', '0017_add_is_soft_deleted_subsidy'), + ] + + operations = [ + migrations.AlterModelOptions( + name='historicalsubsidy', + options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical subsidy', 'verbose_name_plural': 'historical subsidys'}, + ), + ] diff --git a/enterprise_subsidy/settings/base.py b/enterprise_subsidy/settings/base.py index 5c33e50d..a8cb3010 100644 --- a/enterprise_subsidy/settings/base.py +++ b/enterprise_subsidy/settings/base.py @@ -357,3 +357,6 @@ def root(*path_fragments): # per-view cache timeout settings # We can disable caching on this view by setting the value below to 0. CONTENT_METADATA_VIEW_CACHE_TIMEOUT_SECONDS = 60 + +# disable indexing on history_date +SIMPLE_HISTORY_DATE_INDEX = False diff --git a/requirements/base.txt b/requirements/base.txt index 6950108e..6702556d 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -33,7 +33,7 @@ defusedxml==0.7.1 # social-auth-core django==3.2.21 # 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-clearcache # django-cors-headers @@ -80,9 +80,8 @@ django-object-actions==4.2.0 # via # -r requirements/base.in # openedx-ledger -django-simple-history==3.0.0 +django-simple-history==3.4.0 # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/base.in # openedx-ledger django-waffle==4.0.0 diff --git a/requirements/ci.txt b/requirements/ci.txt index 3365f1c1..24155e5b 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -24,7 +24,7 @@ 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 # tox-battery tox-battery==0.6.2 diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt new file mode 100644 index 00000000..5a86f013 --- /dev/null +++ b/requirements/common_constraints.txt @@ -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 diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 2ebd6ea6..a51cb08b 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -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 diff --git a/requirements/dev.txt b/requirements/dev.txt index 6cdcb809..2c1e7fe8 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -147,7 +147,7 @@ django-object-actions==4.2.0 # -r requirements/dev.in # -r requirements/validation.txt # openedx-ledger -django-simple-history==3.0.0 +django-simple-history==3.4.0 # via # -r requirements/validation.txt # openedx-ledger diff --git a/requirements/doc.txt b/requirements/doc.txt index e7650622..83a36627 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -90,7 +90,7 @@ distlib==0.3.7 # virtualenv django==3.2.21 # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt + # -c requirements/common_constraints.txt # -r requirements/test.txt # django-clearcache # django-cors-headers @@ -142,9 +142,8 @@ django-object-actions==4.2.0 # via # -r requirements/test.txt # openedx-ledger -django-simple-history==3.0.0 +django-simple-history==3.4.0 # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/test.txt # openedx-ledger django-waffle==4.0.0 @@ -593,7 +592,7 @@ tomlkit==0.12.1 # pylint 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/test.txt twine==4.0.2 # via -r requirements/doc.in diff --git a/requirements/production.txt b/requirements/production.txt index 622b6f84..32745e9e 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -96,7 +96,7 @@ django-object-actions==4.2.0 # via # -r requirements/base.txt # openedx-ledger -django-simple-history==3.0.0 +django-simple-history==3.4.0 # via # -r requirements/base.txt # openedx-ledger diff --git a/requirements/quality.txt b/requirements/quality.txt index bc431572..65d7b700 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -78,7 +78,7 @@ distlib==0.3.7 # virtualenv django==3.2.21 # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt + # -c requirements/common_constraints.txt # -r requirements/test.txt # django-clearcache # django-cors-headers @@ -130,9 +130,8 @@ django-object-actions==4.2.0 # via # -r requirements/test.txt # openedx-ledger -django-simple-history==3.0.0 +django-simple-history==3.4.0 # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/test.txt # openedx-ledger django-waffle==4.0.0 @@ -536,7 +535,7 @@ tomlkit==0.12.1 # pylint 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/test.txt twine==4.0.2 # via -r requirements/quality.in diff --git a/requirements/test.txt b/requirements/test.txt index ea63fa14..b3728f57 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -69,7 +69,7 @@ dill==0.3.7 distlib==0.3.7 # via virtualenv # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt + # -c requirements/common_constraints.txt # -r requirements/base.txt # django-clearcache # django-cors-headers @@ -121,9 +121,8 @@ django-object-actions==4.2.0 # via # -r requirements/base.txt # openedx-ledger -django-simple-history==3.0.0 +django-simple-history==3.4.0 # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/base.txt # openedx-ledger django-waffle==4.0.0 @@ -442,7 +441,7 @@ tomlkit==0.12.1 # via pylint 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/test.in types-pyyaml==6.0.12.11 # via responses diff --git a/requirements/validation.txt b/requirements/validation.txt index ae01a9a4..2f07dfce 100644 --- a/requirements/validation.txt +++ b/requirements/validation.txt @@ -160,7 +160,7 @@ django-object-actions==4.2.0 # -r requirements/quality.txt # -r requirements/test.txt # openedx-ledger -django-simple-history==3.0.0 +django-simple-history==3.4.0 # via # -r requirements/quality.txt # -r requirements/test.txt