Skip to content

Commit

Permalink
Use the Sphinx dirhtml builder for cleaner URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
mhostetter committed Jul 13, 2022
1 parent 5161f4e commit 65ddb9e
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 9 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install documentation dependencies
run: |
python3 -m pip install --upgrade pip
sudo apt install pandoc
python3 -m pip install -r docs/requirements.txt
- name: Install python package
- name: Install Python package
run: python3 -m pip install .
- name: Run sphinx to build docs
run: sphinx-build -b html -v docs/ docs/build/

- name: Run Sphinx to build docs
run: sphinx-build -b dirhtml -v docs/ docs/build/
13 changes: 12 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,25 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.7

- uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all commits and tags
ref: ${{ github.REF }}

# - name: Wait on other workflows
# uses: lewagon/wait-on-check-action@v0.2
# with:
# ref: ${{ github.REF }}
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# wait-interval: 5

- name: Get previous version
id: previous_version
run: | # Get last version tag and remove the "v"
version=$(git describe --tags --abbrev=0 | cut -c 2-)
echo "::set-output name=version::${version}"
- name: Validate next version
uses: zwaldowski/semver-release-action@v2
id: next_version
Expand All @@ -42,10 +46,12 @@ jobs:
bump: ${{ github.event.inputs.release_type }}
prefix: "v"
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Update version file
run: |
echo -n "${{ steps.next_version.outputs.version }}" > galois/version.txt
cat galois/version.txt
- name: Commit and tag version
uses: stefanzweifel/git-auto-commit-action@v4
with:
Expand All @@ -54,10 +60,12 @@ jobs:
repository: .
branch: master
tagging_message: "v${{ steps.next_version.outputs.version }}"

- uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all commits and tags
ref: ${{ github.REF }}

- name: Construct release notes
run: |
prev=v${{ steps.previous_version.outputs.version }}
Expand All @@ -66,6 +74,7 @@ jobs:
git log ${prev}..${next} --pretty="- @%an" | sort | uniq >> release_notes.md
echo -e "\n## Commits" >> release_notes.md
git log --oneline ${prev}..${next} >> release_notes.md
- name: Create GitHub release
uses: actions/create-release@v1
env:
Expand All @@ -75,11 +84,13 @@ jobs:
release_name: galois v${{ steps.next_version.outputs.version }}
body_path: release_notes.md
draft: true
- name: Build python package

- name: Build Python package
run: |
python3 -m pip install --upgrade setuptools wheel twine
python3 setup.py sdist bdist_wheel
python3 -m twine check dist/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
Expand Down
31 changes: 28 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,20 @@ jobs:
python-version: [3.7, 3.8, 3.9, '3.10']
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install linting dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-dev.txt
- name: Install python package
- name: Install Python package
run: python3 -m pip install . # Needed to guarantee dependencies are installed

- name: Lint with pylint
run: python3 -m pylint --rcfile=setup.cfg galois/

Expand All @@ -36,18 +40,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install testing dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-dev.txt
- name: Install python package
- name: Install Python package
run: python3 -m pip install .

- name: Test with pytest
run: python3 -m pytest --cov=galois/ --cov-report=xml tests/

- name: Upload coverage report
uses: codecov/codecov-action@v2
with:
Expand All @@ -60,15 +69,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Build python package

- name: Build Python package
run: |
python3 -m pip install --upgrade setuptools wheel twine
python3 setup.py sdist bdist_wheel
python3 -m twine check dist/*
- name: Upload wheel artifact
uses: actions/upload-artifact@v2
with:
Expand All @@ -86,28 +98,35 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install testing dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-dev.txt
- name: Install minimum package dependencies
run: python3 -m pip install -r requirements-min.txt

- name: Remove source code
uses: JesseTG/rm@v1.0.2
with:
path: galois/

- name: Download wheel artifact
uses: actions/download-artifact@v2
with:
name: dist
path: dist/

- name: Install package wheel
run: |
python3 -m pip install $(ls dist/galois-*.whl)
- name: Test with pytest
run: |
python3 -m pytest tests/
Expand All @@ -122,26 +141,32 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install testing dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-dev.txt
- name: Remove source code
uses: JesseTG/rm@v1.0.2
with:
path: galois/

- name: Download wheel artifact
uses: actions/download-artifact@v2
with:
name: dist
path: dist/

- name: Install package wheel
run: |
python3 -m pip install $(ls dist/galois-*.whl)
- name: Test with pytest
run: |
python3 -m pytest tests/
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build:

# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: html
builder: dirhtml
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sphinx==4.5
git+https://github.com/jbms/sphinx-immaterial@b27258e2e6c13eef42df21bf05eaeede4096c517
git+https://github.com/jbms/sphinx-immaterial@00c681084ef9ec4be3a936d30367f64802bc7854
myst-parser
sphinx-design
sphinxcontrib-details-directive
Expand Down

0 comments on commit 65ddb9e

Please sign in to comment.