Skip to content

Commit

Permalink
Include asyncio + Python38 + Windows workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
desilinguist committed Oct 28, 2020
1 parent d0c5333 commit 2a72bc5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions rsmtool/reporter.py
Expand Up @@ -9,9 +9,11 @@
"""

import argparse
import asyncio
import logging
import json
import os
import sys

from os.path import (abspath,
basename,
Expand Down Expand Up @@ -317,6 +319,15 @@ def convert_ipynb_to_html(notebook_file, html_file):
:ref:`render_notebook <render_notebook>` command-line utility.
"""

# `nbconvert` uses `asyncio` which uses an entirely default
# implemention of the event loop on Windows for Cpython 3.8
# which breaks the report generation unless we include the
# following workaround
if (sys.version_info[0] == 3 and
sys.version_info[1] >= 8 and
sys.platform.startswith('win')):
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

# set a high timeout for datasets with a large number of features
report_config = Config({'ExecutePreprocessor': {'enabled': True,
'timeout': 3600},
Expand Down

0 comments on commit 2a72bc5

Please sign in to comment.