Skip to content

Commit 921280e

Browse files
committed
Big overhaul to modernize
- Removed pkg_resources, setuptools dependencies - Updated pyproject.toml for use with uv - Ruff formatting throughout - Added Github CI to replace circleci-based testing
1 parent 1b7d7b9 commit 921280e

20 files changed

+3351
-1601
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: astral-sh/setup-uv@v1
16+
17+
- name: Sync dev dependencies
18+
run: uv sync --group dev
19+
20+
- name: Run pytest
21+
run: uv run pytest
22+
23+
- name: Build docs
24+
run: uv run sphinx-build -b html Doc Doc/_build/html
25+
26+
- name: Upload docs artifact
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: docs-html
30+
path: Doc/_build/html

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

Doc/conf.py

Lines changed: 78 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -15,185 +15,187 @@
1515

1616
import sys
1717
import os
18+
from importlib import metadata
1819

1920
# If extensions (or modules to document with autodoc) are in another directory,
2021
# add these directories to sys.path here. If the directory is relative to the
2122
# documentation root, use os.path.abspath to make it absolute, like shown here.
22-
sys.path.insert(0, os.path.abspath('.'))
23-
sys.path.insert(0, os.path.abspath('..'))
23+
sys.path.insert(0, os.path.abspath("."))
24+
sys.path.insert(0, os.path.abspath(".."))
2425

2526

2627
# -- General configuration ------------------------------------------------
2728

2829
# If your documentation needs a minimal Sphinx version, state it here.
29-
#needs_sphinx = '1.0'
30+
# needs_sphinx = '1.0'
3031

3132
# Add any Sphinx extension module names here, as strings. They can be
3233
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3334
# ones.
3435
extensions = [
35-
'sphinx.ext.autodoc',
36-
'sphinx.ext.viewcode',
36+
"sphinx.ext.autodoc",
37+
"sphinx.ext.viewcode",
3738
]
3839

3940
# Add any paths that contain templates here, relative to this directory.
40-
templates_path = ['_templates']
41+
templates_path = ["_templates"]
4142

4243
# The suffix of source filenames.
43-
source_suffix = '.rst'
44+
source_suffix = ".rst"
4445

4546
# The encoding of source files.
46-
#source_encoding = 'utf-8-sig'
47+
# source_encoding = 'utf-8-sig'
4748

4849
# The master toctree document.
49-
master_doc = 'index'
50+
master_doc = "index"
5051

5152
# General information about the project.
52-
project = 'SolidPython'
53-
copyright = '2014, Evan Jones'
53+
project = "SolidPython"
54+
author = "Evan Jones"
55+
copyright = "2014-2025, Evan Jones"
5456

55-
# The version info for the project you're documenting, acts as replacement for
56-
# |version| and |release|, also used in various other places throughout the
57-
# built documents.
58-
#
59-
# The short X.Y version.
60-
version = '0.1.2'
61-
# The full version, including alpha/beta/rc tags.
62-
release = '0.1.2'
57+
try:
58+
release = metadata.version("solidpython")
59+
except metadata.PackageNotFoundError:
60+
from pathlib import Path
61+
import tomllib
62+
63+
with (Path(__file__).parent.parent / "pyproject.toml").open("rb") as f:
64+
release = tomllib.load(f)["project"]["version"]
65+
66+
version = ".".join(release.split(".")[:2])
6367

6468
# The language for content autogenerated by Sphinx. Refer to documentation
6569
# for a list of supported languages.
66-
#language = None
70+
# language = None
6771

6872
# There are two options for replacing |today|: either, you set today to some
6973
# non-false value, then it is used:
70-
#today = ''
74+
# today = ''
7175
# Else, today_fmt is used as the format for a strftime call.
72-
#today_fmt = '%B %d, %Y'
76+
# today_fmt = '%B %d, %Y'
7377

7478
# List of patterns, relative to source directory, that match files and
7579
# directories to ignore when looking for source files.
76-
exclude_patterns = ['_build']
80+
exclude_patterns = ["_build"]
7781

7882
# The reST default role (used for this markup: `text`) to use for all
7983
# documents.
80-
#default_role = None
84+
# default_role = None
8185

8286
# If true, '()' will be appended to :func: etc. cross-reference text.
83-
#add_function_parentheses = True
87+
# add_function_parentheses = True
8488

8589
# If true, the current module name will be prepended to all description
8690
# unit titles (such as .. function::).
87-
#add_module_names = True
91+
# add_module_names = True
8892

8993
# If true, sectionauthor and moduleauthor directives will be shown in the
9094
# output. They are ignored by default.
91-
#show_authors = False
95+
# show_authors = False
9296

9397
# The name of the Pygments (syntax highlighting) style to use.
94-
pygments_style = 'sphinx'
98+
pygments_style = "sphinx"
9599

96100
# A list of ignored prefixes for module index sorting.
97-
#modindex_common_prefix = []
101+
# modindex_common_prefix = []
98102

99103
# If true, keep warnings as "system message" paragraphs in the built documents.
100-
#keep_warnings = False
104+
# keep_warnings = False
101105

102106

103107
# -- Options for HTML output ----------------------------------------------
104108

105109
# The theme to use for HTML and HTML Help pages. See the documentation for
106110
# a list of builtin themes.
107-
html_theme = 'default'
111+
html_theme = "default"
108112

109113
# Theme options are theme-specific and customize the look and feel of a theme
110114
# further. For a list of options available for each theme, see the
111115
# documentation.
112-
#html_theme_options = {}
116+
# html_theme_options = {}
113117

114118
# Add any paths that contain custom themes here, relative to this directory.
115-
#html_theme_path = []
119+
# html_theme_path = []
116120

117121
# The name for this set of Sphinx documents. If None, it defaults to
118122
# "<project> v<release> documentation".
119-
#html_title = None
123+
# html_title = None
120124

121125
# A shorter title for the navigation bar. Default is the same as html_title.
122-
#html_short_title = None
126+
# html_short_title = None
123127

124128
# The name of an image file (relative to this directory) to place at the top
125129
# of the sidebar.
126-
#html_logo = None
130+
# html_logo = None
127131

128132
# The name of an image file (within the static path) to use as favicon of the
129133
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
130134
# pixels large.
131-
#html_favicon = None
135+
# html_favicon = None
132136

133137
# Add any paths that contain custom static files (such as style sheets) here,
134138
# relative to this directory. They are copied after the builtin static files,
135139
# so a file named "default.css" will overwrite the builtin "default.css".
136-
html_static_path = ['_static']
140+
html_static_path = ["_static"]
137141

138142
# Add any extra paths that contain custom files (such as robots.txt or
139143
# .htaccess) here, relative to this directory. These files are copied
140144
# directly to the root of the documentation.
141-
#html_extra_path = []
145+
# html_extra_path = []
142146

143147
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
144148
# using the given strftime format.
145-
#html_last_updated_fmt = '%b %d, %Y'
149+
# html_last_updated_fmt = '%b %d, %Y'
146150

147151
# If true, SmartyPants will be used to convert quotes and dashes to
148152
# typographically correct entities.
149-
#html_use_smartypants = True
153+
# html_use_smartypants = True
150154

151155
# Custom sidebar templates, maps document names to template names.
152-
#html_sidebars = {}
156+
# html_sidebars = {}
153157

154158
# Additional templates that should be rendered to pages, maps page names to
155159
# template names.
156-
#html_additional_pages = {}
160+
# html_additional_pages = {}
157161

158162
# If false, no module index is generated.
159-
#html_domain_indices = True
163+
# html_domain_indices = True
160164

161165
# If false, no index is generated.
162-
#html_use_index = True
166+
# html_use_index = True
163167

164168
# If true, the index is split into individual pages for each letter.
165-
#html_split_index = False
169+
# html_split_index = False
166170

167171
# If true, links to the reST sources are added to the pages.
168-
#html_show_sourcelink = True
172+
# html_show_sourcelink = True
169173

170174
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
171-
#html_show_sphinx = True
175+
# html_show_sphinx = True
172176

173177
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
174-
#html_show_copyright = True
178+
# html_show_copyright = True
175179

176180
# If true, an OpenSearch description file will be output, and all pages will
177181
# contain a <link> tag referring to it. The value of this option must be the
178182
# base URL from which the finished HTML is served.
179-
#html_use_opensearch = ''
183+
# html_use_opensearch = ''
180184

181185
# This is the file name suffix for HTML files (e.g. ".xhtml").
182-
#html_file_suffix = None
186+
# html_file_suffix = None
183187

184188
# Output file base name for HTML help builder.
185-
htmlhelp_basename = 'SolidPythondoc'
189+
htmlhelp_basename = "SolidPythondoc"
186190

187191

188192
# -- Options for LaTeX output ---------------------------------------------
189193

190194
latex_elements = {
191195
# The paper size ('letterpaper' or 'a4paper').
192196
#'papersize': 'letterpaper',
193-
194197
# The font size ('10pt', '11pt' or '12pt').
195198
#'pointsize': '10pt',
196-
197199
# Additional stuff for the LaTeX preamble.
198200
#'preamble': '',
199201
}
@@ -202,42 +204,38 @@
202204
# (source start file, target name, title,
203205
# author, documentclass [howto, manual, or own class]).
204206
latex_documents = [
205-
('index', 'SolidPython.tex', 'SolidPython Documentation',
206-
'Evan Jones', 'manual'),
207+
("index", "SolidPython.tex", "SolidPython Documentation", "Evan Jones", "manual"),
207208
]
208209

209210
# The name of an image file (relative to this directory) to place at the top of
210211
# the title page.
211-
#latex_logo = None
212+
# latex_logo = None
212213

213214
# For "manual" documents, if this is true, then toplevel headings are parts,
214215
# not chapters.
215-
#latex_use_parts = False
216+
# latex_use_parts = False
216217

217218
# If true, show page references after internal links.
218-
#latex_show_pagerefs = False
219+
# latex_show_pagerefs = False
219220

220221
# If true, show URL addresses after external links.
221-
#latex_show_urls = False
222+
# latex_show_urls = False
222223

223224
# Documents to append as an appendix to all manuals.
224-
#latex_appendices = []
225+
# latex_appendices = []
225226

226227
# If false, no module index is generated.
227-
#latex_domain_indices = True
228+
# latex_domain_indices = True
228229

229230

230231
# -- Options for manual page output ---------------------------------------
231232

232233
# One entry per manual page. List of tuples
233234
# (source start file, name, description, authors, manual section).
234-
man_pages = [
235-
('index', 'solidpython', 'SolidPython Documentation',
236-
['Evan Jones'], 1)
237-
]
235+
man_pages = [("index", "solidpython", "SolidPython Documentation", ["Evan Jones"], 1)]
238236

239237
# If true, show URL addresses after external links.
240-
#man_show_urls = False
238+
# man_show_urls = False
241239

242240

243241
# -- Options for Texinfo output -------------------------------------------
@@ -246,19 +244,25 @@
246244
# (source start file, target name, title, author,
247245
# dir menu entry, description, category)
248246
texinfo_documents = [
249-
('index', 'SolidPython', 'SolidPython Documentation',
250-
'Evan Jones', 'SolidPython', 'One line description of project.',
251-
'Miscellaneous'),
247+
(
248+
"index",
249+
"SolidPython",
250+
"SolidPython Documentation",
251+
"Evan Jones",
252+
"SolidPython",
253+
"One line description of project.",
254+
"Miscellaneous",
255+
),
252256
]
253257

254258
# Documents to append as an appendix to all manuals.
255-
#texinfo_appendices = []
259+
# texinfo_appendices = []
256260

257261
# If false, no module index is generated.
258-
#texinfo_domain_indices = True
262+
# texinfo_domain_indices = True
259263

260264
# How to display URL addresses: 'footnote', 'no', or 'inline'.
261-
#texinfo_show_urls = 'footnote'
265+
# texinfo_show_urls = 'footnote'
262266

263267
# If true, do not generate a @detailmenu in the "Top" node's menu.
264-
#texinfo_no_detailmenu = False
268+
# texinfo_no_detailmenu = False

0 commit comments

Comments
 (0)