From dd50822260322b4af28ff345d094c2e198f4b07b Mon Sep 17 00:00:00 2001 From: David Lechner Date: Fri, 21 Apr 2023 11:58:56 -0500 Subject: [PATCH] readthedocs: use poetry config This shares required packages to build docs with poetry instead of a requirements.txt with duplicate info. --- .github/workflows/test.yml | 2 +- .readthedocs.yaml | 17 +++++++++++------ docs/requirements.txt | 6 ------ poetry.lock | 20 ++++++++++++++++---- pyproject.toml | 4 +++- 5 files changed, 31 insertions(+), 18 deletions(-) delete mode 100644 docs/requirements.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 66f6e4a..5f225db 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ jobs: steps: - run: pipx install poetry - uses: actions/checkout@v3 - - run: poetry install --only=doc + - run: poetry install --only=docs - run: poetry run make -C docs/ html lint: runs-on: ubuntu-22.04 diff --git a/.readthedocs.yaml b/.readthedocs.yaml index b93bb4a..146b267 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -5,6 +5,17 @@ # Required version: 2 +build: + os: "ubuntu-22.04" + tools: + python: "3.10" + jobs: + post_create_environment: + - pip install poetry + - poetry config virtualenvs.create false + post_install: + - poetry install --only=docs + # Build documentation in the docs/ directory with Sphinx sphinx: configuration: docs/conf.py @@ -13,9 +24,3 @@ sphinx: # Optionally build your docs in additional formats such as PDF # formats: # - pdf - -# Optionally set the version of Python and requirements required to build your docs -python: - version: 3.8 - install: - - requirements: docs/requirements.txt diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 00397c1..0000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -# requirements for buiding on readthedocs.org - -Sphinx==4.0.2 -sphinx-rtd-theme==0.5.2 -toml==0.10.2 -typing_extensions==4.3.0 diff --git a/poetry.lock b/poetry.lock index 24b12d3..84d7648 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2412,6 +2412,18 @@ webencodings = ">=0.4" doc = ["sphinx", "sphinx_rtd_theme"] test = ["coverage[toml]", "pytest", "pytest-cov", "pytest-flake8", "pytest-isort"] +[[package]] +name = "toml" +version = "0.10.2" +description = "Python Library for Tom's Obvious, Minimal Language" +category = "dev" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, + {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, +] + [[package]] name = "tomli" version = "2.0.1" @@ -2483,14 +2495,14 @@ test = ["pre-commit", "pytest"] [[package]] name = "typing-extensions" -version = "4.3.0" +version = "4.5.0" description = "Backported and Experimental Type Hints for Python 3.7+" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "typing_extensions-4.3.0-py3-none-any.whl", hash = "sha256:25642c956049920a5aa49edcdd6ab1e06d7e5d467fc00e0506c44ac86fbfca02"}, - {file = "typing_extensions-4.3.0.tar.gz", hash = "sha256:e6d2677a32f47fc7eb2795db1dd15c1f34eff616bcaf2cfb5e997f854fa1c4a6"}, + {file = "typing_extensions-4.5.0-py3-none-any.whl", hash = "sha256:fb33085c39dd998ac16d1431ebc293a8b3eedd00fd4a32de0ff79002c19511b4"}, + {file = "typing_extensions-4.5.0.tar.gz", hash = "sha256:5cb5f4a79139d699607b3ef622a1dedafa84e115ab0024e0d9c044a9479ca7cb"}, ] [[package]] @@ -2587,4 +2599,4 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=6)", "pytest-black (>= [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<3.12" -content-hash = "30ba78fdf30c3213c2dc7f2e626d9b43f6fa8b41a5989a6d453f856520ec3790" +content-hash = "4b5d9c600da0cbe9a5bfb51d1c1eef3a4ab81bfd27272f6793226ed37a5716e8" diff --git a/pyproject.toml b/pyproject.toml index 5e47a24..70054e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,9 +57,11 @@ black = "^23" flake8 = "^6.0.0" isort = "^5.12.0" -[tool.poetry.group.doc.dependencies] +[tool.poetry.group.docs.dependencies] sphinx = "^6.1.3" sphinx-rtd-theme = "^1.2.0" +toml = "^0.10.2" +typing-extensions = "^4.5.0" [tool.poetry.group.test.dependencies] coverage = {extras = ["toml"], version = "^7.2.3"}