Skip to content

Commit

Permalink
Merge pull request #42 from edx/BOM-1077
Browse files Browse the repository at this point in the history
Added support for Django 2.2
  • Loading branch information
mraarif authored Dec 3, 2019
2 parents fbdb8f6 + 0dc2ed1 commit 65bb9e9
Show file tree
Hide file tree
Showing 16 changed files with 157 additions and 139 deletions.
24 changes: 15 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
language: python

python:
- 2.7
- 3.6
- 2.7
- 3.5

env:
- TOXENV=django111
- TOXENV=django111

matrix:
include:
- python: 3.6
- python: 3.5
env: TOXENV=quality
- python: 3.5
env: TOXENV=django20
- python: 3.5
env: TOXENV=django21
- python: 3.5
env: TOXENV=django22

before_install:
- export DJANGO_SETTINGS_MODULE=settings
- export DJANGO_SETTINGS_MODULE=settings

install:
- make requirements
- pip freeze --all
- make requirements
- pip freeze --all

script:
- make test
- make test

after_success: codecov

Expand All @@ -30,7 +36,7 @@ deploy:
distributions: sdist bdist_wheel
on:
tags: true
python: 3.6
python: 3.5
condition: '$TOXENV = django111'
password:
secure: oVeS9OrvR5XvJMg86eO004xk9KFh9IbUxWqyWYYFZf1drtrzG2Bm7+F0BgF1hY2l+qyHXinPCCeBmV9CEfav80se1r8K0JFu9MwBHQkvaeBAJV+ItQ2ZumtgNNONoL5VZHIRbEYwl/lbZCWaXpmDLkJSlRVYCECP2bH+RcZkbQM=
2 changes: 1 addition & 1 deletion milestones/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"""
from __future__ import unicode_literals

__version__ = '0.2.5'
__version__ = '0.2.6'
5 changes: 3 additions & 2 deletions milestones/data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# pylint: disable=no-member,expression-not-assigned
# pylint: disable=inconsistent-return-statements
"""
Application data management/abstraction layer. Responsible for:
Expand Down Expand Up @@ -230,7 +231,7 @@ def create_course_milestone(course_key, relationship, milestone):
if not relationship.active:
_activate_record(relationship)
except internal.CourseMilestone.DoesNotExist:
relationship = internal.CourseMilestone.objects.create(
internal.CourseMilestone.objects.create(
course_id=six.text_type(course_key),
milestone=milestone_obj,
milestone_relationship_type=relationship_type,
Expand Down Expand Up @@ -310,7 +311,7 @@ def create_course_content_milestone(course_key, content_key, relationship, miles
relationship.requirements = requirements
relationship.save()
except internal.CourseContentMilestone.DoesNotExist:
relationship = internal.CourseContentMilestone.objects.create(
internal.CourseContentMilestone.objects.create(
course_id=six.text_type(course_key),
content_id=six.text_type(content_key),
milestone=milestone_obj,
Expand Down
10 changes: 5 additions & 5 deletions milestones/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Migration(migrations.Migration):
('source', models.TextField(blank=True)),
('collected', models.DateTimeField(null=True, blank=True)),
('active', models.BooleanField(default=True)),
('milestone', models.ForeignKey(to='milestones.Milestone')),
('milestone', models.ForeignKey(to='milestones.Milestone', on_delete=django.db.models.CASCADE)),
],
),
migrations.AlterUniqueTogether(
Expand All @@ -81,22 +81,22 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='coursemilestone',
name='milestone',
field=models.ForeignKey(to='milestones.Milestone'),
field=models.ForeignKey(to='milestones.Milestone', on_delete=django.db.models.CASCADE),
),
migrations.AddField(
model_name='coursemilestone',
name='milestone_relationship_type',
field=models.ForeignKey(to='milestones.MilestoneRelationshipType'),
field=models.ForeignKey(to='milestones.MilestoneRelationshipType', on_delete=django.db.models.CASCADE),
),
migrations.AddField(
model_name='coursecontentmilestone',
name='milestone',
field=models.ForeignKey(to='milestones.Milestone'),
field=models.ForeignKey(to='milestones.Milestone', on_delete=django.db.models.CASCADE),
),
migrations.AddField(
model_name='coursecontentmilestone',
name='milestone_relationship_type',
field=models.ForeignKey(to='milestones.MilestoneRelationshipType'),
field=models.ForeignKey(to='milestones.MilestoneRelationshipType', on_delete=django.db.models.CASCADE),
),
migrations.AlterUniqueTogether(
name='usermilestone',
Expand Down
12 changes: 7 additions & 5 deletions milestones/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ class CourseMilestone(TimeStampedModel):
the Milestone, such as "requires".
"""
course_id = models.CharField(max_length=255, db_index=True)
milestone = models.ForeignKey(Milestone, db_index=True)
milestone_relationship_type = models.ForeignKey(MilestoneRelationshipType, db_index=True)
milestone = models.ForeignKey(Milestone, db_index=True, on_delete=models.CASCADE)
milestone_relationship_type = models.ForeignKey(MilestoneRelationshipType, db_index=True,
on_delete=models.CASCADE)
active = models.BooleanField(default=True, db_index=True)

class Meta:
Expand All @@ -116,8 +117,9 @@ class CourseContentMilestone(TimeStampedModel):
"""
course_id = models.CharField(max_length=255, db_index=True)
content_id = models.CharField(max_length=255, db_index=True)
milestone = models.ForeignKey(Milestone, db_index=True)
milestone_relationship_type = models.ForeignKey(MilestoneRelationshipType, db_index=True)
milestone = models.ForeignKey(Milestone, db_index=True, on_delete=models.CASCADE)
milestone_relationship_type = models.ForeignKey(MilestoneRelationshipType, db_index=True,
on_delete=models.CASCADE)
requirements = models.CharField(
max_length=255,
blank=True,
Expand Down Expand Up @@ -151,7 +153,7 @@ class UserMilestone(TimeStampedModel):
collection of the milestone by this user.
"""
user_id = models.IntegerField(db_index=True)
milestone = models.ForeignKey(Milestone, db_index=True)
milestone = models.ForeignKey(Milestone, db_index=True, on_delete=models.CASCADE)
source = models.TextField(blank=True)
collected = models.DateTimeField(blank=True, null=True)
active = models.BooleanField(default=True, db_index=True)
Expand Down
2 changes: 1 addition & 1 deletion milestones/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"""
from __future__ import absolute_import, unicode_literals

import six
from opaque_keys.edx.keys import UsageKey

import milestones.api as api
import milestones.exceptions as exceptions
import milestones.tests.utils as utils
import six


class MilestonesApiTestCase(utils.MilestonesTestCaseMixin, utils.MilestonesTestCaseBase):
Expand Down
4 changes: 3 additions & 1 deletion milestones/tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
Note: 'Unit Test: ' labels are output to the console during test runs
"""
from __future__ import absolute_import, unicode_literals

import six

import milestones.api as api
import milestones.data as data
import milestones.exceptions as exceptions
import milestones.tests.utils as utils
import six


class MilestonesDataTestCase(utils.MilestonesTestCaseBase):
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Core requirements for using this application
-c constraints.txt

Django>=1.11,<2.0 # Web application framework
Django>=1.11 # Web application framework
django-model-utils # Provides TimeStampedModel abstract base class
edx-opaque-keys>=0.2.1 # Create and introspect course and xblock identities
six # Utilities for supporting Python 2 & 3 in the same codebase
16 changes: 8 additions & 8 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#
# make upgrade
#
django-model-utils==3.1.2
django==1.11.21
edx-opaque-keys==1.0.1
pbr==5.2.1 # via stevedore
pymongo==3.8.0 # via edx-opaque-keys
pytz==2019.1 # via django
six==1.12.0
stevedore==1.30.1 # via edx-opaque-keys
django-model-utils==3.2.0
django==1.11.26
edx-opaque-keys==2.0.1
pbr==5.4.4 # via stevedore
pymongo==3.9.0 # via edx-opaque-keys
pytz==2019.3 # via django
six==1.13.0
stevedore==1.31.0 # via edx-opaque-keys
83 changes: 42 additions & 41 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,67 @@
# make upgrade
#
argparse==1.4.0
astroid==1.5.3
backports.functools-lru-cache==1.5
caniusepython3==7.1.0
certifi==2019.3.9
astroid==1.6.6
backports.functools-lru-cache==1.6.1
caniusepython3==7.2.0
certifi==2019.9.11
chardet==3.0.4
click-log==0.3.2
click==7.0
code-annotations==0.3.1
code-annotations==0.3.2
codecov==2.0.15
configparser==3.7.4
contextlib2==0.5.5
coverage==4.5.3
distlib==0.2.9.post0
django-model-utils==3.1.2
configparser==4.0.2
contextlib2==0.6.0.post1
coverage==4.5.4
distlib==0.3.0
django-model-utils==3.2.0
django-nose==1.4.6
django==1.11.21
edx-lint==1.3.0
edx-opaque-keys==1.0.1
django==1.11.26
edx-lint==1.4.1
edx-opaque-keys==2.0.1
enum34==1.1.6
filelock==3.0.12
futures==3.2.0 ; python_version == "2.7"
futures==3.3.0 ; python_version == "2.7"
idna==2.8
importlib-metadata==0.18
isort==4.3.20
jinja2==2.10.1
lazy-object-proxy==1.4.1
importlib-metadata==0.23
isort==4.3.21
jinja2==2.10.3
lazy-object-proxy==1.4.3
markupsafe==1.1.1
mccabe==0.6.1
more-itertools==5.0.0
nose==1.3.7
packaging==19.0
pathlib2==2.3.3
pbr==5.2.1
pip-tools==3.8.0
pluggy==0.12.0
packaging==19.2
pathlib2==2.3.5
pbr==5.4.4
pip-tools==4.3.0
pluggy==0.13.1
py==1.8.0
pycodestyle==2.5.0
pydocstyle==3.0.0
pylint-celery==0.3
pylint-django==0.7.2
pylint-plugin-utils==0.5
pylint==1.7.6
pymongo==3.8.0
pyparsing==2.4.0
python-slugify==3.0.2
pytz==2019.1
pyyaml==5.1.1
pylint-django==0.11.1
pylint-plugin-utils==0.6
pylint==1.9.5
pymongo==3.9.0
pyparsing==2.4.5
python-slugify==4.0.0
pytz==2019.3
pyyaml==5.1.2
requests==2.22.0
scandir==1.10.0
singledispatch==3.4.0.3
six==1.12.0
snowballstemmer==1.2.1
stevedore==1.30.1
text-unidecode==1.2
six==1.13.0
snowballstemmer==2.0.0
stevedore==1.31.0
text-unidecode==1.3
toml==0.10.0
tox-battery==0.5.1
tox==3.12.1
urllib3==1.25.3
virtualenv==16.6.0
wrapt==1.11.1
zipp==0.5.1
tox==3.14.1
urllib3==1.25.7
virtualenv==16.7.8
wrapt==1.11.2
zipp==0.6.0

# The following packages are considered to be unsafe in a requirements file:
# setuptools==41.0.1 # via caniusepython3, tox
# setuptools==42.0.1 # via caniusepython3
4 changes: 2 additions & 2 deletions requirements/pip-tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
# make upgrade
#
click==7.0 # via pip-tools
pip-tools==3.8.0
six==1.12.0 # via pip-tools
pip-tools==4.3.0
six==1.13.0 # via pip-tools
Loading

0 comments on commit 65bb9e9

Please sign in to comment.