-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial hatch project structure. * Removed mypy messages * Applied isort and black changes * Editorial fix * Typo in README * Typo in README * Updated to sphinx 7 * Doc generates (almost) OK. * Blacked version * Repaired documentation * Finalized all checks * Removed hatch matrices from github actions * Removed mypy matrix * Removed mypy matrix * Removed mypy matrix
- Loading branch information
Showing
30 changed files
with
911 additions
and
1,338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: [main, master] | ||
|
||
concurrency: | ||
group: test-${{ github.head_ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
PYTHONUNBUFFERED: "1" | ||
FORCE_COLOR: "1" | ||
|
||
jobs: | ||
run: | ||
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Hatch | ||
run: pip install --upgrade hatch | ||
|
||
- name: Run style check | ||
run: hatch run style:check | ||
|
||
- name: Check types | ||
run: hatch run types:check | ||
|
||
- name: Run static analysis | ||
run: hatch fmt --check | ||
|
||
- name: Run tests | ||
run: hatch run test.py${{ matrix.python-version }}:cov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,57 @@ | ||
# ruff: noqa: INP001 | ||
|
||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# This file only contains a selection of the most common options. For a full | ||
# list see the documentation: | ||
# For the full list of built-in configuration values, see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- 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. | ||
# | ||
import os | ||
import sys | ||
import pkg_resources | ||
|
||
_sources = [ | ||
os.path.abspath(os.path.join('..', '..', 'src')), | ||
os.path.abspath(os.path.join('..', '..', 'examples')), | ||
] | ||
sys.path[0:0] = _sources | ||
|
||
|
||
# -- Project information ----------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | ||
|
||
project = 'sliplib' | ||
copyright = '2020, Ruud de Jong' | ||
author = 'Ruud de Jong' | ||
|
||
try: | ||
# The full version, including alpha/beta/rc tags | ||
release = pkg_resources.get_distribution(f'{project}').version | ||
except pkg_resources.DistributionNotFound: | ||
print(f'To build the documentation, the distribution information of {project}') | ||
print('has to be available. Either install the package into your') | ||
print('development environment or run "setup.py develop" or "pip install -e"') | ||
print('to setup the metadata. A virtual environment is recommended!') | ||
sys.exit(1) | ||
del pkg_resources | ||
|
||
version = '.'.join(release.split('.')[:2]) # version contains major.minor. | ||
|
||
project = "SlipLib" | ||
copyright = "2024, Ruud de Jong" # noqa: A001 | ||
author = "Ruud de Jong" | ||
github_username = "rhjdjong" | ||
github_repository = "https://github.com/rhjdjong/SlipLib/" | ||
|
||
# -- General configuration --------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
|
||
# Include the example directory in sys.path\ | ||
# in order to generate the documentation for the examples | ||
sys.path.append(os.path.abspath(os.path.join("..", "..", "examples"))) | ||
|
||
# Add any Sphinx extension module names here, as strings. They can be | ||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
# ones. | ||
extensions = [ | ||
'sphinx.ext.autodoc', | ||
'sphinx.ext.intersphinx', | ||
'sphinx.ext.napoleon', | ||
'sphinx.ext.autodoc.typehints', | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.autodoc.typehints", | ||
"sphinx.ext.intersphinx", | ||
"sphinx.ext.napoleon", | ||
"sphinx.ext.viewcode", | ||
"sphinx_rtd_theme", | ||
"sphinx_tabs.tabs", | ||
"sphinx_toolbox.more_autodoc.autoprotocol", | ||
"sphinx_toolbox.more_autodoc.typehints", | ||
"sphinx_toolbox.more_autodoc.typevars", | ||
"sphinx_toolbox.more_autodoc.variables", | ||
"sphinx_autodoc_typehints", | ||
] | ||
|
||
autoclass_content = 'both' | ||
autodoc_typehints = 'description' | ||
add_module_names = False | ||
intersphinx_mapping = { | ||
'python': ('https://docs.python.org/3', None) | ||
} | ||
|
||
napoleon_use_rtype = True | ||
|
||
# Add any paths that contain templates here, relative to this directory. | ||
templates_path = ['_templates'] | ||
|
||
# List of patterns, relative to source directory, that match files and | ||
# directories to ignore when looking for source files. | ||
# This pattern also affects html_static_path and html_extra_path. | ||
templates_path = ["_templates"] | ||
exclude_patterns = [] | ||
|
||
napoleon_google_docstring = True | ||
# napoleon_use_rtype = False | ||
autoclass_content = "both" | ||
autodoc_typehints = "description" | ||
autodoc_type_aliases = {} | ||
add_module_names = False | ||
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)} | ||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
# | ||
html_theme = 'sphinx_rtd_theme' | ||
|
||
# Add any paths that contain custom static files (such as style sheets) here, | ||
# relative to this directory. They are copied after the builtin static files, | ||
# so a file named "default.css" will overwrite the builtin "default.css". | ||
html_static_path = ['_static'] | ||
html_theme = "sphinx_rtd_theme" | ||
html_static_path = ["_static"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.