From 0eaa09a7cf47f3f3c322a25ea8a76253f97804fc Mon Sep 17 00:00:00 2001 From: Tiago Nobrega Date: Tue, 16 Apr 2024 12:47:17 -0300 Subject: [PATCH] chore: move docs deps to pyproject.toml --- docs/.readthedocs.yaml => .readthedocs.yaml | 6 +++--- docs/.sphinx/requirements.txt | 3 +++ docs/requirements.txt | 5 ----- pyproject.toml | 6 ++++++ tox.ini | 4 ++-- 5 files changed, 14 insertions(+), 10 deletions(-) rename docs/.readthedocs.yaml => .readthedocs.yaml (89%) create mode 100644 docs/.sphinx/requirements.txt delete mode 100644 docs/requirements.txt diff --git a/docs/.readthedocs.yaml b/.readthedocs.yaml similarity index 89% rename from docs/.readthedocs.yaml rename to .readthedocs.yaml index 6dee65e..eacc66f 100644 --- a/docs/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,7 +9,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.11" + python: "3.12" # Build documentation in the docs/ directory with Sphinx sphinx: @@ -20,7 +20,7 @@ sphinx: # Optionally declare the Python requirements required to build your docs python: install: - - requirements: docs/requirements.txt - method: pip path: . - + extra_requirements: + - docs diff --git a/docs/.sphinx/requirements.txt b/docs/.sphinx/requirements.txt new file mode 100644 index 0000000..65b7d53 --- /dev/null +++ b/docs/.sphinx/requirements.txt @@ -0,0 +1,3 @@ +# This file is used by the automatic-doc-checks CI workflow +# This is sourced the "craft-cli/docs" dir, so this installs "craft-cli[docs]" +..[docs] diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 4b076e8..0000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -# craft-cli-specific requirements for the docs -sphinx-toolbox==3.5.0 -sphinx-lint==0.9.1 -pytest>=7.0.0 # This is just because this is imported by the code -canonical-sphinx@git+https://github.com/canonical/canonical-sphinx@CRAFT-2671-update-assets diff --git a/pyproject.toml b/pyproject.toml index 7224379..6863c81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,6 +62,12 @@ types = [ "types-colorama", "types-setuptools", ] +docs = [ + "sphinx-toolbox==3.5.0", + "sphinx-lint==0.9.1", + "pytest>=7.0.0", # This is just because this is imported by the code + "canonical-sphinx@git+https://github.com/canonical/canonical-sphinx@CRAFT-2671-update-assets", +] [build-system] requires = [ diff --git a/tox.ini b/tox.ini index feb5fd1..73cb0d4 100644 --- a/tox.ini +++ b/tox.ini @@ -105,12 +105,12 @@ commands = codespell: codespell --toml {tox_root}/pyproject.toml --write-changes {posargs} [docs] # Sphinx documentation configuration -deps = - -r{tox_root}/docs/requirements.txt +extras = docs package = editable no_package = true env_dir = {work_dir}/docs runner = ignore_env_name_mismatch +source_dir = {tox_root}/{project_name} [testenv:build-docs] description = Build sphinx documentation