Skip to content

Commit

Permalink
Merge pull request #195 from edx/jawayria/django32_support
Browse files Browse the repository at this point in the history
feat: Added support for django32
  • Loading branch information
iamsobanjaved authored Oct 6, 2021
2 parents 9a43bc4 + 87c1179 commit 131e396
Show file tree
Hide file tree
Showing 15 changed files with 124 additions and 52 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Python CI

on:
push:
branches: [master]
pull_request:
branches:
- '**'

jobs:
run_tests:
name: Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [py38-django22, py38-django30, py38-django31, py38-django32, quality]

steps:
- uses: actions/checkout@v2
- name: setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install pip
run: pip install -r requirements/pip.txt

- name: Install Dependencies
run: pip install -r requirements/ci.txt

- name: Run Tests
env:
TOXENV: ${{ matrix.toxenv }}
run: tox

- name: Run Coverage
if: matrix.python-version == '3.8' && matrix.toxenv=='py38-django22'
uses: codecov/codecov-action@v1
with:
flags: unittests
fail_ci_if_error: true

32 changes: 32 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish package to PyPi

on:
push:
tags:
- '*'

jobs:

push:
runs-on: ubuntu-20.04

steps:
- name: Checkout
uses: actions/checkout@v2
- name: setup python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install pip
run: pip install -r requirements/pip.txt

- name: Build package
run: python setup.py sdist bdist_wheel

- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}

22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ $(COMMON_CONSTRAINTS_TXT):
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 -r requirements/pip_tools.txt
pip-compile --upgrade --allow-unsafe -o requirements/pip.txt requirements/pip.in
pip-compile --upgrade -o requirements/pip_tools.txt requirements/pip_tools.in
pip-compile --upgrade -o requirements/base.txt requirements/base.in
pip-compile --upgrade -o requirements/dev.txt requirements/dev.in
pip-compile --upgrade -o requirements/test.txt requirements/test.in
pip-compile --upgrade -o requirements/tox.txt requirements/tox.in
pip-compile --upgrade -o requirements/travis.txt requirements/travis.in
pip-compile --upgrade -o requirements/ci.txt requirements/ci.in
# Let tox control the Django version version for tests
grep -e "^django==" requirements/test.txt > requirements/django.txt
sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,8 @@ Changelog
* LTI 1.3 support.


.. |Build Status| image:: https://travis-ci.com/edx/xblock-lti-consumer.svg
:target: https://travis-ci.com/edx/xblock-lti-consumer
.. |Build Status| image:: https://github.com/edx/xblock-lti-consumer/workflows/Python%20CI/badge.svg?branch=master
:target: https://github.com/edx/xblock-lti-consumer/actions?query=workflow%3A%22Python+CI%22

.. |Coveralls| image:: https://coveralls.io/repos/edx/xblock-lti-consumer/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/edx/xblock-lti-consumer?branch=master
2 changes: 1 addition & 1 deletion lti_consumer/plugin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def public_keyset_endpoint(request, usage_id=None):


@require_http_methods(["GET", "POST"])
def launch_gate_endpoint(request, suffix):
def launch_gate_endpoint(request, suffix=None):
"""
Gate endpoint that triggers LTI launch endpoint XBlock handler
Expand Down
5 changes: 5 additions & 0 deletions requirements/ci.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Requirements for running tests in Github Actions
-c constraints.txt

-r test.txt
-r tox.txt
14 changes: 3 additions & 11 deletions requirements/travis.txt → requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ bleach==4.1.0
# via
# -r requirements/test.txt
# readme-renderer
boto3==1.18.30
boto3==1.18.31
# via
# -r requirements/test.txt
# fs-s3fs
botocore==1.21.30
botocore==1.21.31
# via
# -r requirements/test.txt
# boto3
Expand Down Expand Up @@ -62,10 +62,6 @@ coverage==5.5
# coveralls
coveralls==3.2.0
# via -r requirements/test.txt
cryptography==3.4.8
# via
# -r requirements/test.txt
# secretstorage
ddt==1.4.2
# via -r requirements/test.txt
distlib==0.3.2
Expand Down Expand Up @@ -145,7 +141,7 @@ idna==3.2
# via
# -r requirements/test.txt
# requests
importlib-metadata==4.6.3
importlib-metadata==4.8.1
# via
# -r requirements/test.txt
# keyring
Expand Down Expand Up @@ -317,10 +313,6 @@ s3transfer==0.5.0
# via
# -r requirements/test.txt
# boto3
secretstorage==3.3.1
# via
# -r requirements/test.txt
# keyring
simplejson==3.17.5
# via
# -r requirements/test.txt
Expand Down
5 changes: 5 additions & 0 deletions requirements/pip.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Core dependencies for installing other packages

pip
setuptools
wheel
14 changes: 14 additions & 0 deletions requirements/pip.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# make upgrade
#
wheel==0.37.0
# via -r requirements/pip.in

# The following packages are considered to be unsafe in a requirements file:
pip==21.2.4
# via -r requirements/pip.in
setuptools==57.4.0
# via -r requirements/pip.in
10 changes: 3 additions & 7 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ bleach==4.1.0
# via
# -r requirements/base.txt
# readme-renderer
boto3==1.18.30
boto3==1.18.31
# via fs-s3fs
botocore==1.21.30
botocore==1.21.31
# via
# boto3
# s3transfer
Expand All @@ -45,8 +45,6 @@ coverage==5.5
# via coveralls
coveralls==3.2.0
# via -r requirements/test.in
cryptography==3.4.8
# via secretstorage
ddt==1.4.2
# via -r requirements/test.in
# via
Expand Down Expand Up @@ -111,7 +109,7 @@ idna==3.2
# via
# -r requirements/base.txt
# requests
importlib-metadata==4.7.1
importlib-metadata==4.8.1
# via
# keyring
# twine
Expand Down Expand Up @@ -238,8 +236,6 @@ rfc3986==1.5.0
# via twine
s3transfer==0.5.0
# via boto3
secretstorage==3.3.1
# via keyring
simplejson==3.17.5
# via
# -r requirements/base.txt
Expand Down
5 changes: 0 additions & 5 deletions requirements/travis.in

This file was deleted.

5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def is_requirement(line):

setup(
name='lti-consumer-xblock',
version='3.0.4',
version='3.1.0',
author='Open edX project',
author_email='[email protected]',
description='This XBlock implements the consumer side of the LTI specification.',
Expand Down Expand Up @@ -78,6 +78,9 @@ def is_requirement(line):
'Development Status :: 5 - Production/Stable',
'Framework :: Django',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Framework :: Django :: 3.2',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Affero General Public License v3',
'Natural Language :: English',
Expand Down
4 changes: 4 additions & 0 deletions test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@
REST_FRAMEWORK = {
'PAGE_SIZE': 10
}

DEFAULT_HASHING_ALGORITHM = "sha1"

DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
7 changes: 5 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
[tox]
envlist = py38-django{22}, quality
envlist = py38-django{22,30,31,32}, quality

[testenv]
whitelist_externals =
make
deps =
django22: Django>=2.2,<2.3
django30: Django>=3.0,<3.1
django31: Django>=3.1,<3.2
django32: Django>=3.2,<4.0
-r{toxinidir}/requirements/test.txt
commands =
make test


[testenv:quality]
whitelist_externals =
make
deps =
-r{toxinidir}/requirements/test.txt
commands =
make quality

0 comments on commit 131e396

Please sign in to comment.