Skip to content

Commit

Permalink
Merge branch 'hotfix/0.7.3' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rlskoeser committed May 10, 2022
2 parents 2752ea5 + 11ba90d commit 4a6c58c
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 68 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/sphinx_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: sphinx docs

on:
push: # run on push to main and PR
branches:
- main
pull_request:

env:
DJANGO_ENV: docs
DJANGO_VERSION: 3.2
DJANGO_DB_BACKEND: sqlite3


jobs:
docs:
name: sphinx documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

# Python version to use is stored in the .python-version file, which is the
# convention for pyenv: https://github.com/pyenv/pyenv
- name: Get Python version
run: echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}

# 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@v2
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
pip-${{ hashFiles('requirements/*.txt') }}
pip-
- name: Install package dependencies
run: |
pip install -q Django==${{ env.DJANGO_VERSION }}
pip install -e .
pip install -e '.[docs]'
- name: Setup test settings
run: |
cp ci/testsettings.py testsettings.py
python -c "import uuid; print('SECRET_KEY = \'%s\'' % uuid.uuid4())" >> testsettings.py
- name: Build Sphinx docs
run: cd sphinx-docs && make -b coverage html

# for pull requests, exit with error if documentation coverage is incomplete
- name: Report on documentation coverage
if: ${{ github.event_name == 'pull_request' }}
run: if [[ $((`wc -l < sphinx-docs/_build/coverage/python.txt`)) -eq 2 ]] ; then echo "Documentation coverage complete"; else cat sphinx-docs/_build/coverage/python.txt && exit 1; fi

# when building on push to main, publish the built docs
- name: Deploy built docs to github pages
if: ${{ github.event_name == 'push' }}
uses: peaceiris/actions-gh-pages@v2
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./sphinx-docs/_build/html
with:
emptyCommits: false
2 changes: 2 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ env:
DB_NAME: djiffy
DB_USER: djiffy
DB_PASSWORD: djiffy123
DJANGO_DB_BACKEND: postgresql


jobs:
python-unit:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
=========

0.7.3
-----

* `ManifestImporter.import_paths` now returns a list of database manifest
objects for the requested uris, whether newly imported or already available
* Setup GitHub Actions workflow for sphinx documentation


0.7.2
-----

Expand Down
15 changes: 6 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ Django application to index and display IIIF Manifests for books
:alt: PyPI - Python Version
.. image:: https://img.shields.io/pypi/djversions/djiffy
:alt: PyPI - Django Version

.. image:: https://github.com/Princeton-CDH/djiffy/actions/workflows/sphinx_docs.yml/badge.svg
:alt: Sphinx Docs


**djiffy** is intended to be a reusable `Django`_ application for
Expand All @@ -29,6 +30,8 @@ the full IIIF Presentation specification.
.. _Django: https://www.djangoproject.com/
.. _IIIF Presentation: http://iiif.io/api/presentation/2.1/

Code documentation is available at https://princeton-cdh.github.io/djiffy/


Installation
------------
Expand Down Expand Up @@ -153,14 +156,8 @@ directory::
cd sphinx-docs
make html

To build and publish documentation for a release, add the ``gh-pages`` branch
to the ``docs`` folder in your worktree::

git worktree add -B gh-pages docs origin/gh-pages

In the ``sphinx-docs`` folder, use ``make docs`` to build the HTML documents
and static assets, add it to the docs folder, and commit it for publication on
Github Pages. After the build completes, push to GitHub from the ``docs`` folder.
As of v0.7.3, documentation is automatically built with GitHub Actions
and published using GitHub pages.

License
-------
Expand Down
2 changes: 1 addition & 1 deletion ci/testsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# run against postgresql
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"ENGINE": "django.db.backends.%s" % os.getenv("DJANGO_DB_BACKEND"),
"PASSWORD": os.getenv("DB_PASSWORD"),
"USER": os.getenv("DB_USER"),
"NAME": os.getenv("DB_NAME"),
Expand Down
Loading

0 comments on commit 4a6c58c

Please sign in to comment.