Converts the repository into a proper python package#3
Draft
oleksiy-korniychuk wants to merge 9 commits intoMcArcady:masterfrom
Draft
Converts the repository into a proper python package#3oleksiy-korniychuk wants to merge 9 commits intoMcArcady:masterfrom
oleksiy-korniychuk wants to merge 9 commits intoMcArcady:masterfrom
Conversation
…alled and imported. Adds scripts for fetching protobuf files from DFHack git repo, and generating the python protobuf files for the client to use. Fleshes out the README with for detailed instructions using the newly added scripts.
…on from CoreProtocal and one from the RemoteFortressReader plugin. Properly imports protobuff types from the _pb2 files.
- Introduced DFHackError class for better error management in DFHack commands. - Enhanced get_header function to handle RPC_REPLY_FAIL and raise DFHackError. - Updated remote function to process RPC_REPLY_TEXT and RPC_REPLY_RESULT messages and log text notifications to standard output. - Adjusted byte size handling in get_header for consistency (python slice is non inclusive for the end).
…he from async_lru. This fixes a bug where the cache was storing coroutines instead of the final result of the function execution which caused an issue whenever you called the same method twice in one session.
…s to EmptyMessage, same as input type)
Owner
|
Thanks for the PR! Looks great. |
Author
Hey @McArcady, thanks for taking a look. I would be happy to maintain it! I haven't tested it on Linux yet but I plan to do that next. |
… in the actual value of the input instead of the type when making the RPC call
…t object, as well as to have a slightly cleaner @Remote annotaion structure.
This file contains hidden or 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
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.
Outline
Details
This new project structure separates the python protobuf generation from the resulting
dfhack_client_pythonpackage which can be installed usingpipand used by a client application../cmake/contains theCMakeLists.txtand also temporarily houses the intermediate cmake/make files that get generated when generating the protobuf python code../examples/contains theblendwarf.pyfile. This is a good example for howdfhack_client_pythoncan be imported and used../proto/<tag>/contains all proto files for the<tag>version of DFHack. These files are not necessary for the package to work but are a useful reference when using the client../scripts/contains:fetch_proto_files.py- a convenient script for automating the .proto file retrieval for a given DFHack<tag>.generate_python.py- a convenient script for automating the generation of protobuf python code necessary for the package to work (still using cmake and make). This script should work on both Linux and Windows../src/dfhack_client_python/contains thepy_export/directory (with its generated protobuf python files) and thedfhack_remote.pycore package file.pyproject.tomlcontains the package definitionREADME.mdwas updated to explain how to generate protobuf python files for other/new DFHack versions and how to install/use thedfhack_client_pythonpackage