Skip to content

Commit

Permalink
Fix CI and add installation docs
Browse files Browse the repository at this point in the history
Signed-off-by: ziadhany <[email protected]>
  • Loading branch information
ziadhany committed Jan 2, 2024
1 parent 7a207e9 commit 4ba4f4c
Show file tree
Hide file tree
Showing 10 changed files with 325 additions and 271 deletions.
68 changes: 34 additions & 34 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
#name: CI Documentation
#
#on: [push, pull_request]
#
#jobs:
# build:
# runs-on: ubuntu-20.04
#
# strategy:
# max-parallel: 4
# matrix:
# python-version: [3.9]
#
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
#
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
#
# - name: Install Dependencies
# run: pip install -e .[docs]
#
# - name: Check Sphinx Documentation build minimally
# working-directory: ./docs
# run: sphinx-build -E -W source build
#
# - name: Check for documentation style errors
# working-directory: ./docs
# run: ./scripts/doc8_style_check.sh
#
#
name: CI Documentation

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-20.04

strategy:
max-parallel: 4
matrix:
python-version: [3.9]

steps:
- name: Checkout code
uses: actions/checkout@v3

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

- name: Install Dependencies
run: pip install -e .[docs]

- name: Check Sphinx Documentation build minimally
working-directory: ./docs
run: sphinx-build -E -W source build

- name: Check for documentation style errors
working-directory: ./docs
run: ./scripts/doc8_style_check.sh


166 changes: 83 additions & 83 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
@@ -1,83 +1,83 @@
#name: Create library release archives, create a GH release and publish PyPI wheel and sdist on tag in main branch
#
#
## This is executed automatically on a tag in the main branch
#
## Summary of the steps:
## - build wheels and sdist
## - upload wheels and sdist to PyPI
## - create gh-release and upload wheels and dists there
## TODO: smoke test wheels and sdist
## TODO: add changelog to release text body
#
## WARNING: this is designed only for packages building as pure Python wheels
#
#on:
# workflow_dispatch:
# push:
# tags:
# - "v*.*.*"
#
#jobs:
# build-pypi-distribs:
# name: Build and publish library to PyPI
# runs-on: ubuntu-20.04
#
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: 3.9
#
# - name: Install pypa/build
# run: python -m pip install build --user
#
# - name: Build a binary wheel and a source tarball
# run: python -m build --sdist --wheel --outdir dist/
#
# - name: Upload built archives
# uses: actions/upload-artifact@v3
# with:
# name: pypi_archives
# path: dist/*
#
#
# create-gh-release:
# name: Create GH release
# needs:
# - build-pypi-distribs
# runs-on: ubuntu-20.04
#
# steps:
# - name: Download built archives
# uses: actions/download-artifact@v3
# with:
# name: pypi_archives
# path: dist
#
# - name: Create GH release
# uses: softprops/action-gh-release@v1
# with:
# draft: true
# files: dist/*
#
#
# create-pypi-release:
# name: Create PyPI release
# needs:
# - create-gh-release
# runs-on: ubuntu-20.04
#
# steps:
# - name: Download built archives
# uses: actions/download-artifact@v3
# with:
# name: pypi_archives
# path: dist
#
# - name: Publish to PyPI
# if: startsWith(github.ref, 'refs/tags')
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}
name: Create library release archives, create a GH release and publish PyPI wheel and sdist on tag in main branch


# This is executed automatically on a tag in the main branch

# Summary of the steps:
# - build wheels and sdist
# - upload wheels and sdist to PyPI
# - create gh-release and upload wheels and dists there
# TODO: smoke test wheels and sdist
# TODO: add changelog to release text body

# WARNING: this is designed only for packages building as pure Python wheels

on:
workflow_dispatch:
push:
tags:
- "v*.*.*"

jobs:
build-pypi-distribs:
name: Build and publish library to PyPI
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install pypa/build
run: python -m pip install build --user

- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/

- name: Upload built archives
uses: actions/upload-artifact@v3
with:
name: pypi_archives
path: dist/*


create-gh-release:
name: Create GH release
needs:
- build-pypi-distribs
runs-on: ubuntu-20.04

steps:
- name: Download built archives
uses: actions/download-artifact@v3
with:
name: pypi_archives
path: dist

- name: Create GH release
uses: softprops/action-gh-release@v1
with:
draft: true
files: dist/*


create-pypi-release:
name: Create PyPI release
needs:
- create-gh-release
runs-on: ubuntu-20.04

steps:
- name: Download built archives
uses: actions/download-artifact@v3
with:
name: pypi_archives
path: dist

- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
58 changes: 29 additions & 29 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
## .readthedocs.yml
## Read the Docs configuration file
## See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
#
## Required
#version: 2
#
## Build in latest ubuntu/python
#build:
# os: ubuntu-22.04
# tools:
# python: "3.11"
#
## Build PDF & ePub
#formats:
# - epub
# - pdf
#
## Where the Sphinx conf.py file is located
#sphinx:
# configuration: docs/source/conf.py
#
## Setting the python version and doc build requirements
#python:
# install:
# - method: pip
# path: .
# extra_requirements:
# - docs
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build in latest ubuntu/python
build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build PDF & ePub
formats:
- epub
- pdf

# Where the Sphinx conf.py file is located
sphinx:
configuration: docs/source/conf.py

# Setting the python version and doc build requirements
python:
install:
- method: pip
path: .
extra_requirements:
- docs
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ test:

docs:
rm -rf docs/_build/
@${ACTIVATE} sphinx-build docs/ docs/_build/
@${ACTIVATE} sphinx-build docs/source docs/_build/

.PHONY: conf dev check valid black isort clean test docs envfile
Loading

0 comments on commit 4ba4f4c

Please sign in to comment.