Fix package loading in Python runner#113
Conversation
|
This pull request introduces 1 alert when merging bf51440 into 67a8cd8 - view on LGTM.com new alerts:
|
Alfred-Mountfield
left a comment
There was a problem hiding this comment.
Blocking merging until #112 is merged and this branch is rebased for easier review
|
This pull request introduces 1 alert when merging 57f5f6118c37ee96e795ca23c0ddd5bb06c9c637 into f7bf804 - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 3a8b19179da84e6b4352224467e15bda607b0d45 into b8274df - view on LGTM.com new alerts:
|
3a8b191 to
b378392
Compare
|
This pull request introduces 1 alert when merging b378392 into b8274df - view on LGTM.com new alerts:
|
|
|
||
|
|
||
| # TODO(permanently?): Keep in sync with PACKAGE_TYPE | ||
| def str_from_pkg_type(t): |
There was a problem hiding this comment.
Can we avoid single char variable names if possible?
| def get_pkg_path(pkg_name, pkg_type): | ||
| return Path("../../../simulation/package/{}/packages/{}/package.py".format( | ||
| # The engine should be started from the engine's root directory in the repo. | ||
| return Path("./src/simulation/package/{}/packages/{}/package.py".format( |
There was a problem hiding this comment.
If this works, it works. But it's something I'd like to revisit at some point, not happy about all of our relative paths and such, especially since things like running Python with -m can affect it
There was a problem hiding this comment.
Yeah, this does rely on running the engine from a specific directory.
| # changing `sys.path` here (vs some more complicated way | ||
| # of importing files from parent directories of the | ||
| # package file's directory). | ||
| code = ("import pathlib\n" + |
There was a problem hiding this comment.
This is fixed in a later PR so it's okay
| # that the runner exited. | ||
|
|
||
| error = "Runner error: " + str(traceback.format_exception(type(exc), exc, tb)) | ||
| error = "Runner error: " + str(traceback.format_exception(*exc_info)) |
There was a problem hiding this comment.
Can we either pass the destructured args, or can we just type hint?
Or at least a comment saying it comes from the function so you can destructure
|
This pull request introduces 1 alert when merging bc657bf into b8274df - view on LGTM.com new alerts:
|
* Fix flatbuffers conversion during Python init (#112) * Fix package loading in Python runner (#113) * Fix line numbers in Python tracebacks (#114) * Fix behavior execution package Python component init (#115) * Fix messages package Python experiment init (#116) * Fix Python runner init (#117) * Fix Python execution (#214) * Log received inbound messages in Python process * Fix Python state snapshot sync * Display flatc errors from genfbs.py * Fix conflicting TaskMsg flatbuffers definitions * Propagate JS inbound message receive errors * Fix Python state interim sync * Fix Python task execution * Make Python error handling more consistent; update docstrings * Enabling Python tests * Adding Python setup to CI * Building before setting up Python script in CI * Only running Python setup from the root and building all * Running python setup from the package root * Changing python setup run cmd * Specifying server in cargo build in workflow * Running tests from the right cwd * Debugging the contents of the github workspace * Fix Python `context.step()` * Changing output format on integration tests * Fix a variety of Errors around the Python runner (#254) * Fixed init tests * Made behavior index private, and fixed incrementing with multi-language, and fixed access in Python * Fixing behavior index field access in python to use full loading * Fix receiving Python errors in Rust * Removing outdated `server` reference from Rust workflow * Fixing optional GroupIndex on TaskMsg * Programmatically search for libhash_engine_lib.so * Run state interim sync before `run_task` in Python * Disable native python logging * Fix outbound group index deserialization * Fix Python integration tests implementation * Properly check for metaversion in python * Fix neighbor access in Python * Disable behavior reusing * Support index notation for Python * Implement state sync for Python Co-authored-by: litvand <8569704+litvand@users.noreply.github.com> Co-authored-by: Alfred Mountfield <am@hash.ai> Co-authored-by: Tim Diekmann <tim.diekmann@3dvision.de>
🌟 What is the purpose of this PR?
Python init PR
#2Previous PR: #112
🔗 Related links
🔍 What does this change?
hash_utilimport in packages🛡 Tests
❓ How to test this?