import sys import os # Add autocython dir to the path if we're in the repo. This bit can be left out of # your own packages, it's just so that the example works without installing # autocython: this_folder = os.path.dirname(os.path.abspath(__file__)) grandparent_folder = os.path.abspath(os.path.join(this_folder, '..', '..')) if os.path.exists(os.path.join(grandparent_folder, 'autocython')): sys.path.insert(0, grandparent_folder) from autocython import ensure_extensions_compiled, import_extension this_folder = os.path.dirname(os.path.abspath(__file__)) ensure_extensions_compiled(this_folder) hello_module = import_extension('hello_package.hello_module') hello = hello_module.hello
from __future__ import print_function, unicode_literals, division, absolute_import from labscript_utils import PY2, check_version if PY2: str = unicode import os if PY2: try: import autocython except ImportError: msg = ('autocython required, installable via pip') raise RuntimeError(msg) check_version('autocython', '1.1', '2.0') from autocython import ensure_extensions_compiled, import_extension ensure_extensions_compiled(os.path.abspath(os.path.dirname(__file__))) extension = import_extension('runviewer.resample.resample') resample = extension.resample else: from .resample import resample
import os from autocython import ensure_extensions_compiled ensure_extensions_compiled(os.getcwd())