From 92baa88f2f10b9989cbf0356580ef4a46118feb0 Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Tue, 25 Jul 2023 12:37:33 +0100 Subject: [PATCH 01/11] Basic sphinx docs with themes Co-authored-by: Ruaridh Gollifer --- .gitignore | 3 +++ .pre-commit-config.yaml | 1 + docs/Makefile | 20 ++++++++++++++++++++ docs/make.bat | 35 +++++++++++++++++++++++++++++++++++ docs/requirements.txt | 7 +++++++ docs/source/conf.py | 24 ++++++++++++++++++++++++ docs/source/index.rst | 29 +++++++++++++++++++++++++++++ 7 files changed, 119 insertions(+) create mode 100644 docs/Makefile create mode 100644 docs/make.bat create mode 100644 docs/requirements.txt create mode 100644 docs/source/conf.py create mode 100644 docs/source/index.rst diff --git a/.gitignore b/.gitignore index 66dbf51b..017e2457 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ *.egg-info *.pyc + +# Sphinx +docs/build diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fa9f94f1..246f49ce 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,6 +8,7 @@ repos: rev: v1.5.1 hooks: - id: forbid-tabs + exclude: docs/make.bat|docs/Makefile - repo: https://github.com/pappasam/toml-sort rev: v0.23.1 hooks: diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..d0c3cbf1 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 00000000..dc1312ab --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..b5a754c8 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,7 @@ +linkify-it-py +myst-parser +nbsphinx +pydata-sphinx-theme +setuptools-scm +sphinx +sphinx-autodoc-typehints diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 00000000..72087ef7 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,24 @@ +# Configuration file for the Sphinx documentation builder. # noQA: D100 +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = "Python Template" +copyright_var = "2023, UCL ARC" +author = "UCL ARC" + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + + +templates_path = ["_templates"] + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "pydata_sphinx_theme" +html_static_path = ["_static"] diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 00000000..8f45658d --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,29 @@ +.. Python Template documentation master file, created by + sphinx-quickstart on Tue Jul 25 11:26:38 2023. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to Lumache's documentation! +=================================== + +**Lumache** (/lu'make/) is a Python library for cooks and food lovers that +creates recipes mixing random ingredients. It pulls data from the `Open Food +Facts database `_ and offers a *simple* and +*intuitive* API. + +.. note:: + + This project is under active development. + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` From dc0e382ad360ff883e165c44b6a8d017bb59900a Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Tue, 24 Oct 2023 11:38:20 +0100 Subject: [PATCH 02/11] sanity check --- .gitignore | 2 ++ docs/Makefile | 20 -------------------- docs/make.bat | 35 ----------------------------------- docs/requirements.txt | 7 ------- docs/source/conf.py | 24 ------------------------ docs/source/index.rst | 29 ----------------------------- 6 files changed, 2 insertions(+), 115 deletions(-) delete mode 100644 docs/Makefile delete mode 100644 docs/make.bat delete mode 100644 docs/requirements.txt delete mode 100644 docs/source/conf.py delete mode 100644 docs/source/index.rst diff --git a/.gitignore b/.gitignore index 017e2457..b087810f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ # Sphinx docs/build +.DS_Store +.vscode/settings.json diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index d0c3cbf1..00000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = source -BUILDDIR = build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index dc1312ab..00000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=source -set BUILDDIR=build - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.https://www.sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "" goto help - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index b5a754c8..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -linkify-it-py -myst-parser -nbsphinx -pydata-sphinx-theme -setuptools-scm -sphinx -sphinx-autodoc-typehints diff --git a/docs/source/conf.py b/docs/source/conf.py deleted file mode 100644 index 72087ef7..00000000 --- a/docs/source/conf.py +++ /dev/null @@ -1,24 +0,0 @@ -# Configuration file for the Sphinx documentation builder. # noQA: D100 -# -# For the full list of built-in configuration values, see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Project information ----------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information - -project = "Python Template" -copyright_var = "2023, UCL ARC" -author = "UCL ARC" - -# -- General configuration --------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration - - -templates_path = ["_templates"] - - -# -- Options for HTML output ------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output - -html_theme = "pydata_sphinx_theme" -html_static_path = ["_static"] diff --git a/docs/source/index.rst b/docs/source/index.rst deleted file mode 100644 index 8f45658d..00000000 --- a/docs/source/index.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Python Template documentation master file, created by - sphinx-quickstart on Tue Jul 25 11:26:38 2023. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to Lumache's documentation! -=================================== - -**Lumache** (/lu'make/) is a Python library for cooks and food lovers that -creates recipes mixing random ingredients. It pulls data from the `Open Food -Facts database `_ and offers a *simple* and -*intuitive* API. - -.. note:: - - This project is under active development. - -.. toctree:: - :maxdepth: 2 - :caption: Contents: - - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` From fc3d010b1d2c78d7c30f3984b57bd19a5b0f4e8a Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Tue, 24 Oct 2023 11:40:10 +0100 Subject: [PATCH 03/11] remove vscode bit from gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index b087810f..297c8d9b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,3 @@ # Sphinx docs/build .DS_Store -.vscode/settings.json From 6b196030b1751bd141bb5c97715577913e251114 Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Tue, 24 Oct 2023 12:06:34 +0100 Subject: [PATCH 04/11] add sphinx template to cookiecutter template --- .pre-commit-config.yaml | 4 ++ .vscode/settings.json | 6 +++ {{cookiecutter.project_slug}}/docs/Makefile | 20 +++++++ {{cookiecutter.project_slug}}/docs/make.bat | 35 ++++++++++++ .../docs/source/conf.py | 54 +++++++++++++++++++ .../docs/source/index.rst | 20 +++++++ 6 files changed, 139 insertions(+) create mode 100644 .vscode/settings.json create mode 100644 {{cookiecutter.project_slug}}/docs/Makefile create mode 100644 {{cookiecutter.project_slug}}/docs/make.bat create mode 100644 {{cookiecutter.project_slug}}/docs/source/conf.py create mode 100644 {{cookiecutter.project_slug}}/docs/source/index.rst diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 246f49ce..07028c19 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,3 +37,7 @@ repos: rev: 23.7.0 hooks: - id: black + exclude: | + (?x)( + ^{{cookiecutter.project_slug}} + ) diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..9434d1eb --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "python.testing.pytestArgs": ["tests"], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true, + "esbonio.sphinx.confDir": "" +} diff --git a/{{cookiecutter.project_slug}}/docs/Makefile b/{{cookiecutter.project_slug}}/docs/Makefile new file mode 100644 index 00000000..d0c3cbf1 --- /dev/null +++ b/{{cookiecutter.project_slug}}/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/{{cookiecutter.project_slug}}/docs/make.bat b/{{cookiecutter.project_slug}}/docs/make.bat new file mode 100644 index 00000000..dc1312ab --- /dev/null +++ b/{{cookiecutter.project_slug}}/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/{{cookiecutter.project_slug}}/docs/source/conf.py b/{{cookiecutter.project_slug}}/docs/source/conf.py new file mode 100644 index 00000000..680e696d --- /dev/null +++ b/{{cookiecutter.project_slug}}/docs/source/conf.py @@ -0,0 +1,54 @@ +# Configuration file for the Sphinx documentation builder. # noqa: D100 + +# This file only contains a selection of the most common options. For a full +# list 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. +# + + +# -- Project information ----------------------------------------------------- + +project = "{{cookiecutter.project_name}}" +copyright = "2023, {{cookiecutter.author_name}}" # noqa: A001 +author = "{{cookiecutter.author_name}}" + + +# -- General configuration --------------------------------------------------- + +# 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", +] + +# 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. +exclude_patterns = [ + "**.ipynb_checkpoints", + # to ensure that include files (partial pages) aren't built, exclude them + # https://github.com/sphinx-doc/sphinx/issues/1965#issuecomment-124732907 + "**/includes/**", +] + +# -- 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 = "alabaster" + +# 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"] diff --git a/{{cookiecutter.project_slug}}/docs/source/index.rst b/{{cookiecutter.project_slug}}/docs/source/index.rst new file mode 100644 index 00000000..ee436e04 --- /dev/null +++ b/{{cookiecutter.project_slug}}/docs/source/index.rst @@ -0,0 +1,20 @@ +.. {{cookiecutter.project_name}} documentation master file, created by + sphinx-quickstart on Tue Oct 24 11:46:54 2023. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to {{cookiecutter.project_name}}'s documentation! +========================================================= + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` From 24293423faf4e8a377927ae44f7a28aecffc8a67 Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Tue, 24 Oct 2023 12:08:19 +0100 Subject: [PATCH 05/11] exclude only pyproject.toml --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 07028c19..e7b1b59c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: rev: 23.7.0 hooks: - id: black - exclude: | - (?x)( - ^{{cookiecutter.project_slug}} - ) + exclude: > + (?x)^( + {{cookiecutter.project_slug}}/pyproject.toml + )$ From b07a9f2b0943ec5b6707524393849b53c462c75b Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Tue, 24 Oct 2023 12:37:29 +0100 Subject: [PATCH 06/11] remove hardcoded year from template --- .pre-commit-config.yaml | 8 ++++---- {{cookiecutter.project_slug}}/docs/source/conf.py | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e7b1b59c..14dfde01 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: rev: 23.7.0 hooks: - id: black - exclude: > - (?x)^( - {{cookiecutter.project_slug}}/pyproject.toml - )$ + exclude: | + (?x)( + ^{{cookiecutter.project_slug}}/docs/source/conf.py + ) diff --git a/{{cookiecutter.project_slug}}/docs/source/conf.py b/{{cookiecutter.project_slug}}/docs/source/conf.py index 680e696d..41128b86 100644 --- a/{{cookiecutter.project_slug}}/docs/source/conf.py +++ b/{{cookiecutter.project_slug}}/docs/source/conf.py @@ -4,6 +4,8 @@ # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html +from datetime import datetime, timezone + # -- Path setup -------------------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, @@ -15,7 +17,9 @@ # -- Project information ----------------------------------------------------- project = "{{cookiecutter.project_name}}" -copyright = "2023, {{cookiecutter.author_name}}" # noqa: A001 +copyright = str( # noqa: A001 + datetime.now(tz=timezone.utc).year, +) + ", {{cookiecutter.author_name}}" author = "{{cookiecutter.author_name}}" From 4c1c791bf8d3ed59d68db739436d7af017b96e6f Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Tue, 24 Oct 2023 12:46:40 +0100 Subject: [PATCH 07/11] expand exclude from black precommit --- .pre-commit-config.yaml | 2 +- {{cookiecutter.project_slug}}/docs/source/conf.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 14dfde01..07028c19 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,5 +39,5 @@ repos: - id: black exclude: | (?x)( - ^{{cookiecutter.project_slug}}/docs/source/conf.py + ^{{cookiecutter.project_slug}} ) diff --git a/{{cookiecutter.project_slug}}/docs/source/conf.py b/{{cookiecutter.project_slug}}/docs/source/conf.py index 41128b86..92ec3323 100644 --- a/{{cookiecutter.project_slug}}/docs/source/conf.py +++ b/{{cookiecutter.project_slug}}/docs/source/conf.py @@ -17,9 +17,12 @@ # -- Project information ----------------------------------------------------- project = "{{cookiecutter.project_name}}" -copyright = str( # noqa: A001 - datetime.now(tz=timezone.utc).year, -) + ", {{cookiecutter.author_name}}" +copyright = ( # noqa: A001 + str( + datetime.now(tz=timezone.utc).year, + ) + + ", {{cookiecutter.author_name}}" +) author = "{{cookiecutter.author_name}}" From 1dd8972e0d9c792fce13af95bd5725f4f18867c2 Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Tue, 24 Oct 2023 17:27:31 +0100 Subject: [PATCH 08/11] removing .vscode oops --- .vscode/settings.json | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 9434d1eb..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "python.testing.pytestArgs": ["tests"], - "python.testing.unittestEnabled": false, - "python.testing.pytestEnabled": true, - "esbonio.sphinx.confDir": "" -} From 706bfce6fba5e737bd307c5e916ee99d7aae331e Mon Sep 17 00:00:00 2001 From: Paddy Roddy Date: Tue, 24 Oct 2023 21:07:15 +0100 Subject: [PATCH 09/11] Fix linting --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index a757b67f..19cf0cc8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,3 @@ docs/build .DS_Store *.idea - From 38e8749efff881cb5d66df10920e7350e567ba4c Mon Sep 17 00:00:00 2001 From: Paddy Roddy Date: Fri, 27 Oct 2023 10:16:04 +0100 Subject: [PATCH 10/11] Use new author name syntax and tidy up `copyright` --- {{cookiecutter.project_slug}}/docs/source/conf.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/{{cookiecutter.project_slug}}/docs/source/conf.py b/{{cookiecutter.project_slug}}/docs/source/conf.py index 92ec3323..48397b00 100644 --- a/{{cookiecutter.project_slug}}/docs/source/conf.py +++ b/{{cookiecutter.project_slug}}/docs/source/conf.py @@ -17,13 +17,8 @@ # -- Project information ----------------------------------------------------- project = "{{cookiecutter.project_name}}" -copyright = ( # noqa: A001 - str( - datetime.now(tz=timezone.utc).year, - ) - + ", {{cookiecutter.author_name}}" -) -author = "{{cookiecutter.author_name}}" +author = "{{cookiecutter.author_given_names}} {{cookiecutter.author_family_names}}" +copyright = f"{datetime.now(tz=timezone.utc).year}{author}" # noqa: A001 # -- General configuration --------------------------------------------------- From 8c7fe290344e107a0a430cfb0900f859a0b61d8d Mon Sep 17 00:00:00 2001 From: Paddy Roddy Date: Fri, 27 Oct 2023 10:19:28 +0100 Subject: [PATCH 11/11] Add comma and space --- {{cookiecutter.project_slug}}/docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/docs/source/conf.py b/{{cookiecutter.project_slug}}/docs/source/conf.py index 48397b00..2d65acee 100644 --- a/{{cookiecutter.project_slug}}/docs/source/conf.py +++ b/{{cookiecutter.project_slug}}/docs/source/conf.py @@ -18,7 +18,7 @@ project = "{{cookiecutter.project_name}}" author = "{{cookiecutter.author_given_names}} {{cookiecutter.author_family_names}}" -copyright = f"{datetime.now(tz=timezone.utc).year}{author}" # noqa: A001 +copyright = f"{datetime.now(tz=timezone.utc).year}, {author}" # noqa: A001 # -- General configuration ---------------------------------------------------