Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test matrix for python versions #92

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ name: tests
env:
APP_NAME: blti
CONF_PATH: conf
COVERAGE_DJANGO_VERSION: 3.2
COVERAGE_DJANGO_VERSION: '4.2'
COVERAGE_PYTHON_VERSION: '3.10'

on:
push:
Expand All @@ -42,10 +43,13 @@ on:

jobs:
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

strategy:
matrix:
python-version:
- '3.8'
- '3.10'
django-version:
- '3.2'
- '4.2'
Expand All @@ -54,19 +58,18 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Python
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: ${{ matrix.python-version }}

- name: Install Dependencies
run: |
sudo apt-get install python-dev libxml2-dev libxmlsec1-dev
python -m pip install --upgrade pip
pip install -e .
pip install coverage coveralls==3.3.1

- name: Upgrade Django Version
- name: Upgrade Django ${{ matrix.django-version }}
run: pip install "Django~=${{ matrix.django-version }}.0"

- name: Setup Django
Expand All @@ -90,7 +93,9 @@ jobs:
coverage run --source=${APP_NAME}/ manage.py test ${APP_NAME}

- name: Report Test Coverage
if: matrix.django-version == env.COVERAGE_DJANGO_VERSION
if: |
matrix.django-version == env.COVERAGE_DJANGO_VERSION &&
matrix.python-version == env.COVERAGE_PYTHON_VERSION
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
Expand All @@ -101,7 +106,7 @@ jobs:

needs: test

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: Checkout Repo
Expand All @@ -110,7 +115,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.10'

- name: Publish to PyPi
uses: uw-it-aca/actions/publish-pypi@main
Expand Down
2 changes: 1 addition & 1 deletion blti/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 UW-IT, University of Washington
# Copyright 2024 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
6 changes: 3 additions & 3 deletions blti/crypto.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 UW-IT, University of Washington
# Copyright 2024 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand All @@ -20,12 +20,12 @@ def __init__(self, key, iv):
if key is None:
raise ValueError('Missing AES key')
else:
self._key = key
self._key = key.encode('utf8')

if iv is None:
raise ValueError('Missing AES initialization vector')
else:
self._iv = iv
self._iv = iv.encode('utf8')

def encrypt(self, msg):
msg = self._pad(self.str_to_bytes(msg))
Expand Down
2 changes: 1 addition & 1 deletion blti/middleware.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 UW-IT, University of Washington
# Copyright 2024 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion blti/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 UW-IT, University of Washington
# Copyright 2024 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion blti/performance.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 UW-IT, University of Washington
# Copyright 2024 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion blti/tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 UW-IT, University of Washington
# Copyright 2024 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion blti/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 UW-IT, University of Washington
# Copyright 2024 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion blti/validators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 UW-IT, University of Washington
# Copyright 2024 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion blti/views/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 UW-IT, University of Washington
# Copyright 2024 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion blti/views/develop.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 UW-IT, University of Washington
# Copyright 2024 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
install_requires=[
'Django>=3.2,<5',
'oauthlib',
'PyCrypto',
'pycryptodome',
'mock',
],
license='Apache License, Version 2.0',
description='A Django Application on which to build IMS BLTI Tool Providers',
long_description=README,
url='https://github.com/uw-it-aca/django-blti',
author="UW-IT AXDD",
author="UW-IT T&LS",
author_email="[email protected]",
classifiers=[
'Environment :: Web Environment',
Expand All @@ -37,6 +37,5 @@
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3.8',
],
)
Loading