Skip to content

Commit

Permalink
Simpliy docs (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep authored Jun 28, 2022
1 parent aa4310e commit 3b1b5c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
30 changes: 8 additions & 22 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,42 +1,28 @@
import sys
from datetime import datetime
from pathlib import Path
from unittest.mock import MagicMock


HERE = Path(__file__).parent


# Can’t use autodoc_mock_imports as we import anndata2ri
sys.modules['rpy2.rinterface_lib'] = MagicMock()
submods = ['embedded', 'conversion', 'memorymanagement', 'sexp', 'bufferprotocol', 'callbacks', '_rinterface_capi']
sys.modules.update({f'rpy2.rinterface_lib.{sub}': MagicMock() for sub in submods})
sexp = sys.modules['rpy2.rinterface_lib.sexp']
sexp.Sexp = type('Sexp', (MagicMock,), dict(__module__='rpy2.rinterface'))
sexp.SexpVector = sexp.SexpEnvironment = sexp.StrSexpVector = MagicMock
sexp.SexpVector.from_iterable = MagicMock()
try:
from importlib.metadata import metadata
except ImportError:
from importlib_metadata import metadata

import rpy2.rinterface

HERE = Path(__file__).parent

rpy2.rinterface._MissingArgType = object
rpy2.rinterface.initr_simple = lambda *_, **__: None

# now we can import it!
sys.path[:0] = [str(HERE.parent), str(HERE / 'ext')]
import anndata2ri.scipy2ri # noqa


# -- General configuration ------------------------------------------------


needs_sphinx = '1.7' # autosummary bugfix

# General information
project = 'anndata2ri'
author = anndata2ri.__author__
meta = metadata(project)
author = meta['author-email'].split('"')[1]
copyright = f'{datetime.now():%Y}, {author}.'
version = anndata2ri.__version__.replace('.dirty', '')
version = meta['version']
release = version

# default settings
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ doc = [
'scanpydoc',
'sphinx-rtd-theme>=0.5', # Already a dep but 0.5 is prettier
'lxml', # For scraping the R link info
'importlib_metadata; python_version < "3.8"',
]

[tool.hatch.version]
Expand Down

0 comments on commit 3b1b5c3

Please sign in to comment.