Skip to content

Commit

Permalink
Merge pull request #48 from onaio/upgrade-to-django-3
Browse files Browse the repository at this point in the history
Upgrade to django 3
  • Loading branch information
KipSigei authored May 11, 2022
2 parents cc61ca2 + 585c8d4 commit e7eeb8b
Show file tree
Hide file tree
Showing 11 changed files with 432 additions and 459 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
- push
- pull_request
concurrency:
group: ci-${{ github.ref }}-${{ github.sha }}-${{ github.event_name }}
group: ci-${{ github.ref }}-${{ github.sha }}-${{ github.event_name }}
cancel-in-progress: true

jobs:
Expand All @@ -13,19 +13,15 @@ jobs:
fail-fast: false
matrix:
include:
- python_version: 3.6
toxenv: "py36-django22"
- python_version: 3.6
toxenv: "py36-django30"
- python_version: 3.7
toxenv: "py37-django22"
- python_version: 3.7
toxenv: "py37-django30"
- python_version: 3.8
toxenv: "py38-django22"
toxenv: "py38-django32"
- python_version: 3.9
toxenv: "py39-django32"
- python_version: 3.8
toxenv: "py38-django30"
- python_version: 3.6
toxenv: "py38-django40"
- python_version: 3.9
toxenv: "py39-django40"
- python_version: 3.9
toxenv: "lint"
steps:
- name: Checkout code
Expand All @@ -35,7 +31,7 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python_version }}
architecture: 'x64'
architecture: "x64"

- name: Install APT requirements
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ __pycache__/
build/
dist/
.tox/
.eggs
10 changes: 10 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[isort]
default_section = THIRDPARTY
force_grid_wrap=0
include_trailing_comma=True
known_django = django
known_first_party = oidc
line_length=88
multi_line_output=3
sections = FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
use_parentheses=True
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 19.10b0
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
4 changes: 2 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ verify_ssl = true

[dev-packages]
ipdb = "*"
black = "==19.10b0"
black = "*"
flake8 = "*"
mypy = "*"
isort = "*"
Expand All @@ -18,5 +18,5 @@ e1839a8 = {editable = true,path = "."}
ona-oidc = {editable = true,path = "."}

[requires]
python_version = "3.7"
python_version = "3.9"

750 changes: 355 additions & 395 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Specify the target platform details in config, so your developers are
# free to run mypy on Windows, Linux, or macOS and get consistent
# results.
python_version=3.6
python_version=3.9
platform=linux

# flake8-mypy expects the two following for sensible formatting
Expand Down
7 changes: 0 additions & 7 deletions oidc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +0,0 @@
"""
Main init file for oidc app
"""

VERSION = (0, 0, 10)
__version__ = ".".join(str(v) for v in VERSION)
default_app_config = "oidc.apps.oidcConfig"
55 changes: 45 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,45 @@
[isort]
default_section = THIRDPARTY
force_grid_wrap=0
include_trailing_comma=True
known_django = django
known_first_party = oidc
line_length=88
multi_line_output=3
sections = FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
use_parentheses=True
[metadata]
name = ona-oidc
version = 1.0.0
description = Ona OpenID Connect Client
long_description = file: README.rst
long_description_content_type = text/x-rst
url = https://github.com/onaio/ona-oidc
author = Ona Systems Inc
author_email = [email protected]
license = Copyright (c) 2022 Ona Systems Inc All rights reserved
license_file = LICENSE
classifiers =
Development Status :: 5 - Production/Stable
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
project_urls =
Source = https://github.com/onaio/ona-oidc
Tracker = https://github.com/onaio/ona-oidc/issues

[options]
packages = find:
platforms = any
tests_require =
ipdb
black
flake8
mypy
isort
pre-commit
mock
tox
install_requires =
Django>=3.2.13,<4
djangorestframework
pyjwt[crypto]
requests
python_requires = >= 3.8
setup_requires =
setuptools_scm

[options.packages.find]
exclude = tests

[bdist_wheel]
universal = 1
25 changes: 2 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,6 @@
"""
Setup file for ona-oidc
"""
from setuptools import find_packages, setup
import setuptools

setup(
name="ona-oidc",
version=__import__("oidc").__version__,
description="A Django app that adds OpenID connect client functionality.",
license="Apache-2.0 License",
author="Ona Kenya",
url="https://github.com/onaio/ona-oidc",
packages=find_packages(exclude=["tests"]),
install_requires=[
"Django >= 2.2",
"djangorestframework >= 3.9",
"pyjwt[crypto]",
"requests",
],
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 3.6",
"Framework :: Django",
"Framework :: Django :: 2.2",
"Framework :: Django :: 3.0",
],
)
setuptools.setup()
13 changes: 6 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
[tox]
envlist =
py{36,37,38}-django{22,30}
py{38,39}-django{32,40}
lint

[testenv:lint]
deps =
pipenv
flake8
black
basepython = python3.6
basepython = python3.9
commands =
pipenv sync --dev
flake8 {toxinidir}/oidc
black -v oidc --check -t py36 -t py37 -t py38
black -v oidc --check -t py38 -t py39
isort -c -v .

[testenv]
deps =
pipenv
basepython =
py36: python3.6
py37: python3.7
py38: python3.8
py39: python3.9
commands =
django22: pip install Django>=2.2,<3
django30: pip install Django>=3.0
django32: pip install Django>=3.2.13,<4
django40: pip install Django>=4
pipenv sync --dev
python manage.py test {toxinidir}/tests

0 comments on commit e7eeb8b

Please sign in to comment.