diff --git a/.github/workflows/Unittests.yml b/.github/workflows/Unittests.yml index ee0ae0a..2c08bb7 100644 --- a/.github/workflows/Unittests.yml +++ b/.github/workflows/Unittests.yml @@ -1,4 +1,4 @@ -name: Run Tests +name: Test Suite on: workflow_dispatch: @@ -6,6 +6,7 @@ on: jobs: python_tests: + name: Run Tests runs-on: ubuntu-latest strategy: matrix: @@ -14,7 +15,7 @@ jobs: steps: - name: Checkout source uses: actions/checkout@v2 - + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: @@ -33,9 +34,27 @@ jobs: coverage run -m unittest coverage report coverage xml -o report_${{ matrix.python-version }}.xml - + - name: Archive code coverage results uses: actions/upload-artifact@v2 with: name: code-coverage-report path: report_${{ matrix.python-version }}.xml + + # Report test coverage to codacy for the python version being tested + - name: Report partial coverage results + run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report --partial -l Python -r report_${{ matrix.python-version }}.xml + env: + CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} + + codacy-coverage-reporter: + name: Report code coverage + runs-on: ubuntu-latest + needs: python_tests + steps: + + # Tell codacy we are done reporting test coverage + - name: Finish reporting coverage + run: bash <(curl -Ls https://coverage.codacy.com/get.sh) final + env: + CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} diff --git a/django_easy_error/__init__.py b/django_easy_error/__init__.py index 472eb4e..05527da 100644 --- a/django_easy_error/__init__.py +++ b/django_easy_error/__init__.py @@ -118,7 +118,7 @@ from django.conf import settings -__version__ = '1.0.0' +__version__ = '1.0.1' __author__ = 'Daniel Perrefort' # Allow reloading of the module without Django raising an error diff --git a/django_easy_error/handlers.py b/django_easy_error/handlers.py index efe3db0..625a4df 100644 --- a/django_easy_error/handlers.py +++ b/django_easy_error/handlers.py @@ -1,6 +1,9 @@ -"""Handlers are used to process the routing of HTTP errors to the correct +"""Request handlers for different error codes. + +Handlers are used to process the routing of HTTP errors to the correct template. Handler objects are provided for each of the error views supported by -Django.""" +Django. +""" from django.http import HttpResponse, HttpRequest diff --git a/setup.py b/setup.py index 3b72cbb..887274b 100644 --- a/setup.py +++ b/setup.py @@ -5,11 +5,15 @@ def load_requirements(): + """Return a list of package dependencies from the project requirements file""" + with open('requirements.txt') as f: return f.read().splitlines() def get_meta(): + """Return the package version and author as defined in the package __init__ file.""" + init_path = Path(__file__).resolve().parent / 'django_easy_error/__init__.py' with init_path.open('r') as infile: init_content = infile.read() @@ -23,10 +27,10 @@ def get_meta(): return version, author -version, author = get_meta() +_version, _author = get_meta() setup(name='django-easy-error', - version=version, - author=author, + version=_version, + author=_author, packages=find_packages(), keywords='Django HTTP Error Pages', description='Easy template integration for django error pages',