Skip to content

Commit

Permalink
feat: upgraded versions, added coverage and sphinx support
Browse files Browse the repository at this point in the history
  • Loading branch information
sehoffmann committed Jan 17, 2025
1 parent 69167fd commit fcee976
Show file tree
Hide file tree
Showing 11 changed files with 144 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/actions/setup_environment/action.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Setup CI Environment
inputs:
python-version:
default: "3.9"
default: "3.11"
type: string

runs:
using: composite
steps:
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/build_and_upload_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}
submodules: recursive
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
submodules: recursive

- name: Setup Environment
uses: ./.github/actions/setup_environment

- name: Build Wheel
run: |
python3 -m build
python -m build
- name: Upload Wheels to Github
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
path: dist/*.whl
Expand All @@ -48,9 +48,14 @@ jobs:
outputs:
upload: ${{ steps.trigger_upload.outputs.value }}
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Download Artifacts From Github
continue-on-error: true
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: wheels

Expand All @@ -74,7 +79,7 @@ jobs:
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
pip3 install twine
pip install twine
if [[ "${{ inputs.real-pypi }}" == true ]]; then
python -m twine upload \
--username __token__ \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

Expand Down
25 changes: 16 additions & 9 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ jobs:
- ubuntu-latest
- windows-latest
python-version:
#- "3.8"
- "3.9"
#- "3.10"
- "3.11"
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -33,12 +31,21 @@ jobs:

- name: Install Dependencies
run: |
pip3 install -r requirements.txt
pip install -r requirements.txt
- name: Install Project
run: |
pip3 install .
pip install .
- name: Run Tests
run:
pytest --no-header -v test
- name: Run tests & coverage
run: |
coverage run -m pytest --no-header -v test
coverage report -m -i
coverage html -i
- name: Archive coverage results
if: startsWith(matrix.os, 'ubuntu')
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: htmlcov
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Sphinx Build
/doc/_build

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
4 changes: 4 additions & 0 deletions build_documentation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

cd doc
make html
6 changes: 6 additions & 0 deletions ci_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
setuptools
packaging
wheel
build
pre-commit
pytest
sphinx
coverage
20 changes: 20 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
27 changes: 27 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'python-quickstart'
copyright = '2025, Author Name(s)'
author = 'Author Name(s)'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = []

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'alabaster'
html_static_path = ['_static']
17 changes: 17 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. python-quickstart documentation master file, created by
sphinx-quickstart on Fri Jan 17 13:18:00 2025.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
python-quickstart documentation
===============================

Add your content using ``reStructuredText`` syntax. See the
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
documentation for details.


.. toctree::
:maxdepth: 2
:caption: Contents:

35 changes: 35 additions & 0 deletions doc/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd

0 comments on commit fcee976

Please sign in to comment.