Enhancements to CodeSherpa: Multi-language Support and Dockerfile Refactoring
Description:
This pull request introduces several significant changes to the CodeSherpa project. The main goal of these changes is to extend the support of the REPL environment to multiple languages including Python, C++, and Rust. Additionally, the Dockerfile has been refactored to use a base Ubuntu image instead of a Python-specific image, and to install the necessary compilers and interpreters for the supported languages.
Here are the key changes in detail:
Multi-language Support: The project now supports executing code in Python, C++, and Rust. This is achieved by introducing a new Executor abstract base class and its subclasses for each supported language. These classes are responsible for executing code in the respective language.
Dockerfile Refactoring: The Dockerfile has been refactored to start from a base Ubuntu image. It now installs Python, pip, g++, curl, make, and git. It also installs Rust using the official rustup installer. The Dockerfile now uses pip to install Python dependencies and pytest for testing.
Testing: Unit tests have been added for the new Executor classes. These tests ensure that the executors can correctly execute code and handle errors in their respective languages.
Makefile Updates: The Makefile has been updated to include commands for running tests both locally and in a Docker container.
API Updates: The API has been updated to accept the programming language as a parameter. This allows clients to specify the language in which the code should be executed.
Documentation Updates: The OpenAPI documentation and the AI plugin description have been updated to reflect the new multi-language support.
Minor Changes: The .dockerignore file has been updated to no longer ignore the tests directory. The localserver/main.py file has been updated to use the new Executor classes for code execution.
Please review these changes and provide your feedback. If everything looks good, we can proceed with merging this pull request.
Checklist:
[x] I have performed a self-review of my own code
[x] I have made corresponding changes to the documentation
[x] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes
[x] Any dependent changes have been merged and published in downstream modules
Type of changes:
[x] New feature (non-breaking change which adds functionality)
[x] Documentation Update (if none of the other choices apply)
[x] Code style update (formatting, renaming)
[x] Refactoring (no functional changes, no api changes)
[x] Other (please describe): Dockerfile update
Does this introduce a breaking change?
[x] Yes
[ ] No
If yes, please describe the impact and migration path for existing applications: The API now requires a language parameter for code execution. Clients will need to be updated to provide this parameter.
Enhancements to CodeSherpa: Multi-language Support and Dockerfile Refactoring
Description:
This pull request introduces several significant changes to the CodeSherpa project. The main goal of these changes is to extend the support of the REPL environment to multiple languages including Python, C++, and Rust. Additionally, the Dockerfile has been refactored to use a base Ubuntu image instead of a Python-specific image, and to install the necessary compilers and interpreters for the supported languages.
Here are the key changes in detail:
Multi-language Support: The project now supports executing code in Python, C++, and Rust. This is achieved by introducing a new
Executor
abstract base class and its subclasses for each supported language. These classes are responsible for executing code in the respective language.Dockerfile Refactoring: The Dockerfile has been refactored to start from a base Ubuntu image. It now installs Python, pip, g++, curl, make, and git. It also installs Rust using the official rustup installer. The Dockerfile now uses pip to install Python dependencies and pytest for testing.
Testing: Unit tests have been added for the new
Executor
classes. These tests ensure that the executors can correctly execute code and handle errors in their respective languages.Makefile Updates: The Makefile has been updated to include commands for running tests both locally and in a Docker container.
API Updates: The API has been updated to accept the programming language as a parameter. This allows clients to specify the language in which the code should be executed.
Documentation Updates: The OpenAPI documentation and the AI plugin description have been updated to reflect the new multi-language support.
Minor Changes: The
.dockerignore
file has been updated to no longer ignore the tests directory. Thelocalserver/main.py
file has been updated to use the newExecutor
classes for code execution.Please review these changes and provide your feedback. If everything looks good, we can proceed with merging this pull request.
Checklist:
Type of changes:
Does this introduce a breaking change?
If yes, please describe the impact and migration path for existing applications: The API now requires a language parameter for code execution. Clients will need to be updated to provide this parameter.