Skip to content

Commit

Permalink
docs: autodoc_mock_imports for gssapi
Browse files Browse the repository at this point in the history
Adds mocking of 'gssapi' and 'paramiko[gssapi]' that cannot be installed on ReadTheDocs
builders.

This fixes the ReadTheDocs building problem.

closes #274
  • Loading branch information
Parth Shandilya committed Oct 9, 2020
1 parent 42b3a99 commit 1c10a9f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Expand Up @@ -10,6 +10,7 @@ include LICENSE
include *.rst
include *.sh
include *.txt
include *.in
include pytest.ini
include docs/openapi.json
include docs/_static/reana-job-manager.xml
Expand Down
3 changes: 3 additions & 0 deletions docs/conf.py
Expand Up @@ -54,6 +54,9 @@
"sphinxcontrib.redoc",
]

# Autodoc mocking to fix ReadTheDocs builds missing system dependencies
autodoc_mock_imports = ["gssapi", "paramiko[gssapi]"]

redoc = [
{
"page": "_static/api",
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Expand Up @@ -4,4 +4,4 @@
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

-e .[all]
-e .[docs]
3 changes: 2 additions & 1 deletion reana_job_controller/utils.py
Expand Up @@ -13,7 +13,6 @@
import subprocess
import sys

import paramiko
from reana_db.database import Session
from reana_db.models import Workflow

Expand Down Expand Up @@ -72,6 +71,8 @@ def initialize_krb5_token(workflow_uuid):
class SSHClient:
"""SSH Client."""

import paramiko

def __init__(self, hostname=None, port=None):
"""Initialize ssh client."""
self.hostname = hostname
Expand Down
7 changes: 7 additions & 0 deletions requirements.in
@@ -0,0 +1,7 @@
# This file is part of REANA.
# Copyright (C) 2017, 2018 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

paramiko[gssapi]==2.7.1
2 changes: 1 addition & 1 deletion requirements.txt
Expand Up @@ -41,7 +41,7 @@ monotonic==1.5 # via bravado
msgpack-python==0.5.6 # via bravado
msgpack==1.0.0 # via bravado-core
oauthlib==3.1.0 # via requests-oauthlib
paramiko[gssapi]==2.7.1 # via reana-job-controller (setup.py)
paramiko[gssapi]==2.7.1 # via -r requirements.in
psycopg2-binary==2.8.5 # via reana-db
pyasn1-modules==0.2.8 # via google-auth
pyasn1==0.4.8 # via paramiko, pyasn1-modules, rsa
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -32,6 +32,7 @@
"sphinxcontrib-redoc>=1.5.1",
],
"tests": tests_require,
"ssh": ["paramiko[gssapi]>=2.6.0"]
}

extras_require["all"] = []
Expand All @@ -54,7 +55,6 @@
"reana-db>=0.7.0a6,<0.8.0",
"htcondor==8.9.7",
"retrying>=1.3.3",
"paramiko[gssapi]>=2.6.0",
]

packages = find_packages()
Expand Down

0 comments on commit 1c10a9f

Please sign in to comment.