python-aiosmtpd/0004-Make-Sphinx-RTD-deps-SSOT.patch

121 lines
4.3 KiB
Diff
Raw Normal View History

2022-06-14 14:33:53 +08:00
From 215b854447e2567bbc5e3665d9a648d7b1fa2c82 Mon Sep 17 00:00:00 2001
From: Pandu POLUAN <pepoluan@gmail.com>
Date: Wed, 24 Mar 2021 12:14:03 +0700
Subject: [PATCH 4/4] Make Sphinx/RTD deps SSOT
Previously we can accidentally forgot to sync between tox.ini, GA yml,
and RTD-requirements.txt.
Now tox.ini and GA yml actually refers to RTD-requirements.txt, so we
have achieved SSOT (Single Source Of Truth) for Sphinx/RTD deps.
---
.github/workflows/unit-testing-and-coverage.yml | 7 +++++--
aiosmtpd/docs/RTD-requirements.txt | 11 +++++++----
aiosmtpd/docs/conf.py | 7 ++++---
tox.ini | 11 +----------
4 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/.github/workflows/unit-testing-and-coverage.yml b/.github/workflows/unit-testing-and-coverage.yml
index ebc2248..eb8daa1 100644
--- a/.github/workflows/unit-testing-and-coverage.yml
+++ b/.github/workflows/unit-testing-and-coverage.yml
@@ -37,6 +37,8 @@ jobs:
run: |
python -m pip install --upgrade pip setuptools wheel
python setup.py develop
+ # Common deps
+ pip install colorama
- name: "flake8 Style Checking"
shell: bash
# language=bash
@@ -48,12 +50,13 @@ jobs:
"config.read('tox.ini');"
"print(config['flake8_plugins']['deps']);"
)
- pip install colorama flake8 $(python -c "${grab_f8_plugins[*]}")
+ pip install flake8 $(python -c "${grab_f8_plugins[*]}")
python -m flake8 aiosmtpd setup.py housekeep.py release.py
- name: "Docs Checking"
# language=bash
run: |
- pip install colorama pytest pytest-mock sphinx sphinx-autofixture sphinx_rtd_theme
+ # Prepare sphinx and the deps for sphinx extensions
+ pip install -r aiosmtpd/docs/RTD-requirements.txt
sphinx-build --color -b doctest -d build/.doctree aiosmtpd/docs build/doctest
sphinx-build --color -b html -d build/.doctree aiosmtpd/docs build/html
sphinx-build --color -b man -d build/.doctree aiosmtpd/docs build/man
diff --git a/aiosmtpd/docs/RTD-requirements.txt b/aiosmtpd/docs/RTD-requirements.txt
index cfdaa48..e26dc75 100644
--- a/aiosmtpd/docs/RTD-requirements.txt
+++ b/aiosmtpd/docs/RTD-requirements.txt
@@ -1,11 +1,14 @@
-# Sphinx deps
-sphinx>=2.1
+### Sphinx deps
+pickle5 ; python_version < '3.8'
+# Sync the ver limit below with conf.py
+sphinx>=3.2
sphinx-autofixture
sphinx_rtd_theme
-# Required by Sphinx.autodoc
+
+### Required by Sphinx.autodoc
pytest>=6.0
pytest-mock
-# aiosmtpd deps
+### aiosmtpd deps
atpublic
attrs
diff --git a/aiosmtpd/docs/conf.py b/aiosmtpd/docs/conf.py
index d3273f1..689e4a7 100644
--- a/aiosmtpd/docs/conf.py
+++ b/aiosmtpd/docs/conf.py
@@ -50,6 +50,8 @@ syspath_insert(repo_root / "aiosmtpd")
# :classmethod: needs Sphinx>=2.1
# :noindex: needs Sphinx>=3.2
needs_sphinx = "3.2"
+# If you change the above, don't forget to change the version limit in
+# `RTD-requirements.txt`
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
@@ -62,9 +64,8 @@ extensions = [
"autoprogramm",
"sphinx_rtd_theme"
]
-# IMPORTANT: If you edit this, also edit the following:
-# - aiosmtpd/docs/RTD-requirements.txt
-# - tox.ini
+# IMPORTANT: If you edit the above list, check if you need to edit the deps list
+# in `RTD-requirements.txt`
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
diff --git a/tox.ini b/tox.ini
index eb2f4f6..e5ac6a3 100644
--- a/tox.ini
+++ b/tox.ini
@@ -124,17 +124,8 @@ commands =
sphinx-build --color -b html -d build/.doctree aiosmtpd/docs build/html
sphinx-build --color -b man -d build/.doctree aiosmtpd/docs build/man
deps:
- # IMPORTANT: If you edit this, also edit the files:
- # - .github/workflows/unit-testing-and-coverage.yml
- # - aiosmtpd/docs/RTD-requirements.txt
colorama
- sphinx
- sphinx-autofixture
- sphinx_rtd_theme
- pickle5 ; python_version < '3.8'
- # The below used as deps, need to be installed so autofixture work properly
- pytest
- pytest-mock
+ -raiosmtpd/docs/RTD-requirements.txt
[testenv:static]
basepython = python3
--
2.32.0