Skip to content

Commit

Permalink
Merge pull request #37 from open-craft/agrendalath/fix_migrations
Browse files Browse the repository at this point in the history
fix: add missing migration
  • Loading branch information
Agrendalath authored Nov 15, 2023
2 parents 359df3e + 6e53872 commit 77c3bd3
Show file tree
Hide file tree
Showing 11 changed files with 84 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [quality, pii_check, package]
toxenv: [quality, pii_check, package, migrations]

steps:
- uses: actions/checkout@v3
Expand Down
22 changes: 21 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,31 @@ Change Log
Unreleased
**********

[0.4.2] - 2023-11-15
********************

Changed
=======

* Upgraded tox from ``v3`` to ``v4`` and removed ``tox-battery``.

Added
=====

* Created a new test for missing migrations and added it to the CI.

Fixed
=====

* Added a missing Django migration.
* Replaced the invalid ``ROOT_URLCONF`` in ``test_settings.py``.
* Made ``./manage.py`` executable.

[0.4.1] - 2023-11-07
********************

Fixed
=======
=====

* Compatibility of ``compat`` imports with Palm.

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.PHONY: clean compile_translations coverage diff_cover dummy_translations \
extract_translations fake_translations help pii_check pull_translations push_translations \
quality requirements selfcheck test_integration test_package upgrade validate install_transifex_client
quality requirements selfcheck test_integration test_package test_migrations upgrade validate \
install_transifex_client

.DEFAULT_GOAL := help

Expand Down Expand Up @@ -54,6 +55,9 @@ pii_check: ## check for PII annotations on all Django models
test_package: ## check if the Python package is formatted correctly
tox -e package

test_migrations: ## check that Django migrations reflect all model changes
tox -e migrations

piptools: ## install pinned version of pip-compile and pip-sync
pip install -r requirements/pip.txt
pip install -r requirements/pip-tools.txt
Expand Down
Empty file modified manage.py
100644 → 100755
Empty file.
1 change: 0 additions & 1 deletion requirements/ci.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
-c constraints.txt

tox # Virtualenv management for tests
tox-battery # Makes tox aware of requirements file changes
16 changes: 8 additions & 8 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
#
# make upgrade
#
cachetools==5.3.2
# via tox
chardet==5.2.0
# via tox
colorama==0.4.6
# via tox
distlib==0.3.7
# via virtualenv
filelock==3.13.1
Expand All @@ -21,19 +27,13 @@ platformdirs==3.11.0
# virtualenv
pluggy==1.3.0
# via tox
py==1.11.0
# via tox
six==1.16.0
pyproject-api==1.6.1
# via tox
tomli==2.0.1
# via
# pyproject-api
# tox
tox==3.28.0
# via
# -r requirements/ci.in
# tox-battery
tox-battery==0.6.2
tox==4.11.3
# via -r requirements/ci.in
virtualenv==20.24.6
# via tox
32 changes: 20 additions & 12 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ build==1.0.3
# via
# -r requirements/pip-tools.txt
# pip-tools
cachetools==5.3.2
# via
# -r requirements/ci.txt
# tox
certifi==2023.7.22
# via
# -r requirements/quality.txt
Expand All @@ -27,7 +31,10 @@ cffi==1.16.0
# cryptography
# pynacl
chardet==5.2.0
# via diff-cover
# via
# -r requirements/ci.txt
# diff-cover
# tox
charset-normalizer==3.3.2
# via
# -r requirements/quality.txt
Expand All @@ -49,6 +56,10 @@ code-annotations==1.5.0
# via
# -r requirements/quality.txt
# edx-lint
colorama==0.4.6
# via
# -r requirements/ci.txt
# tox
coverage[toml]==7.3.2
# via
# -r requirements/quality.txt
Expand Down Expand Up @@ -188,6 +199,7 @@ packaging==23.2
# -r requirements/pip-tools.txt
# -r requirements/quality.txt
# build
# pyproject-api
# pytest
# tox
path==16.7.1
Expand All @@ -208,6 +220,7 @@ platformdirs==3.11.0
# -r requirements/ci.txt
# -r requirements/quality.txt
# pylint
# tox
# virtualenv
pluggy==1.3.0
# via
Expand All @@ -222,10 +235,6 @@ psutil==5.9.6
# via
# -r requirements/quality.txt
# edx-django-utils
py==1.11.0
# via
# -r requirements/ci.txt
# tox
pycodestyle==2.11.1
# via -r requirements/quality.txt
pycparser==2.21
Expand Down Expand Up @@ -270,6 +279,10 @@ pynacl==1.5.0
# via
# -r requirements/quality.txt
# edx-django-utils
pyproject-api==1.6.1
# via
# -r requirements/ci.txt
# tox
pyproject-hooks==1.0.0
# via
# -r requirements/pip-tools.txt
Expand Down Expand Up @@ -312,11 +325,9 @@ semantic-version==2.10.0
# edx-drf-extensions
six==1.16.0
# via
# -r requirements/ci.txt
# -r requirements/quality.txt
# edx-lint
# python-dateutil
# tox
snowballstemmer==2.2.0
# via
# -r requirements/quality.txt
Expand Down Expand Up @@ -344,18 +355,15 @@ tomli==2.0.1
# coverage
# pip-tools
# pylint
# pyproject-api
# pyproject-hooks
# pytest
# tox
tomlkit==0.12.3
# via
# -r requirements/quality.txt
# pylint
tox==3.28.0
# via
# -r requirements/ci.txt
# tox-battery
tox-battery==0.6.2
tox==4.11.3
# via -r requirements/ci.txt
typing-extensions==4.8.0
# via
Expand Down
2 changes: 1 addition & 1 deletion section_to_course/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Factors sections from Open edX courses into their own new course.
"""

__version__ = '0.4.1'
__version__ = '0.4.2'
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 3.2.23 on 2023-11-15 10:05

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

dependencies = [
('section_to_course', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='sectiontocourselink',
name='last_refresh',
field=models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True),
),
]
2 changes: 1 addition & 1 deletion test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def root(*args):
root('section_to_course', 'conf', 'locale'),
]

ROOT_URLCONF = 'section_to_course.urls'
ROOT_URLCONF = 'section_to_course.api.urls'

SECRET_KEY = 'insecure-secret-key'

Expand Down
9 changes: 8 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ django_find_project = false
[testenv:quality]
setenv =
DJANGO_SETTINGS_MODULE = test_settings
whitelist_externals =
allowlist_externals =
make
rm
touch
Expand Down Expand Up @@ -67,3 +67,10 @@ commands =
python -m build
twine check dist/*

[testenv:migrations]
allowlist_externals =
./manage.py
deps =
-r{toxinidir}/requirements/base.txt
commands =
./manage.py makemigrations section_to_course --check --dry-run --verbosity 3

0 comments on commit 77c3bd3

Please sign in to comment.