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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "enhancement",
"category": "documentation",
"description": "updated documentation generation"
}
2 changes: 1 addition & 1 deletion .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
validate-data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Cleanup temporary files/directories
run: |
./scripts/cleanup.py
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
matrix:
python-version: [ 3.7, 3.8, 3.9 ]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ dmypy.json
# MacOS
.DS_Store

# Testing Directories
# Testing Files and Directories
tests/*.log
tests/.pytest_cache/
tests/reports/
tests/*.log
tests/logs/
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ python:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
install: pip install tox-travis
script: tox
after_success: pycodestyle
after_success: pycodestyle
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-alpine
FROM python:3.13-alpine
RUN mkdir /app
WORKDIR /app
COPY requirements.txt .
Expand All @@ -7,4 +7,4 @@ COPY . .
ENV PYTHONPATH="/app"
RUN addgroup -S projects && adduser -S -H projects -G projects
RUN chown -R projects:projects /app
USER projects
USER projects
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ Install documentation dependencies and build:

## License

MIT - See
[LICENSE](https://github.com/cloether/skeleton/blob/master/LICENSE.txt)
for more information.
MIT - See [LICENSE](https://github.com/cloether/skeleton/blob/master/LICENSE.txt) for more information.

## Copyright

Copyright © 2021 Chad Loether
Copyright © 2025 cloether
66 changes: 35 additions & 31 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,65 +1,69 @@
..
https://docutils.sourceforge.io/docs/user/rst/quickref.html
https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet

Skeleton
========

``skeleton`` is a template used for creating Python modules.

The official repo is `here`_.
The official repo is `here <https://github.com/cloether/skeleton>`__.

.. note:: This library is under active development.
**Note**: This library is under active development.

Installation
------------
To install the library into the current virtual environment::

$ pip install skeleton
Install in virtual environment:

or::
::

$ python -m pip install skeleton
$ pip install skeleton

Running the Tests
-----------------
Install test dependencies and run `tox`::

$ pip install skeleton[tests]
$ tox
Install test dependencies and run ``tox``:

::

$ pip install skeleton[tests]
$ tox

Building the Docs
-----------------
Install documentation dependencies and build::

$ pip install skeleton[docs]
$ python setup.py docs
Install documentation dependencies and build:

::

$ pip install skeleton[docs]
$ python setup.py docs

Requirements
------------

- six
- appdirs

Support
-------
- Ask a `Question`_.
- Request `Assistance`_.
- Submit `Bug Report`_.
- Submit `Feature Request`_.
- Submit `Issue`_.

- Ask a
`Question <https://github.com/cloether/skeleton/issues/new?template=question.md&labels=question>`__
- Request
`Assistance <https://github.com/cloether/skeleton/issues/new?template=need-help.md&labels=help+wanted>`__
- Submit `Bug
Report <https://github.com/cloether/skeleton/issues/new?template=bug-report.md&labels=bug>`__
- Submit `Feature
Request <https://github.com/cloether/skeleton/issues/new?template=feature-request.md&labels=enhancement>`__
- Submit
`Issue <https://github.com/cloether/skeleton/issues/new?template=blank-issue.md>`__

License
-------
MIT - See `LICENSE`_ for more information.

MIT - See
`LICENSE <https://github.com/cloether/skeleton/blob/master/LICENSE.txt>`__
for more information.

Copyright
---------
Copyright © 2021 Chad Loether

.. _here: https://github.com/cloether/skeleton
.. _Issue: https://github.com/cloether/skeleton/issues/new?template=blank-issue.md
.. _Bug Report: https://github.com/cloether/skeleton/issues/new?template=bug-report.md&labels=bug
.. _Feature Request: https://github.com/cloether/skeleton/issues/new?template=feature-request.md&labels=enhancement
.. _Question: https://github.com/cloether/skeleton/issues/new?template=question.md&labels=question
.. _Assistance: https://github.com/cloether/skeleton/issues/new?template=need-help.md&labels=help+wanted
.. _LICENSE: https://github.com/cloether/skeleton/blob/master/LICENSE.txt

Copyright © 2025 cloether
147 changes: 103 additions & 44 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,86 @@
This file only contains a selection of the most common options.

For a full list see the documentation:
http://www.sphinx-doc.org/en/master/config
https://www.sphinx-doc.org/en/master/config
"""
from __future__ import absolute_import, print_function, unicode_literals

import os
import runpy
import sys
import time

from setuptools import find_packages

# -- Path setup -----------------------------------------------------
# If extensions (or modules to document with autodoc) are in another
# directory, add these directories to sys.path here. If the directory
# is relative to the documentation root, use os.path.abspath to make
# it absolute, like shown here.
sys.path.insert(0, os.path.abspath(__file__))

from skeleton.__version__ import (
__author__,
__title__,
__version__,
__description__
) # noqa
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../"))

sys.path.insert(0, os.path.abspath(__file__))
sys.path.insert(0, project_root)


def module_name(exclude=("docs*", "examples*", "scripts*", "tests*", "build*", "venv*"),
where=".", include=("*",), default=None):
"""Infer the top-level module name for the current project.

Returns:
str: First matching module name, or `default` if none found.
"""
packages = find_packages(where=where, include=include, exclude=exclude)
return next(iter(sorted(packages)), default)


def load_metadata_from_version_file(root=None, module=None):
"""Loads metadata from a __version__.py file somewhere under the project root.

Args:
root (str): Path to the root of the project. If None, the current directory is used.
module (str): Name of the module to load. If None, the first found module is used.

Returns:
dict: {
'__title__': str,
'__author__': str,
'__version__': str,
'__description__': str
}
"""
if root is None:
root = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../"))

if module is None:
module = module_name(where=root)

version_file = os.path.join(root, module, "__version__.py")

if not os.path.isfile(version_file):
# Search for any __version__.py
for root, dirs, files in os.walk(root):
if "__version__.py" in files:
version_file = os.path.join(root, "__version__.py")
break
else:
raise FileNotFoundError("Could not locate __version__.py in project.")

metadata = runpy.run_path(version_file)
return {
"__title__": metadata.get("__title__", os.path.basename(root)),
"__author__": metadata.get("__author__", "Unknown"),
"__version__": metadata.get("__version__", "0.0.0"),
"__description__": metadata.get("__description__", ""),
}


__meta__ = load_metadata_from_version_file(root=project_root)
__title__ = __meta__["__title__"]
__author__ = __meta__["__author__"]
__version__ = __meta__["__version__"]
__description__ = __meta__["__description__"]

# -- Project information --------------------------------------------

Expand All @@ -33,7 +92,7 @@
# noinspection PyShadowingBuiltins
copyright = "{0}, {1}".format(author, time.strftime("%Y"))
version = "{0}.".format(__version__.split(".")[:-1]) # Short X.Y version.
release = __version__ # Full version, including alpha/beta/rc tags
release = __version__ # full version, including alpha/beta/rc tags

# -- General configuration ------------------------------------------

Expand All @@ -47,11 +106,11 @@
# https://www.sphinx-doc.org/en/master/usage/extensions/viewcode.html
# https://www.sphinx-doc.org/en/master/usage/extensions/todo.html
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.todo",
"sphinxcontrib.napoleon",
"guzzle_sphinx_theme"
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.todo",
"sphinx.ext.napoleon",
"guzzle_sphinx_theme"
]

intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
Expand Down Expand Up @@ -93,12 +152,12 @@

# Custom sidebar templates, filenames relative to this file.
html_sidebars = {
"**": [
"logo-text.html",
"globaltoc.html",
"localtoc.html",
"searchbox.html"
]
"**": [
"logo-text.html",
"globaltoc.html",
"localtoc.html",
"searchbox.html"
]
}

# Output file base name for HTML help builder.
Expand All @@ -117,25 +176,25 @@
# -- Options for LaTeX output ---------------------------------------

latex_elements = {
# Paper size ("letterpaper" or "a4paper").
# "papersize": "letterpaper",
#
# The font size ("10pt", "11pt" or "12pt").
# "pointsize": "10pt",
#
# Additional stuff for the LaTeX preamble.
# "preamble": "",
# Paper size ("letterpaper" or "a4paper").
# "papersize": "letterpaper",
#
# The font size ("10pt", "11pt" or "12pt").
# "pointsize": "10pt",
#
# Additional stuff for the LaTeX preamble.
# "preamble": "",
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author,
# documentclass [howto/manual]).
latex_documents = [
("index",
"{0}.tex".format(project),
"{0} Documentation".format(project),
author,
"manual")
("index",
"{0}.tex".format(project),
"{0} Documentation".format(project),
author,
"manual")
]

# The name of an image file (relative to this directory) to place at
Expand Down Expand Up @@ -163,10 +222,10 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
("index", project,
"{0} Documentation".format(project),
[author],
3)
("index", project,
"{0} Documentation".format(project),
[author],
3)
]

# If true, show URL addresses after external links.
Expand All @@ -179,13 +238,13 @@
# dir menu entry, description, category)

texinfo_documents = [
("index",
project,
"{0} Documentation".format(project),
author,
project,
__description__,
"Miscellaneous"),
("index",
project,
"{0} Documentation".format(project),
author,
project,
__description__,
"Miscellaneous"),
]

# Documents to append as an appendix to all manuals.
Expand Down
Loading