Skip to content

Commit

Permalink
build: add common constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
UsamaSadiq committed Dec 22, 2023
1 parent 14105fe commit ae987cc
Show file tree
Hide file tree
Showing 17 changed files with 575 additions and 419 deletions.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,18 @@ html_coverage: ## generate and view HTML coverage report
subsidy_client_local: # re-install edx-enterprise-subsidy-client from local code
pip uninstall -y edx-enterprise-subsidy-client && pip install -e /edx/src/edx-enterprise-subsidy-client/ && pip freeze | grep subsidy-client

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 $(COMMON_CONSTRAINTS_TXT) ## 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<2.3//g' requirements/common_constraints.txt > requirements/common_constraints.tmp
mv requirements/common_constraints.tmp requirements/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
# Make sure to compile files after any other files they include!
sed -i.tmp 's/Django<4.0//g' requirements/common_constraints.txt
pip-compile --allow-unsafe --rebuild --upgrade -o requirements/pip.txt requirements/pip.in
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 3.2.21 on 2023-09-27 12:01

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('content_assignments', '0007_index_assignment_state'),
]

operations = [
migrations.AlterModelOptions(
name='historicalassignmentconfiguration',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical assignment configuration', 'verbose_name_plural': 'historical assignment configurations'},
),
migrations.AlterModelOptions(
name='historicallearnercontentassignment',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical learner content assignment', 'verbose_name_plural': 'historical learner content assignments'},
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Generated by Django 3.2.21 on 2023-09-27 12:01

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('content_assignments', '0008_auto_20230927_1201'),
('subsidy_access_policy', '0017_active_assignment_config_unique'),
]

operations = [
migrations.AlterModelOptions(
name='historicalassignedlearnercreditaccesspolicy',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical assigned learner credit access policy', 'verbose_name_plural': 'historical assigned learner credit access policys'},
),
migrations.AlterModelOptions(
name='historicalperlearnerenrollmentcreditaccesspolicy',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical per learner enrollment credit access policy', 'verbose_name_plural': 'historical per learner enrollment credit access policys'},
),
migrations.AlterModelOptions(
name='historicalperlearnerspendcreditaccesspolicy',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical per learner spend credit access policy', 'verbose_name_plural': 'historical per learner spend credit access policys'},
),
migrations.AlterModelOptions(
name='historicalsubsidyaccesspolicy',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical subsidy access policy', 'verbose_name_plural': 'historical subsidy access policys'},
),
migrations.AlterField(
model_name='subsidyaccesspolicy',
name='assignment_configuration',
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='subsidy_access_policy', to='content_assignments.assignmentconfiguration'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 3.2.21 on 2023-09-27 12:01

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('subsidy_request', '0011_subsidy_request_course_partners_jsonfield'),
]

operations = [
migrations.AlterModelOptions(
name='historicalcouponcoderequest',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical coupon code request', 'verbose_name_plural': 'historical coupon code requests'},
),
migrations.AlterModelOptions(
name='historicallicenserequest',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical license request', 'verbose_name_plural': 'historical license requests'},
),
migrations.AlterModelOptions(
name='historicalsubsidyrequestcustomerconfiguration',
options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical subsidy request customer configuration', 'verbose_name_plural': 'historical subsidy request customer configurations'},
),
]
3 changes: 3 additions & 0 deletions enterprise_access/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,3 +487,6 @@ def root(*path_fragments):
# Defines error bounds for allocation price validation
ALLOCATION_PRICE_VALIDATION_LOWER_BOUND_RATIO = .95
ALLOCATION_PRICE_VALIDATION_UPPER_BOUND_RATIO = 1.05

# disable indexing on history_date
SIMPLE_HISTORY_DATE_INDEX = False
79 changes: 40 additions & 39 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
#
# make upgrade
#
amqp==5.1.1
amqp==5.2.0
# via kombu
analytics-python==1.4.post1
# via -r requirements/base.in
asgiref==3.7.2
# via django
# via
# django
# django-cors-headers
async-timeout==4.0.3
# via redis
attrs==23.1.0
Expand All @@ -24,20 +26,20 @@ backports-zoneinfo[tzdata]==0.2.1
# celery
# django
# kombu
billiard==4.1.0
billiard==4.2.0
# via celery
celery==5.3.4
celery==5.3.6
# via
# -r requirements/base.in
# django-celery-results
# edx-celeryutils
certifi==2023.7.22
certifi==2023.11.17
# via requests
cffi==1.16.0
# via
# cryptography
# pynacl
charset-normalizer==3.3.1
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via
Expand All @@ -60,15 +62,15 @@ coreapi==2.3.3
# openapi-codec
coreschema==0.0.4
# via coreapi
cryptography==41.0.5
cryptography==41.0.7
# via
# pyjwt
# social-auth-core
defusedxml==0.8.0rc2
# via
# python3-openid
# social-auth-core
django==4.2.6
django==4.2.8
# via
# -r requirements/base.in
# django-celery-results
Expand Down Expand Up @@ -96,7 +98,7 @@ django==4.2.6
# social-auth-app-django
django-celery-results==2.5.1
# via -r requirements/base.in
django-cors-headers==4.3.0
django-cors-headers==4.3.1
# via -r requirements/base.in
django-crum==0.7.9
# via
Expand All @@ -105,7 +107,7 @@ django-crum==0.7.9
# edx-rbac
django-extensions==3.2.3
# via -r requirements/base.in
django-filter==23.3
django-filter==23.5
# via -r requirements/base.in
django-log-request-id==2.1.0
# via -r requirements/base.in
Expand All @@ -115,16 +117,14 @@ django-model-utils==4.3.1
# edx-rbac
django-rest-swagger==2.2.0
# via -r requirements/base.in
django-simple-history==3.0.0
# via
# -c requirements/common_constraints.txt
# -r requirements/base.in
django-waffle==4.0.0
django-simple-history==3.4.0
# via -r requirements/base.in
django-waffle==4.1.0
# via
# -r requirements/base.in
# edx-django-utils
# edx-drf-extensions
djangoql==0.17.1
djangoql==0.18.0
# via -r requirements/base.in
djangorestframework==3.14.0
# via
Expand All @@ -137,7 +137,7 @@ djangorestframework==3.14.0
# edx-drf-extensions
drf-jwt==1.19.2
# via edx-drf-extensions
drf-spectacular==0.26.5
drf-spectacular==0.27.0
# via -r requirements/base.in
drf-yasg==1.21.7
# via edx-api-doc-tools
Expand All @@ -151,16 +151,16 @@ edx-celeryutils==1.2.3
# via -r requirements/base.in
edx-django-release-util==1.3.0
# via -r requirements/base.in
edx-django-utils==5.7.0
edx-django-utils==5.9.0
# via
# -r requirements/base.in
# edx-drf-extensions
# edx-rest-api-client
edx-drf-extensions==8.13.0
edx-drf-extensions==9.0.1
# via
# -r requirements/base.in
# edx-rbac
edx-enterprise-subsidy-client==0.4.0
edx-enterprise-subsidy-client==0.4.1
# via -r requirements/base.in
edx-opaque-keys[django]==2.5.1
# via
Expand All @@ -172,13 +172,13 @@ edx-rest-api-client==5.6.1
# via
# -r requirements/base.in
# edx-enterprise-subsidy-client
fastavro==1.9.0
fastavro==1.9.2
# via
# -r requirements/base.in
# openedx-events
idna==3.4
idna==3.6
# via requests
importlib-resources==6.1.0
importlib-resources==6.1.1
# via
# jsonschema
# jsonschema-specifications
Expand All @@ -194,39 +194,39 @@ jsonfield==3.1.0
# via edx-celeryutils
jsonfield2==4.0.0.post0
# via -r requirements/base.in
jsonschema==4.19.2
jsonschema==4.20.0
# via drf-spectacular
jsonschema-specifications==2023.7.1
jsonschema-specifications==2023.11.2
# via jsonschema
kombu==5.3.2
kombu==5.3.4
# via celery
markupsafe==2.1.3
# via jinja2
monotonic==1.6
# via analytics-python
mysqlclient==2.2.0
mysqlclient==2.2.1
# via -r requirements/base.in
newrelic==9.1.1
newrelic==9.3.0
# via edx-django-utils
oauthlib==3.2.2
# via
# requests-oauthlib
# social-auth-core
openapi-codec==1.3.2
# via django-rest-swagger
openedx-events==9.0.1
openedx-events==9.2.0
# via -r requirements/base.in
packaging==23.2
# via drf-yasg
pbr==5.11.1
pbr==6.0.0
# via stevedore
pkgutil-resolve-name==1.3.10
# via jsonschema
ply==3.11
# via djangoql
prompt-toolkit==3.0.39
prompt-toolkit==3.0.43
# via click-repl
psutil==5.9.6
psutil==5.9.7
# via edx-django-utils
pycparser==2.21
# via cffi
Expand Down Expand Up @@ -262,7 +262,7 @@ pyyaml==6.0.1
# edx-django-release-util
redis==5.0.1
# via -r requirements/base.in
referencing==0.30.2
referencing==0.32.0
# via
# jsonschema
# jsonschema-specifications
Expand All @@ -277,7 +277,7 @@ requests==2.31.0
# social-auth-core
requests-oauthlib==1.3.1
# via social-auth-core
rpds-py==0.10.6
rpds-py==0.15.2
# via
# jsonschema
# referencing
Expand All @@ -298,7 +298,7 @@ slumber==0.7.1
# via edx-rest-api-client
social-auth-app-django==5.4.0
# via edx-auth-backends
social-auth-core==4.5.0
social-auth-core==4.5.1
# via
# edx-auth-backends
# social-auth-app-django
Expand All @@ -308,9 +308,10 @@ stevedore==5.1.0
# via
# edx-django-utils
# edx-opaque-keys
typing-extensions==4.8.0
typing-extensions==4.9.0
# via
# asgiref
# drf-spectacular
# edx-opaque-keys
# kombu
tzdata==2023.3
Expand All @@ -322,14 +323,14 @@ uritemplate==4.1.1
# coreapi
# drf-spectacular
# drf-yasg
urllib3==2.0.7
urllib3==2.1.0
# via requests
vine==5.0.0
vine==5.1.0
# via
# amqp
# celery
# kombu
wcwidth==0.2.9
wcwidth==0.2.12
# via prompt-toolkit
zipp==3.17.0
# via importlib-resources
5 changes: 1 addition & 4 deletions requirements/common_constraints.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# A central location for most common version constraints
# (across edx repos) for pip-installation.
#
Expand All @@ -20,8 +21,4 @@
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
Loading

0 comments on commit ae987cc

Please sign in to comment.