diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml index cc4d9cc..5d11613 100644 --- a/.github/workflows/sphinx.yml +++ b/.github/workflows/sphinx.yml @@ -30,7 +30,7 @@ jobs: with: python-version: 3.x - run: pip install --upgrade pip - - run: pip install -r docs/requirements.txt + - run: pip install myst-parser sphinx-autoapi sphinx-pyproject - uses: actions/configure-pages@v5 - run: sphinx-build docs docs/_build/html - uses: actions/upload-pages-artifact@v3 @@ -41,6 +41,7 @@ jobs: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} + if: github.event_name != 'pull_request' needs: build_docs runs-on: ubuntu-latest steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0332c08..b5bc2a5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: args: - --quiet-level=2 - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.3 + rev: v0.6.9 hooks: - id: ruff-format - id: ruff diff --git a/_static/git_placeholder b/_static/git_placeholder new file mode 100644 index 0000000..e69de29 diff --git a/docs/conf.py b/docs/conf.py index c257381..f2481f1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,54 +1,3 @@ -# Configuration file for the Sphinx documentation builder. -# -# For the full list of built-in configuration values, see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html +from sphinx_pyproject import SphinxConfig -# -- Project information ----------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information - -project = "Ten lines or less" -version = "0.0.1" -copyright = "2024, Claussoft International" -author = "Christian Clauss and contributors" - -# -- General configuration --------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration - -exclude_patterns = [ - "_build", - "Thumbs.db", - ".DS_Store", -] -extensions = [ - "myst_parser", - "sphinxcontrib.mermaid", -] -myst_enable_extensions = [ - "amsmath", - "attrs_inline", - "colon_fence", - "deflist", - "dollarmath", - "fieldlist", - "html_admonition", - "html_image", - # "linkify", - "replacements", - "smartquotes", - "strikethrough", - "substitution", - "tasklist", -] -source_suffix = { - ".rst": "restructuredtext", - ".txt": "markdown", - ".md": "markdown", -} -suppress_warnings = ["epub.unknown_project_files"] -templates_path = ["_templates"] - -# -- Options for HTML output ------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output - -html_static_path = ["_static"] -html_theme = "alabaster" +project = SphinxConfig("../pyproject.toml", globalns=globals()).name diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index ea6ecfd..0000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -furo -myst_parser -sphinxcontrib-mermaid diff --git a/index.md b/index.md new file mode 100644 index 0000000..20422ce --- /dev/null +++ b/index.md @@ -0,0 +1,7 @@ +# Open Metadata Exchange documentation +```{toctree} +:maxdepth: 2 +:caption: index.md + +README.md +``` diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..05b0ad9 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,53 @@ +[project] +name = "ten-lines-or-less" +version = "0.1.0" +description = "Ten lines or less of Python code" +authors = [ { name = "Christian Clauss" } ] +requires-python = ">=3.13" +classifiers = [ + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.13", +] +optional-dependencies.docs = [ + "myst-parser", + "sphinx-autoapi", + "sphinx-pyproject", +] + +[tool.sphinx-pyproject] +copyright = "2014, Christian Clauss" +autoapi_dirs = [ "." ] +exclude_patterns = [ + ".*/*", + "docs/conf.py", +] +extensions = [ + "autoapi.extension", + "myst_parser", +] +html_static_path = [ "_static" ] +html_theme = "alabaster" +myst_enable_extensions = [ + "amsmath", + "attrs_inline", + "colon_fence", + "deflist", + "dollarmath", + "fieldlist", + "html_admonition", + "html_image", + # "linkify", + "replacements", + "smartquotes", + "strikethrough", + "substitution", + "tasklist", +] +myst_fence_as_directive = [ + "include", +] +templates_path = [ "_templates" ] +[tool.sphinx-pyproject.source_suffix] +".rst" = "restructuredtext" +".txt" = "markdown" +".md" = "markdown"