Skip to content

Commit

Permalink
make kanren a soft-dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushikcfd committed Oct 8, 2021
1 parent 4009abf commit b7a1305
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
13 changes: 9 additions & 4 deletions loopy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@

from loopy.tools import Optional, t_unit_to_python

import loopy.relations as relations
from loopy.transform.loop_fusion import (fuse_loops_kennedy_unweighted,
rename_inames_in_batch)

Expand Down Expand Up @@ -307,9 +306,6 @@

"Optional",

# sub-modules
"relations",

# {{{ from this file

"register_preamble_generators",
Expand All @@ -323,6 +319,15 @@
# }}}
]


try:
import loopy.relations as relations
except ImportError:
# catching ImportErrors to avoid making minikanren a hard-dep
pass
else:
__all__ += ["relations"]

# }}}


Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ git+https://github.com/inducer/f2py#egg=f2py

# Optional, needed for using the C preprocessor on Fortran
ply>=3.6

# Optional, kanren-style relation helpers
git+https://github.com/pythological/kanren.git#egg=kanren

0 comments on commit b7a1305

Please sign in to comment.