Skip to content

Commit

Permalink
Merge branch 'release/0.8' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rlskoeser committed Jun 22, 2023
2 parents 0ac55cd + 9ac0e9b commit 6b9e6dc
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 92 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: unit tests

on:
push: # run on every push or PR to any branch
pull_request:
schedule: # run automatically on main branch each Tuesday at 11am
- cron: "0 16 * * 2"

jobs:
python-unit:
name: Python unit tests
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.9", "3.10", "3.11"]
django: ["3.2", "4.0", "4.1", "4.2"]
steps:
- name: Checkout repository
uses: actions/checkout@v3

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

# We base the python cache on the hash of all requirements files, so that
# if any change, the cache is invalidated.
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('setup.py') }}
restore-keys: |
pip-${{ hashFiles('setup.py') }}
pip-
- name: Install package with dependencies
run: |
pip install -e .
pip install -e '.[test]'
pip install codecov
- name: Setup test settings
run: |
cp ci/testsettings.py testsettings.py
python -c "import uuid; print('SECRET_KEY = \'%s\'' % uuid.uuid4())" >> testsettings.py
- name: Run pytest
run: python -m pytest --cov=pucas --cov-report=xml

- name: Upload test coverage to Codecov
uses: codecov/codecov-action@v3
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
CHANGELOG
=========

0.8
---
* Now tested against Django 3.2-4.2
* Add testing for Python 3.9-3.11
* Using GitHub Actions for continuous integration

0.7
----
* Drop support for Python 2.7
Expand Down
14 changes: 5 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
django-pucas
============

.. image:: https://travis-ci.org/Princeton-CDH/django-pucas.svg?branch=master
:target: https://travis-ci.org/Princeton-CDH/django-pucas
.. image:: https://github.com/Princeton-CDH/django-pucas/actions/workflows/unit_tests.yml/badge.svg
:target: https://github.com/Princeton-CDH/django-pucas/actions/workflows/unit_tests.yml
:alt: Build status

.. image:: https://codecov.io/gh/Princeton-CDH/django-pucas/branch/master/graph/badge.svg
.. image:: https://codecov.io/gh/Princeton-CDH/django-pucas/branch/main/graph/badge.svg
:target: https://codecov.io/gh/Princeton-CDH/django-pucas
:alt: Code Coverage

.. image:: https://www.codefactor.io/repository/github/princeton-cdh/django-pucas/badge
:target: https://www.codefactor.io/repository/github/princeton-cdh/django-pucas
:alt: CodeFactor

.. image:: https://requires.io/github/Princeton-CDH/django-pucas/requirements.svg?branch=master
:target: https://requires.io/github/Princeton-CDH/django-pucas/requirements/?branch=master
:alt: Requirements Status

.. image:: https://img.shields.io/pypi/pyversions/viapy
:alt: PyPI - Python Version

Expand All @@ -35,8 +31,8 @@ support for prepopulating user account data based on an LDAP search.

**django-pucas** is tested against:

* Django ``1.11-3.1``
* Python ``3.5-3.8``
* Django ``3.2-4.0``
* Python ``3.9-3.11``

**django-pucas** requires **django-cas-ng** 3.6 or greater.

Expand Down
8 changes: 3 additions & 5 deletions pucas/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
default_app_config = 'pucas.apps.PucasConfig'

__version_info__ = (0, 7, 0, None)
__version_info__ = (0, 8, 0, None)

# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
__version__ = ".".join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
__version__ += "-%s" % (__version_info__[-1],)
8 changes: 4 additions & 4 deletions pucas/cas_urls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django.conf.urls import url
from django.urls import path
from django_cas_ng.views import LoginView, LogoutView, CallbackView

urlpatterns = [
url(r'^login/$', LoginView.as_view(), name='cas_ng_login'),
url(r'^logout/$', LogoutView.as_view(), name='cas_ng_logout'),
url(r'^callback/$', CallbackView.as_view(), name='cas_ng_proxy_callback'),
path("login/", LoginView.as_view(), name="cas_ng_login"),
path("logout/", LogoutView.as_view(), name="cas_ng_logout"),
path("callback/", CallbackView.as_view(), name="cas_ng_proxy_callback"),
]
62 changes: 29 additions & 33 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,52 @@
from setuptools import find_packages, setup
from pucas import __version__

with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
with open(os.path.join(os.path.dirname(__file__), "README.rst")) as readme:
README = readme.read()

# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))

REQUIREMENTS = ['django>=1.8', 'django-cas-ng>=3.6', 'ldap3']
TEST_REQUIREMENTS = ['pytest', 'pytest-django', 'pytest-cov']
REQUIREMENTS = ["django>=1.8", "django-cas-ng>=3.6", "ldap3"]
TEST_REQUIREMENTS = ["pytest", "pytest-django", "pytest-cov"]
if sys.version_info < (3, 0):
TEST_REQUIREMENTS.append('mock')
TEST_REQUIREMENTS.append("mock")


setup(
name='pucas',
name="pucas",
version=__version__,
packages=find_packages(),
include_package_data=True,
license='Apache License, Version 2.0',
description='Django app to login with CAS and populate user accounts with LDAP.',
license="Apache License, Version 2.0",
description="Django app to login with CAS and populate user accounts with LDAP.",
long_description=README,
url='https://github.com/Princeton-CDH/django-pucas',
url="https://github.com/Princeton-CDH/django-pucas",
install_requires=REQUIREMENTS,
setup_requires=['pytest-runner'],
setup_requires=["pytest-runner"],
tests_require=TEST_REQUIREMENTS,
extras_require={
'test': TEST_REQUIREMENTS,
"test": TEST_REQUIREMENTS,
},
author='CDH @ Princeton',
author_email='digitalhumanities@princeton.edu',
author="CDH @ Princeton",
author_email="digitalhumanities@princeton.edu",
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
'Framework :: Django :: 2.1',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Internet :: WWW/HTTP',
'Topic :: System :: Systems Administration :: Authentication/Directory',
'Topic :: System :: Systems Administration :: Authentication/Directory :: LDAP',
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Internet :: WWW/HTTP",
"Topic :: System :: Systems Administration :: Authentication/Directory",
"Topic :: System :: Systems Administration :: Authentication/Directory :: LDAP",
],
)

0 comments on commit 6b9e6dc

Please sign in to comment.