Skip to content

Commit ace5c02

Browse files
authored
Merge pull request #1 from cloether/feature/maintenance
Feature/maintenance
2 parents b5a660e + e21df48 commit ace5c02

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1393
-924
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"type": "enhancement",
3+
"category": "documentation",
4+
"description": "updated documentation generation"
5+
}

.github/workflows/cleanup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
validate-data:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v4
1010
- name: Cleanup temporary files/directories
1111
run: |
1212
./scripts/cleanup.py

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
matrix:
2222
python-version: [ 3.7, 3.8, 3.9 ]
2323
steps:
24-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v4
2525
- name: Set up Python ${{ matrix.python-version }}
2626
uses: actions/setup-python@v2
2727
with:

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ dmypy.json
135135
# MacOS
136136
.DS_Store
137137

138-
# Testing Directories
138+
# Testing Files and Directories
139+
tests/*.log
139140
tests/.pytest_cache/
140141
tests/reports/
141-
tests/*.log
142+
tests/logs/

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ python:
66
- "3.7"
77
- "3.8"
88
- "3.9"
9+
- "3.10"
10+
- "3.11"
11+
- "3.12"
912
install: pip install tox-travis
1013
script: tox
11-
after_success: pycodestyle
14+
after_success: pycodestyle

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-alpine
1+
FROM python:3.13-alpine
22
RUN mkdir /app
33
WORKDIR /app
44
COPY requirements.txt .
@@ -7,4 +7,4 @@ COPY . .
77
ENV PYTHONPATH="/app"
88
RUN addgroup -S projects && adduser -S -H projects -G projects
99
RUN chown -R projects:projects /app
10-
USER projects
10+
USER projects

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@ Install documentation dependencies and build:
4141

4242
## License
4343

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

4846
## Copyright
4947

50-
Copyright © 2021 Chad Loether
48+
Copyright © 2025 cloether

README.rst

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,69 @@
1-
..
2-
https://docutils.sourceforge.io/docs/user/rst/quickref.html
3-
https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet
4-
51
Skeleton
62
========
73

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

10-
The official repo is `here`_.
6+
The official repo is `here <https://github.com/cloether/skeleton>`__.
117

12-
.. note:: This library is under active development.
8+
**Note**: This library is under active development.
139

1410
Installation
1511
------------
16-
To install the library into the current virtual environment::
1712

18-
$ pip install skeleton
13+
Install in virtual environment:
1914

20-
or::
15+
::
2116

22-
$ python -m pip install skeleton
17+
$ pip install skeleton
2318

2419
Running the Tests
2520
-----------------
26-
Install test dependencies and run `tox`::
2721

28-
$ pip install skeleton[tests]
29-
$ tox
22+
Install test dependencies and run ``tox``:
23+
24+
::
25+
26+
$ pip install skeleton[tests]
27+
$ tox
3028

3129
Building the Docs
3230
-----------------
33-
Install documentation dependencies and build::
3431

35-
$ pip install skeleton[docs]
36-
$ python setup.py docs
32+
Install documentation dependencies and build:
33+
34+
::
35+
36+
$ pip install skeleton[docs]
37+
$ python setup.py docs
3738

3839
Requirements
3940
------------
41+
4042
- six
4143
- appdirs
4244

4345
Support
4446
-------
45-
- Ask a `Question`_.
46-
- Request `Assistance`_.
47-
- Submit `Bug Report`_.
48-
- Submit `Feature Request`_.
49-
- Submit `Issue`_.
47+
48+
- Ask a
49+
`Question <https://github.com/cloether/skeleton/issues/new?template=question.md&labels=question>`__
50+
- Request
51+
`Assistance <https://github.com/cloether/skeleton/issues/new?template=need-help.md&labels=help+wanted>`__
52+
- Submit `Bug
53+
Report <https://github.com/cloether/skeleton/issues/new?template=bug-report.md&labels=bug>`__
54+
- Submit `Feature
55+
Request <https://github.com/cloether/skeleton/issues/new?template=feature-request.md&labels=enhancement>`__
56+
- Submit
57+
`Issue <https://github.com/cloether/skeleton/issues/new?template=blank-issue.md>`__
5058

5159
License
5260
-------
53-
MIT - See `LICENSE`_ for more information.
61+
62+
MIT - See
63+
`LICENSE <https://github.com/cloether/skeleton/blob/master/LICENSE.txt>`__
64+
for more information.
5465

5566
Copyright
5667
---------
57-
Copyright © 2021 Chad Loether
58-
59-
.. _here: https://github.com/cloether/skeleton
60-
.. _Issue: https://github.com/cloether/skeleton/issues/new?template=blank-issue.md
61-
.. _Bug Report: https://github.com/cloether/skeleton/issues/new?template=bug-report.md&labels=bug
62-
.. _Feature Request: https://github.com/cloether/skeleton/issues/new?template=feature-request.md&labels=enhancement
63-
.. _Question: https://github.com/cloether/skeleton/issues/new?template=question.md&labels=question
64-
.. _Assistance: https://github.com/cloether/skeleton/issues/new?template=need-help.md&labels=help+wanted
65-
.. _LICENSE: https://github.com/cloether/skeleton/blob/master/LICENSE.txt
68+
69+
Copyright © 2025 cloether

docs/source/conf.py

Lines changed: 103 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,86 @@
44
This file only contains a selection of the most common options.
55
66
For a full list see the documentation:
7-
http://www.sphinx-doc.org/en/master/config
7+
https://www.sphinx-doc.org/en/master/config
88
"""
99
from __future__ import absolute_import, print_function, unicode_literals
1010

1111
import os
12+
import runpy
1213
import sys
1314
import time
1415

16+
from setuptools import find_packages
17+
1518
# -- Path setup -----------------------------------------------------
1619
# If extensions (or modules to document with autodoc) are in another
1720
# directory, add these directories to sys.path here. If the directory
1821
# is relative to the documentation root, use os.path.abspath to make
1922
# it absolute, like shown here.
20-
sys.path.insert(0, os.path.abspath(__file__))
2123

22-
from skeleton.__version__ import (
23-
__author__,
24-
__title__,
25-
__version__,
26-
__description__
27-
) # noqa
24+
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../"))
25+
26+
sys.path.insert(0, os.path.abspath(__file__))
27+
sys.path.insert(0, project_root)
28+
29+
30+
def module_name(exclude=("docs*", "examples*", "scripts*", "tests*", "build*", "venv*"),
31+
where=".", include=("*",), default=None):
32+
"""Infer the top-level module name for the current project.
33+
34+
Returns:
35+
str: First matching module name, or `default` if none found.
36+
"""
37+
packages = find_packages(where=where, include=include, exclude=exclude)
38+
return next(iter(sorted(packages)), default)
39+
40+
41+
def load_metadata_from_version_file(root=None, module=None):
42+
"""Loads metadata from a __version__.py file somewhere under the project root.
43+
44+
Args:
45+
root (str): Path to the root of the project. If None, the current directory is used.
46+
module (str): Name of the module to load. If None, the first found module is used.
47+
48+
Returns:
49+
dict: {
50+
'__title__': str,
51+
'__author__': str,
52+
'__version__': str,
53+
'__description__': str
54+
}
55+
"""
56+
if root is None:
57+
root = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../"))
58+
59+
if module is None:
60+
module = module_name(where=root)
61+
62+
version_file = os.path.join(root, module, "__version__.py")
63+
64+
if not os.path.isfile(version_file):
65+
# Search for any __version__.py
66+
for root, dirs, files in os.walk(root):
67+
if "__version__.py" in files:
68+
version_file = os.path.join(root, "__version__.py")
69+
break
70+
else:
71+
raise FileNotFoundError("Could not locate __version__.py in project.")
72+
73+
metadata = runpy.run_path(version_file)
74+
return {
75+
"__title__": metadata.get("__title__", os.path.basename(root)),
76+
"__author__": metadata.get("__author__", "Unknown"),
77+
"__version__": metadata.get("__version__", "0.0.0"),
78+
"__description__": metadata.get("__description__", ""),
79+
}
80+
81+
82+
__meta__ = load_metadata_from_version_file(root=project_root)
83+
__title__ = __meta__["__title__"]
84+
__author__ = __meta__["__author__"]
85+
__version__ = __meta__["__version__"]
86+
__description__ = __meta__["__description__"]
2887

2988
# -- Project information --------------------------------------------
3089

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

3897
# -- General configuration ------------------------------------------
3998

@@ -47,11 +106,11 @@
47106
# https://www.sphinx-doc.org/en/master/usage/extensions/viewcode.html
48107
# https://www.sphinx-doc.org/en/master/usage/extensions/todo.html
49108
extensions = [
50-
"sphinx.ext.autodoc",
51-
"sphinx.ext.viewcode",
52-
"sphinx.ext.todo",
53-
"sphinxcontrib.napoleon",
54-
"guzzle_sphinx_theme"
109+
"sphinx.ext.autodoc",
110+
"sphinx.ext.viewcode",
111+
"sphinx.ext.todo",
112+
"sphinx.ext.napoleon",
113+
"guzzle_sphinx_theme"
55114
]
56115

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

94153
# Custom sidebar templates, filenames relative to this file.
95154
html_sidebars = {
96-
"**": [
97-
"logo-text.html",
98-
"globaltoc.html",
99-
"localtoc.html",
100-
"searchbox.html"
101-
]
155+
"**": [
156+
"logo-text.html",
157+
"globaltoc.html",
158+
"localtoc.html",
159+
"searchbox.html"
160+
]
102161
}
103162

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

119178
latex_elements = {
120-
# Paper size ("letterpaper" or "a4paper").
121-
# "papersize": "letterpaper",
122-
#
123-
# The font size ("10pt", "11pt" or "12pt").
124-
# "pointsize": "10pt",
125-
#
126-
# Additional stuff for the LaTeX preamble.
127-
# "preamble": "",
179+
# Paper size ("letterpaper" or "a4paper").
180+
# "papersize": "letterpaper",
181+
#
182+
# The font size ("10pt", "11pt" or "12pt").
183+
# "pointsize": "10pt",
184+
#
185+
# Additional stuff for the LaTeX preamble.
186+
# "preamble": "",
128187
}
129188

130189
# Grouping the document tree into LaTeX files. List of tuples
131190
# (source start file, target name, title, author,
132191
# documentclass [howto/manual]).
133192
latex_documents = [
134-
("index",
135-
"{0}.tex".format(project),
136-
"{0} Documentation".format(project),
137-
author,
138-
"manual")
193+
("index",
194+
"{0}.tex".format(project),
195+
"{0} Documentation".format(project),
196+
author,
197+
"manual")
139198
]
140199

141200
# The name of an image file (relative to this directory) to place at
@@ -163,10 +222,10 @@
163222
# One entry per manual page. List of tuples
164223
# (source start file, name, description, authors, manual section).
165224
man_pages = [
166-
("index", project,
167-
"{0} Documentation".format(project),
168-
[author],
169-
3)
225+
("index", project,
226+
"{0} Documentation".format(project),
227+
[author],
228+
3)
170229
]
171230

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

181240
texinfo_documents = [
182-
("index",
183-
project,
184-
"{0} Documentation".format(project),
185-
author,
186-
project,
187-
__description__,
188-
"Miscellaneous"),
241+
("index",
242+
project,
243+
"{0} Documentation".format(project),
244+
author,
245+
project,
246+
__description__,
247+
"Miscellaneous"),
189248
]
190249

191250
# Documents to append as an appendix to all manuals.

0 commit comments

Comments
 (0)