Skip to content

Commit

Permalink
Merge pull request #202 from patrikspiess/Manage-RTD-dependencies-wit…
Browse files Browse the repository at this point in the history
…h-poetry-#200

Manage rtd dependencies with poetry #200
  • Loading branch information
lucmurer committed Mar 5, 2024
2 parents 7a2a81a + 9734a4c commit 1ca4b87
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 64 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ jobs:
- name: Check code coverage
run: |
poetry run tox -e coverage
- name: Test create requirements file for readthedocs.io
run: |
poetry run tox -e requirements
- name: Test create docs
- name: Create documentation
run: |
poetry run tox -e docs
19 changes: 14 additions & 5 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
#
# To have an example on how to use this settings file with Poetry see:
# https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-poetry

# Required
version: 2
Expand All @@ -10,12 +13,18 @@ build:
os: ubuntu-22.04
tools:
python: "3.10"
jobs:
post_create_environment:
# Install poetry
# https://python-poetry.org/docs/#installing-manually
- pip install poetry
post_install:
# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
# VIRTUAL_ENV needs to be set manually for now.
# See https://github.com/readthedocs/readthedocs.org/pull/11152/
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with docs

# Build documentation in the docs/source/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py

# Declare the Python requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt
1 change: 1 addition & 0 deletions WHATSNEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Improve error handling and tests for `Fortinet.api()`
- Updated GitHub actions to latest major version due to Node.js 16 deprecation warning
- Use new dependency groups for Poetry in pyproject.toml
- Manage readthedocs dependencies with Poetry (instead of generated requirements.txt)

### Fixed

Expand Down
48 changes: 0 additions & 48 deletions docs/requirements.txt

This file was deleted.

8 changes: 1 addition & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ disallow_untyped_decorators=false
legacy_tox_ini = """[tox]
isolated_build = True
envlist = pylint, mypy, black, pytest, coverage, requirements, docs, stats
envlist = pylint, mypy, black, pytest, coverage, docs, stats
testpaths = "tests"
[testenv:pylint]
Expand Down Expand Up @@ -139,12 +139,6 @@ allowlist_externals = poetry, pytest
commands_pre = poetry install
commands = pytest --cov-report term-missing --cov-fail-under 90 --cov=fotoobo --cov-config=.coverage_unittests_rc --ignore=tests/cli tests/ {posargs}
[testenv:requirements]
description = Create a requirements.txt from the Poetry dependencies (used for readthedocs)
skip_install = True
allowlist_externals = poetry
commands = poetry export --without-hashes --with dev --format=requirements.txt --output=docs/requirements.txt
[testenv:docs]
description = Create the documentation with sphinx
skip_install = True
Expand Down

0 comments on commit 1ca4b87

Please sign in to comment.