Open jackyk02 opened 2 days ago
The recent changes enhance the Python version compatibility handling in the PythonGenerator.java
by integrating a new PythonVersionProperty
to dynamically specify the required Python version. This allows the generator to default to Python 3.8 if no specific version is provided, thus improving flexibility and alignment with user requirements. Additionally, required modifications were made to the Target.java
to incorporate this new property effectively.
File Path | Summary |
---|---|
core/src/main/java/org/lflang/generator/python/PythonGenerator.java |
Added import for PythonVersionProperty , new pythonVersion field, modified setUpMainTarget to leverage pythonVersion . |
core/src/main/java/org/lflang/target/Target.java |
Added PythonVersionProperty to properties in initialize method for Python target. |
core/src/main/java/org/lflang/target/property/PythonVersionProperty.java |
Introduced new file defining PythonVersionProperty for setting a specific Python version. |
sequenceDiagram
participant User
participant PythonGenerator
participant Property
User->>PythonGenerator: Initiate Target Setup
PythonGenerator->>Property: Fetch PythonVersionProperty
PythonGenerator-->>PythonGenerator: Set `pyVersion` (Default: 3.8)
PythonGenerator->>PythonFinder: find_package(Python <pyVersion> REQUIRED COMPONENTS Interpreter Development)
Note over User,PythonGenerator: Setup Completed with appropriate Python version
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
This PR introduces a new target property
python-version
that allows users to explicitly specify the Python version to be used.Related Issues and PR: Issue #2298 Issue #2299 PR #2292
Example:
If
python-version
is not specified, the system will default to using Python 3.10 or newer.Summary by CodeRabbit
New Features
Improvements