-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Python API support #249
Open
cassava
wants to merge
148
commits into
master
Choose a base branch
from
moritz/pyapi
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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 allows you to deploy a configuration to a directory: cloe-launch -v deploy -P engine/tests/conanfile_with_server.py /usr/local This deployment should work without any further setup required. An uninstaller is created at ~/.cache/cloe/launcher/UUID/uinstall.sh where UUID is unique and determined from the configuration.
Readability and consistency are more important than performance here.
BREAKING CHANGE: This fundamentally changes how cloe-launch parses arguments. They now have the form: cloe-launch [OPTS] COMMAND [CMD_OPTS] CONANFILE [CONAN_INSTALL_ARGS] [-- ARGS] For commands such as `shell` and `exec` it's now necessary to use `--` to pass arguments to them. It is also no longer possible to provide options to the cloe-launch command after specifying the conanfile. These now go to conan.
And make commands.options a protected module.
This should result in more reliable builds by default.
This option lets you prevent Python configuration files from being loaded from CLOE_PLUGIN_PATH.
An empty entry in LD_LIBRARY_PATH is interpreted as the current working directory. Conan sets LD_LIBRARY_PATH in such a way that it inserts an empty entry, inadvertently.
Some automatic formatting is done as well
Up until now, we had one big cloe table that we patched from several different places. This is not very maintainable as the library grows and so another approach was needed. Hopefully, this is the last large set of breaking changes. - Tests can make use of expect_OP and assert_OP methods to provide better report generation. For example: z:expect_gt(left, right) will actually provide useful messages in the report, especially when something isn't as expected. - Tests can use `expect_OP` methods to make assertions without terminating the test when they fail. - At the end of cloe.schedule_test, it will automatically terminate the simulation with the appropriate result, depending on whether any expect / assert failed or not. If multiple tests were scheduled, the last one terminates the simulation. The results are written to the report. To disable this, set terminate = false in the schedule_test: cloe.schedule_test { id = "test", on = "start", run = function() end, terminate = false, } BREAKING CHANGES: - The Lua cloe library has been split into the pure Lua library, cloe, and the pure C++ library, cloe-engine. - The engine now exports Lua state and functions to the cloe-engine Lua library, which is not loaded into the global namespace anymore. To access them, use: - `require("cloe-engine")` - `require("cloe-engine.fs")` - `require("cloe-engine.types")` These should not be used directly by users, instead functions and mechanisms in cloe should be used. - The `cloe` global is no longer automatically set in the global namespace anymore: - This allows configuration of libraries before they are required by cloe. - The cloe library pulls in most of the cloe-engine Lua library. - The files in the `cloe` library have reorganized. Require statements may need to be rewritten, if anything other than cloe was required. - Signals table and requires is not directly accessible, instead you should use the functions provided: cloe.require_signals(table) => table cloe.require_signals_enum(table) => table cloe.signals() => table cloe.signal(string) => any For example, before and after: cloe.require_signals = {...} -> cloe.require_signals({ ... }) cloe.signals["string"] -> cloe.signal("string") or alternatively, thanks to Lua syntax goodness: cloe.require_signals = {...} -> cloe.require_signals { ... } cloe.signals["string"] -> cloe.signal "string" - The TestFixture class replaces the table previously used for the same purpose. - The methods need to be called with a colon, since this automatically passes the self to the function (which is needed): z.printf() -> z:printf() z.wait_duration() -> z:wait_duration() ... - `z:expect()` can be used to assert without terminating the simulation. - Typecheck is used to replace `cloe.validate` for most function argument validation, as this provides much better error messages. If you have used cloe.validate, you need to use the new format or use `require("cloe.luax").validate` instead. - Functions previously exported directly to the cloe table that were utility functions are now delegated to a separate namespace, in order to keep everything in cloe related. Thus, the `cloe.utils` has been renamed `cloe.luax`, since they are Lua extensions. They may be replaced in the future with a larger set of libraries, but for now they will stay. - The table `cloe.report` has been moved to `cloe.system` and is no longer automatically included in cloe. You need to require it: local sys = require("cloe.system") - The function `cloe.system` has been moved to the `system` table and renamed to `exec`. See previous point.
This could also easily be added for normal run, but it seems like this is a good compromise between clarity and easy-of-use. (The auto-require feature will feel like magic to users.)
BREAKING CHANGES: - xdg_ functions take and return std::filesystem::path instead of boost::filesystem::path. - Command takes a std::filesystem::path instead of boost::filesystem::path. For the most part, all you need to do is change the namespace to migrate.
And make it work when current_script_dir is not known.
BREAKING CHANGE: - Do not write signals_autocompletion.json by default anymore.
Highlights: - Add LogLevel enum type for use with cloe.log. - Add cloe.events table/module with all default events and some custom ones. - Add cloe.actions table/module with all default actions. - Use tableshape to validate table types. - Add Stack type definitions to cloe-engine. - Improve documentation of many functions and methods.
New: - Add `cloe-meta` package to replace previous role of `cloe`. - Add `cloe-plugins-core` package recipe (but do not build). - Add editable builds to GitHub workflow `build-cloe` matrix. Changed: - Package `cloe` provides all Cloe packages compiled in one go. This is a boon to development, as we make `cloe` editable and only have to work with a single package. It also massively speeds up compilation: - Conan and CMake configuration is only performed once. - All cores can now be utilized much more effectively during the build process. - Do not aggressively lint everything The developer can do this themselves by setting a cmake define: https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_CLANG_TIDY.html - Move all individual tests into single project tests Still support multiple profiles, but this makes it easier to support the cloe super-build and should also make it easier to develop and maintain tests. - Renamed top-level Make targets: - `status` is now `status-all` - `export` is now `export-all` - `deploy` is now `deploy-all` - `clean` is now `clean-all` - `purge` is now `purge-all` - The following top-level Make targets just refer to `cloe` super-build package: - `package` - `smoketest` - `smoketest-deps` - `status` - `export` Fixed: - Plugin Conan configurations do not export correct library path. Removed: - Work-In-Progress Lua files.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.