From 49ab2a4fc4274502e08ae2626398eeda74aab9a8 Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Wed, 4 Mar 2020 18:15:30 -0800 Subject: [PATCH] docs: Fix MANIFEST and put schemas back in documentation (#791) * MANIFEST.in excludes all directories by default, and grafts in src/ * MANIFEST.in excludes all dotfiles * Schemas are symlinked under docs/_extras/schemas to src/pyhf/schemas * Add a check in the ci workflow to ensure the `schemas/` directory is being copied over --- .github/workflows/ci.yml | 8 ++++++++ MANIFEST.in | 4 ++-- docs/_extras/schemas | 1 + docs/conf.py | 2 +- docs/schemas | 1 - 5 files changed, 12 insertions(+), 4 deletions(-) create mode 120000 docs/_extras/schemas delete mode 120000 docs/schemas diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9a194f0f4..4f59750faa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -108,6 +108,14 @@ jobs: python -m doctest README.md python setup.py build_sphinx touch docs/_build/html/.nojekyll + - name: Check schemas are copied over + run: | + # is a directory + [ -d "docs/_build/html/schemas" ] + # is not a symlink + [ ! -L "docs/_build/html/schemas" ] + # is not empty + [ "$(ls -A docs/_build/html/schemas)" ] - name: Deploy docs to GitHub Pages if: success() && github.event_name == 'push' && github.ref == 'refs/heads/master' uses: crazy-max/ghaction-github-pages@v1.0.1 diff --git a/MANIFEST.in b/MANIFEST.in index ae07ad170a..5e06d8332c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ +prune * graft src - include LICENSE -global-exclude __pycache__ *.py[cod] +global-exclude __pycache__ *.py[cod] .* diff --git a/docs/_extras/schemas b/docs/_extras/schemas new file mode 120000 index 0000000000..00420d7cfc --- /dev/null +++ b/docs/_extras/schemas @@ -0,0 +1 @@ +../../src/pyhf/schemas \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 59d3bb9369..25f6f868f2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -213,7 +213,7 @@ def setup(app): # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. # -html_extra_path = [] +html_extra_path = ['_extras'] # If not None, a 'Last updated on:' timestamp is inserted at every page # bottom, using the given strftime format. diff --git a/docs/schemas b/docs/schemas deleted file mode 120000 index fcf62c8355..0000000000 --- a/docs/schemas +++ /dev/null @@ -1 +0,0 @@ -../src/pyhf/schemas \ No newline at end of file