Skip to content

Commit

Permalink
Make Sphinx/RTD deps SSOT
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pepoluan committed Mar 24, 2021
1 parent b505630 commit 215b854
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/unit-testing-and-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
11 changes: 7 additions & 4 deletions aiosmtpd/docs/RTD-requirements.txt
Original file line number Diff line number Diff line change
@@ -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
7 changes: 4 additions & 3 deletions aiosmtpd/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def syspath_insert(pth: Path):
# :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
Expand All @@ -62,9 +64,8 @@ def syspath_insert(pth: Path):
"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"]
Expand Down
11 changes: 1 addition & 10 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 215b854

Please sign in to comment.