Skip to content

Commit

Permalink
Merge pull request #3 from IATI/publish-pypi
Browse files Browse the repository at this point in the history
Publish to PyPI
  • Loading branch information
tillywoodfield authored May 29, 2024
2 parents 1100291 + ceff258 commit f13e7b8
Show file tree
Hide file tree
Showing 10 changed files with 8,373 additions and 137 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Commitlint
on: [pull_request]

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Install dependencies
run: npm ci
- name: Lint commit messages
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release
on:
push:
branches:
- "main"

jobs:
release:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/iati-sphinx-theme
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Install dependencies
run: npm ci
- name: Build CSS
run: npm run build
- name: Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ pip install -r requirements_dev.txt
### Run linting

```
black iati_sphinx_theme
isort iati_sphinx_theme
flake8 iati_sphinx_theme
black iati_sphinx_theme/
isort iati_sphinx_theme/
flake8 iati_sphinx_theme/
mypy iati_sphinx_theme/
```

### Documentation with live preview
Expand Down
11 changes: 10 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ IATI Sphinx Theme
.. toctree::
:titlesonly:
:maxdepth: 2
:caption: Table of Contents
:caption: Usage
:hidden:

installation

.. toctree::
:titlesonly:
:maxdepth: 1
:caption: Development
:hidden:

kitchen-sink/index
17 changes: 17 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
============
Installation
============

1.
Install the theme in your Sphinx project.

.. code-block:: none
pip install iati-sphinx-theme
2.
In your project's :code:`conf.py` set the :code:`html_theme`.

.. code-block:: python
html_theme = "iati_sphinx_theme"
4 changes: 3 additions & 1 deletion iati_sphinx_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

from os import path

import sphinx.application

__version__ = "0.0.0"


def setup(app):
def setup(app: sphinx.application.Sphinx) -> None:
app.add_html_theme("iati_sphinx_theme", path.abspath(path.dirname(__file__)))
Loading

0 comments on commit f13e7b8

Please sign in to comment.