Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Checkout PyTemplate Project
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: .python-version-default
Expand All @@ -38,6 +38,9 @@ jobs:
if: always()
run: tox -e type

- name: Confirm Documentation Builds
run: tox -e docs

tests:
runs-on: ubuntu-latest
strategy:
Expand Down
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,51 @@
# PyTemplate
Python Project Template
[![build status][buildstatus-image]][buildstatus-url]

[buildstatus-image]: https://github.com/Spill-Tea/PyTemplate/actions/workflows/python-app.yml/badge.svg?branch=main
[buildstatus-url]: https://github.com/Spill-Tea/PyTemplate/actions?query=branch%3Amain

Python Project Template. Be sure to create a template directly
from github.

<!-- omit in toc -->
## Table of Contents
- [PyTemplate](#pytemplate)
- [Installation](#installation)
- [For Developers](#for-developers)
- [License](#license)


## Installation
Clone the repository and pip install.

```bash
git clone https://github.com/Spill-Tea/PyTemplate.git
cd PyTemplate
pip install .
```

Alternatively, you may install directly from github.
```bash
pip install git+https://github.com/Spill-Tea/PyTemplate@main
```


## For Developers
After cloning the repository, create a new virtual environment and run the following commands:

```bash
pip install -e ".[dev]"
pre-commit install
pre-commit run --all-files
```

Running unit tests locally is straightforward with tox. Make sure
you have all python versions available required for your project
The `p` flag is not required, but it runs tox environments in parallel.
```bash
tox -p
```
Be sure to run tox before creating a pull request.

## License
[BSD-3](LICENSE)
20 changes: 20 additions & 0 deletions docs/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 = source
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)
35 changes: 35 additions & 0 deletions docs/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=source
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
5 changes: 5 additions & 0 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@import url("https://fonts.googleapis.com/css?family=Space Grotesk:wght@400;700&display=swap");

body {
font-family: 'Space Grotesk', sans-serif;
}
5 changes: 5 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
API
===

.. autosummary::
:toctree: generated
40 changes: 40 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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
import os
import sys


sys.path.insert(0, os.path.abspath("../src/"))


project = "PyTemplate"
copyright = "2025, Jason C Del Rio (Spill-Tea)"
author = "Jason C Del Rio (Spill-Tea)"
release = "v0.0.1"

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

extensions = [
"sphinx.ext.duration",
"sphinx.ext.viewcode",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
]

templates_path = ["_templates"]
exclude_patterns = []


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

html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
html_css_files = ["custom.css"]
29 changes: 29 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. PyTemplate documentation master file, created by
sphinx-quickstart on Thu Jun 12 22:11:46 2025.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

PyTemplate documentation
========================

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

.. automodule:: PyTemplate.__init__
:members:
:undoc-members:
:show-inheritance:

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

api


Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ exclude = ["benchmarks", "docs", "tests"]

[project.optional-dependencies]
dev = ["PyTemplate[doc,test,lint,type]", "tox", "pre-commit"]
doc = ["pdoc"]
doc = ["sphinx", "sphinx-rtd-theme"]
test = ["pytest", "coverage", "pytest-xdist"]
lint = ["pylint", "ruff"]
type = ["mypy"]
Expand Down
14 changes: 9 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
requires = tox>=4
envlist = type, lint, coverage, py{38,39,310,311,312}-tests
envlist = type, lint, coverage, docs, py{38,39,310,311,312}-tests

[testenv]
description = Base Environment
Expand Down Expand Up @@ -42,7 +42,11 @@ commands =
ruff format --check --config pyproject.toml {posargs: src}
pylint --rcfile pyproject.toml {posargs: src}

; [testenv:docs]
; changedir = doc
; extras = docs
; commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
[testenv:docs]
changedir = docs
extras = doc
allowlist_externals = rm
commands =
sphinx-build -W -b html -d {envtmpdir}/doctrees source {envtmpdir}/html
commands_post =
rm -rf {envtmpdir}
Loading