From 8af53ff3bfbe6425bdc0908df9828503983306ca Mon Sep 17 00:00:00 2001 From: Chris Mackey Date: Tue, 15 Oct 2024 19:24:07 -0700 Subject: [PATCH] ci(dev-deps): Update CI and dev deps to run on Python 3.12 --- .github/workflows/ci.yaml | 6 ++-- dev-requirements.txt | 19 +++++------ docs/_static/custom.css | 67 +++++++++++++++++++++++-------------- docs/_templates/layout.html | 1 + docs/conf.py | 25 +++++--------- 5 files changed, 62 insertions(+), 56 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1c3e5b3..15b13e9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,7 @@ jobs: name: Unit tests strategy: matrix: - python-version: ['3.10'] + python-version: ['3.10', '3.12'] os: [macos-latest, ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} @@ -38,7 +38,7 @@ jobs: - name: set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: '3.12' - name: set up node # we need node for for semantic release uses: actions/setup-node@v4 with: @@ -72,7 +72,7 @@ jobs: - name: set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: '3.12' - name: install dependencies run: | pip install -U . diff --git a/dev-requirements.txt b/dev-requirements.txt index a5c1764..14bb4b6 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,13 +1,10 @@ -pytest==6.2.4 -pytest-cov==2.12.0 -Sphinx==5.3.0 +pytest==8.3.2 +Sphinx==8.0.2 sphinx-bootstrap-theme==0.8.1 -sphinxcontrib-websupport==1.2.4 sphinxcontrib-fulltoc==1.2.0 -sphinx-click==4.4.0 -twine==3.4.1 -wheel==0.38.1 -setuptools==65.5.1 -importlib-metadata==4.8.0 -jinja2==3.0.3 -markupsafe==2.0.1 +sphinxcontrib-websupport==2.0.0 +sphinx-click==6.0.0 +twine==5.1.1 +wheel==0.44.0 +setuptools==75.1.0 +importlib-metadata==8.5.0 diff --git a/docs/_static/custom.css b/docs/_static/custom.css index 5e15300..a180f11 100644 --- a/docs/_static/custom.css +++ b/docs/_static/custom.css @@ -5,44 +5,61 @@ * Sphinx stylesheet -- Bootstrap theme. */ +/* Overwrite colors */ +div.navbar-inverse { + background-color: #B87102; + border-color: #B87102; +} +a { + color: #B87102; +} +a:visited { + color: #B87102; +} +code { + color: #B87102; +} +div.bs-sidenav a { + color: #333333; +} -/* The code below is based on the bootstrap website sidebar */ +/* Prevent top nav from blocking docs */ +div.navbar-fixed-top { + position: absolute; +} +/* Indent the side nav when in mobile mode */ +@media screen and (min-width: 0px) { + div.bs-sidenav ul { + margin-bottom: 0; + padding-left: 5px; + list-style: none; + } +} -/* Show and affix the side nav when space allows it */ +/* Widen and de-indent the side nav when space is restricted */ @media screen and (min-width: 992px) { .bs-sidenav .nav > .active > ul { display: block; } div.bs-sidenav ul { margin-bottom: 0; - padding-left: 5px; + padding-left: 0px; list-style: none; } - div.bs-sidenav a { - color: #333333; - } - /* Widen the fixed sidenav */ - .bs-sidenav.affix, - .bs-sidenav.affix-bottom { - width: 292px; - } - .bs-sidenav.affix { - position: fixed; /* Undo the static from mobile first approach */ - } - .bs-sidenav.affix-bottom { - position: absolute; /* Undo the static from mobile first approach */ - } - .bs-sidenav.affix-bottom .bs-sidenav, - .bs-sidenav.affix .bs-sidenav { - margin-top: 0; - margin-bottom: 0; + .bs-sidenav { + width: 300px; } } + +/* Slightly indent the side nav when space allows it */ @media screen and (min-width: 1200px) { - /* Widen the fixed sidenav again */ - .bs-sidenav.affix-bottom, - .bs-sidenav.affix { - width: 360px; + div.bs-sidenav ul { + margin-bottom: 0; + padding-left: 5px; + list-style: none; + } + .bs-sidenav { + width: 370px; } } diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html index ae4101c..adcc7a7 100644 --- a/docs/_templates/layout.html +++ b/docs/_templates/layout.html @@ -48,6 +48,7 @@ {% endif %} {%- block extrahead %} + diff --git a/docs/conf.py b/docs/conf.py index 69fc0fc..68bd943 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,6 +16,10 @@ import sys import re import datetime + +# The theme to use for HTML and HTML Help pages +import sphinx_bootstrap_theme + now = datetime.datetime.now() sys.path.insert(0, os.path.abspath('../')) @@ -71,7 +75,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = 'en' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -84,11 +88,6 @@ # -- Options for HTML output ------------------------------------------------- -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -import sphinx_bootstrap_theme - # html_theme = 'alabaster' html_theme = 'bootstrap' html_theme_path = sphinx_bootstrap_theme.get_html_theme_path() @@ -125,6 +124,7 @@ # 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_css_files = ['custom.css'] # Custom sidebar templates, must be a dictionary that maps document names # to template names. @@ -596,7 +596,8 @@ def update_doc_index(proj_folder, lib_name): with open(os.path.join(proj_folder, "index.rst"), 'w') as index_file: text = index_file.write(text_updated) else: - print("[CLI doc\\index]: index.rst update not possible - content format cannot be recognized.") + print("[CLI doc\\index]: index.rst update not possible - content \ + format cannot be recognized.") return -1 return 1 @@ -607,13 +608,3 @@ def update_doc_index(proj_folder, lib_name): create_cli_files() # ----------------------------------------------------------------------------- - - -def setup(app): - """Run custom code with access to the Sphinx application object - Args: - app: the Sphinx application object - """ - - # Add bootstrap theme custom stylesheet - app.add_css_file("custom.css")