Skip to content

Commit

Permalink
chore: cleanup django32
Browse files Browse the repository at this point in the history
  • Loading branch information
aht007 committed Feb 16, 2022
1 parent f5a246f commit e4b1dc4
Show file tree
Hide file tree
Showing 21 changed files with 268 additions and 268 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [django22, django30, django31, django32, quality]
toxenv: [django32, quality]

steps:
- uses: actions/checkout@v2
Expand All @@ -36,8 +36,8 @@ jobs:
run: tox

- name: Run Coverage
if: matrix.python-version == '3.8' && matrix.toxenv=='django22'
uses: codecov/codecov-action@v1
if: matrix.python-version == '3.8' && matrix.toxenv=='django32'
uses: codecov/codecov-action@v2
with:
flags: unittests
fail_ci_if_error: true
Expand All @@ -62,6 +62,7 @@ jobs:

- name: Install Dependencies
run: |
pip install "Django<4.0"
pip install -r requirements/ci.txt
pip install -r requirements/test.txt
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ coverage: clean ## generate and view HTML coverage report
coverage report html
$(BROWSER) htmlcov/index.html

export CUSTOM_COMPILE_COMMAND = make upgrade
upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
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 "$(@)"


upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
pip install -q pip-tools
pip-compile --rebuild --upgrade --allow-unsafe -o requirements/pip.txt requirements/pip.in
pip-compile --rebuild --upgrade -o requirements/dev.txt requirements/base.in requirements/dev.in requirements/quality.in requirements/test.in requirements/ci.in
Expand Down
2 changes: 1 addition & 1 deletion edxval/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
init
"""

__version__ = '2.1.1'
__version__ = '2.2.0'
5 changes: 2 additions & 3 deletions edxval/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -994,9 +994,8 @@ def create_transcripts_xml(video_id, video_el, resource_fs, static_dir):
static_file_dir = combine(resource_fs._sub_dir.split('/')[1], static_dir) # pylint: disable=protected-access
except KeyError:
logger.exception(
"VAL Transcript Export: Error creating static directory path for video {} in file system {}".format(
video_id, resource_fs
)
"VAL Transcript Export: Error creating static directory path for video %s in file system %s",
video_id, resource_fs
)

transcript_files_map = {}
Expand Down
2 changes: 1 addition & 1 deletion edxval/pacts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ def provider_state(request):
state = request_body.get('state')
clear_database()
if state in state_setup_mapping:
logger.info('Setting up provider state for state value: {}'.format(state))
logger.info('Setting up provider state for state value: %s', state)
state_setup_mapping[state]()
return JsonResponse({'result': state})
8 changes: 7 additions & 1 deletion edxval/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class SortedVideoTestMixin:
"""
Test Mixin for testing api functions that sort the returned videos.
"""

def _check_sort(self, api_func, sort_field, expected_ids_for_asc):
"""
Assert that sorting by given field returns videos in the expected
Expand Down Expand Up @@ -295,6 +296,7 @@ class GetVideoInfoTest(TestCase):
"""
Tests for our `get_video_info` and `is_video_available` methods in api.py
"""

def setUp(self):
"""
Creates EncodedVideo objects in database
Expand Down Expand Up @@ -1038,6 +1040,7 @@ class ExportTest(TestCase):
"""
Tests export_to_xml method.
"""

def setUp(self):
super().setUp()
mobile_profile = Profile.objects.create(profile_name=constants.PROFILE_MOBILE)
Expand Down Expand Up @@ -1260,7 +1263,7 @@ def test_transcript_export(self):
)

# Also verify the content of created transcript file.
for language_code in transcript_files.keys(): # pylint: disable=consider-iterating-dictionary
for language_code in transcript_files.keys():
expected_transcript_content = File(
open(combine(expected_transcript_path, transcript_files[language_code]), 'rb')
).read()
Expand Down Expand Up @@ -2624,6 +2627,7 @@ class TranscriptTest(TestCase):
"""
Tests to check transcript related functions.
"""

def setUp(self):
"""
Creates video and video transcript objects.
Expand Down Expand Up @@ -3135,6 +3139,7 @@ class TranscriptPreferencesTest(TestCase):
"""
TranscriptPreferences API Tests
"""

def setUp(self):
"""
Tests setup
Expand Down Expand Up @@ -3234,6 +3239,7 @@ class TranscripCredentialsStateTest(TestCase):
"""
ThirdPartyTranscriptCredentialsState Tests
"""

def setUp(self):
"""
Tests setup
Expand Down
40 changes: 16 additions & 24 deletions edxval/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,34 @@
Url file for django app edxval.
"""
from django.conf import settings
from django.conf.urls import url
from django.urls import path, re_path

from edxval import views

urlpatterns = [
url(r'^videos/$', views.VideoList.as_view(), name='video-list'),
url(
path('videos/', views.VideoList.as_view(), name='video-list'),
re_path(
r'^videos/(?P<edx_video_id>[-\w]+)$',
views.VideoDetail.as_view(),
name='video-detail'
),
url(
r'^videos/status/$',
views.VideoStatusView.as_view(),
name='video-status-update'
),
url(
r'^videos/missing-hls/$',
views.HLSMissingVideoView.as_view(),
name='hls-missing-video'
),
url(
r'^videos/video-transcripts/create/$',
views.VideoTranscriptView.as_view(),
name='create-video-transcript'
),
url(
r'^videos/video-images/update/$',
views.VideoImagesView.as_view(),
name='update-video-images'
),
path('videos/status/', views.VideoStatusView.as_view(),
name='video-status-update'
),
path('videos/missing-hls/', views.HLSMissingVideoView.as_view(),
name='hls-missing-video'
),
path('videos/video-transcripts/create/', views.VideoTranscriptView.as_view(),
name='create-video-transcript'
),
path('videos/video-images/update/', views.VideoImagesView.as_view(),
name='update-video-images'
),
]

if getattr(settings, 'PROVIDER_STATES_SETUP_VIEW_URL', None):
from edxval.pacts.views import provider_state
urlpatterns.append(url(
urlpatterns.append(re_path(
r'^pact/provider_states/$',
provider_state,
name='provider-state-view'
Expand Down
11 changes: 3 additions & 8 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
# SERIOUSLY.
#
# ------------------------------
# Generated by edx-lint version: 5.2.0
# Generated by edx-lint version: 5.2.1
# ------------------------------
[MASTER]
ignore = migrations
Expand Down Expand Up @@ -347,31 +347,26 @@ disable =
illegal-waffle-usage,

apply-builtin,
arguments-renamed,
backtick,
bad-python3-import,
basestring-builtin,
buffer-builtin,
cmp-builtin,
coerce-builtin,
consider-using-with,
consider-using-dict-items,
deprecated-itertools-function,
deprecated-operator-function,
deprecated-str-translate-call,
deprecated-string-function,
deprecated-sys-function,
deprecated-types-field,
deprecated-urllib-function,
django-not-configured,
execfile-builtin,
file-builtin,
import-star-module-level,
input-builtin,
intern-builtin,
long-builtin,
long-suffix,
logging-format-interpolation,
no-absolute-import,
non-ascii-bytes-literal,
old-division,
Expand All @@ -389,7 +384,7 @@ disable =
unpacking-in-except,
xrange-builtin,

logging-fstring-interpolation,,unicode-format-string
logging-fstring-interpolation,,unicode-format-string, consider-using-with, consider-using-dict-items, django-not-configured, consider-iterating-dictionary, arguments-renamed

[REPORTS]
output-format = text
Expand Down Expand Up @@ -489,4 +484,4 @@ int-import-graph =
[EXCEPTIONS]
overgeneral-exceptions = Exception

# d35caa73d5e9cdd723db6da1cbbcb9a8350a0d67
# 78bc3e16fc1c904ee9cb8b492042ab19d872e910
2 changes: 1 addition & 1 deletion pylintrc_tweaks
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ max-line-length = 120

[MESSAGES CONTROL]
# Disable unicode-format-string
disable+ = ,unicode-format-string
disable+ = ,unicode-format-string, consider-using-with, consider-using-dict-items, django-not-configured, consider-iterating-dictionary, arguments-renamed
4 changes: 2 additions & 2 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
-c constraints.txt

boto
Django>=1.11
django-fernet-fields
Django
djfernet
django-model-utils
django-storages
edx-drf-extensions
Expand Down
22 changes: 10 additions & 12 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,49 @@
#
# make upgrade
#
backports.entry-points-selectable==1.1.1
# via virtualenv
certifi==2021.10.8
# via requests
charset-normalizer==2.0.8
charset-normalizer==2.0.11
# via requests
coverage==6.2
coverage==6.3.1
# via coveralls
coveralls==3.3.1
# via -r requirements/ci.in
distlib==0.3.3
distlib==0.3.4
# via virtualenv
docopt==0.6.2
# via coveralls
filelock==3.4.0
filelock==3.4.2
# via
# tox
# virtualenv
idna==3.3
# via requests
packaging==21.3
# via tox
platformdirs==2.4.0
platformdirs==2.4.1
# via virtualenv
pluggy==1.0.0
# via tox
py==1.11.0
# via tox
pyparsing==3.0.6
pyparsing==3.0.7
# via packaging
requests==2.26.0
requests==2.27.1
# via coveralls
six==1.16.0
# via
# tox
# virtualenv
toml==0.10.2
# via tox
tox==3.24.4
tox==3.24.5
# via
# -r requirements/ci.in
# tox-battery
tox-battery==0.6.1
# via -r requirements/ci.in
urllib3==1.26.7
urllib3==1.26.8
# via requests
virtualenv==20.10.0
virtualenv==20.13.1
# via tox
22 changes: 22 additions & 0 deletions requirements/common_constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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

setuptools<60
2 changes: 1 addition & 1 deletion requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +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
Loading

0 comments on commit e4b1dc4

Please sign in to comment.