From e1cd2ccd4060b4e81979154623e2e55a7d7be01f Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 24 Nov 2015 17:32:04 +0800 Subject: [PATCH] compiler: pull in dependencies in more finely grained way (fixes #181). --- artiq/compiler/__init__.py | 2 -- artiq/compiler/types.py | 3 ++- artiq/coredevice/core.py | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/artiq/compiler/__init__.py b/artiq/compiler/__init__.py index 0fabfd4ad..e69de29bb 100644 --- a/artiq/compiler/__init__.py +++ b/artiq/compiler/__init__.py @@ -1,2 +0,0 @@ -from .module import Module, Source -from .embedding import Stitcher diff --git a/artiq/compiler/types.py b/artiq/compiler/types.py index 9cac1594a..64e386550 100644 --- a/artiq/compiler/types.py +++ b/artiq/compiler/types.py @@ -5,7 +5,6 @@ in :mod:`asttyped`. import string from collections import OrderedDict -from pythonparser import diagnostic from . import iodelay @@ -426,6 +425,8 @@ class TDelay(Type): """ def __init__(self, duration, cause): + # Avoid pulling in too many dependencies with `artiq.language`. + from pythonparser import diagnostic assert duration is None or isinstance(duration, iodelay.Expr) assert cause is None or isinstance(cause, diagnostic.Diagnostic) assert (not (duration and cause)) and (duration or cause) diff --git a/artiq/coredevice/core.py b/artiq/coredevice/core.py index 0ce6e9dc4..217d1f3f3 100644 --- a/artiq/coredevice/core.py +++ b/artiq/coredevice/core.py @@ -6,7 +6,8 @@ from artiq.language.core import * from artiq.language.types import * from artiq.language.units import * -from artiq.compiler import Stitcher, Module +from artiq.compiler.module import Module +from artiq.compiler.embedding import Stitcher from artiq.compiler.targets import OR1KTarget # Import for side effects (creating the exception classes).