Skip to content

Commit

Permalink
update setup to not build shape if in read the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
abelcarreras committed Dec 21, 2020
1 parent 45e6880 commit 263b3ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
todo_include_todos = False


autodoc_mock_imports = ['cosymlib.molecule', 'cosymlib.shape.shp', 'wfnsympy', 'symgroupy']
autodoc_mock_imports = ['cosymlib.shape.shp', 'wfnsympy', 'symgroupy']

# -- Options for HTML output ----------------------------------------------

Expand Down
10 changes: 9 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from numpy.distutils.core import setup, Extension
import os


def get_version_number():
for l in open('cosymlib/__init__.py', 'r').readlines():
Expand All @@ -12,6 +14,12 @@ def get_version_number():
#include_dirs=include_dirs_numpy,
sources=['fortran/shp.pyf', 'fortran/shp.f90'])

on_rtd = os.environ.get('READTHEDOCS') == 'True'
if on_rtd:
ext_modules = []
else:
ext_modules = [shape]

setup(name='cosymlib',
version=get_version_number(),
description='Continuous measures of shape and symmetry',
Expand All @@ -36,4 +44,4 @@ def get_version_number():
'scripts/shape',
'scripts/shape_map',
'scripts/shape_classic'],
ext_modules=[shape])
ext_modules=ext_modules)

0 comments on commit 263b3ef

Please sign in to comment.