Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[external modules] compatibility with plaitpy-ipc (0.1.0)
this diff includes features and fixes added to support external modules like plaitpy-ipc. plaitpy-ipc is a module that provides IPC like features for multiple plaitpy processes, like locks and queues. new features: * add "effect" field for "exec" type statements with side effects * add "init / setup" field for custom template setup code * expose GLOBALS variable in templates that can hold data cleanup: * update Makefile, install scripts and tests to run py2 and py3 * move debug printing to its own module * rename fields.py -> template.py (thats what it really is) * all field errors should cause process exit except "suppressed" fields speed improvements: * add cache for parsed YAML templates * memoize lambda compilation tests: * add test for effect, init fields * add test for CSV and JSON printing * add test for custom printer
- Loading branch information
okay
committed
Jan 24, 2018
1 parent
589dd44
commit 40e7593
Showing
17 changed files
with
355 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
VERSION=`python src/version.py` | ||
sudo pip install dist/plaitpy-${VERSION}.tar.gz --upgrade | ||
sudo pip2 install dist/plaitpy-${VERSION}.tar.gz --upgrade | ||
sudo pip3 install dist/plaitpy-${VERSION}.tar.gz --upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
from . fields import Template | ||
from . template import Template | ||
from . import cli | ||
from . version import VERSION | ||
from . ecosystem import Ecosystem | ||
from . import helpers | ||
|
||
__all__ = [ "Template", "cli" ] | ||
import sys | ||
sys.modules['plaitpy'] = sys.modules[__name__] | ||
|
||
__all__ = [ "Template", "cli", "helpers" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from __future__ import print_function | ||
from os import environ as ENV | ||
|
||
import sys | ||
|
||
DEBUG="DEBUG" in ENV | ||
VERBOSE=False | ||
|
||
def debug(*args): | ||
if DEBUG: | ||
print(" ".join(map(str, args)), file=sys.stderr) | ||
|
||
def verbose(*args): | ||
if VERBOSE: | ||
print(" ".join(map(str, args)), file=sys.stderr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.