Skip to content

Commit

Permalink
On RTD make trident use dummy config and ion files to avoid failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
chummels committed Nov 17, 2017
1 parent 0e02141 commit 51f5285
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions trident/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,5 +263,16 @@ def verify(save=False):
print("Now let's science!")
print("")

ion_table_dir, ion_table_file = parse_config()
ion_table_filepath = os.path.join(ion_table_dir, ion_table_file)
# Each time Trident is imported, we determine the settings from the config
# file or try to create a config file. But don't do this on readthedocs, or
# it will fail in the build. In readthedocs environment, just set a dummy
# filepath so readthedocs can parse the docstrings OK.

on_rtd = os.environ.get('READTHEDOCS') == 'True'
if on_rtd:
ion_table_dir = trident_path()
ion_table_file = '__init__.py'
ion_table_filepath = os.path.join(ion_table_dir, ion_table_file)
else:
ion_table_dir, ion_table_file = parse_config()
ion_table_filepath = os.path.join(ion_table_dir, ion_table_file)

0 comments on commit 51f5285

Please sign in to comment.