From e49a6fee3fc0c23902f0151dba14dd4dbb70e6d9 Mon Sep 17 00:00:00 2001 From: "Edward A. Lee" Date: Sat, 7 Dec 2024 13:59:27 -0800 Subject: [PATCH 1/2] Added documentation for the python-version option --- docs/reference/target-declaration.mdx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/reference/target-declaration.mdx b/docs/reference/target-declaration.mdx index bc936a7fd..d2e547802 100644 --- a/docs/reference/target-declaration.mdx +++ b/docs/reference/target-declaration.mdx @@ -40,6 +40,7 @@ A target specification may have optional parameters, the names and values of whi - [**no-compile**](#no-compile): If true, then do not invoke a target language compiler. Just generate code. - [**no-runtime-validation**](#no-runtime-validation): If true, disable runtime validation. - [**protobufs**](#protobufs): An array of .proto files that are to be compiled and included in the generated code. +- [**python-version**](#python-version): (Python only) A string (with quotation marks) giving an exact Python version to use. - [**runtime-version**](#runtime-version): Specify which version of the runtime system to use. - [**rust-include**](#rust-include): (Rust only) A set of Rust modules in the generated project. - [**scheduler**](#scheduler): (C only) Specification of the scheduler to use. @@ -514,6 +515,24 @@ included in the generated code. For an example, see +## python-version + + + +This target does not support the `python-version` target option. + + +This argument takes a string (with quotation marks) containing a version number. +This will specify the _version_ of the Python interpreter that the compiled binary will be linked and run with. +For example, to get Python version 3.13.0: +```lf-py +target Python { + python-version: "3.13.0" +} +``` + + + ## runtime-version From e3c096b6cc770c45759d9bbabff53f8097db8f22 Mon Sep 17 00:00:00 2001 From: "Edward A. Lee" Date: Wed, 18 Dec 2024 07:34:14 -0800 Subject: [PATCH 2/2] Specify Python versions --- docs/reference/target-language-details.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/reference/target-language-details.mdx b/docs/reference/target-language-details.mdx index efc4f5421..116af889c 100644 --- a/docs/reference/target-language-details.mdx +++ b/docs/reference/target-language-details.mdx @@ -103,7 +103,9 @@ The following tools are required in order to compile the generated C++ source co -To use this target, install Python 3 on your machine. See [downloading Python](https://wiki.python.org/moin/BeginnersGuide/Download). +To use this target, install Python 3 on your machine. +The target has been tested using Python 3.10, 3.11, 3.12, and 3.13; the nightly regression tests use Python version 3.10.0. +See [downloading Python](https://wiki.python.org/moin/BeginnersGuide/Download). **NOTE:** The Python target requires a C implementation of Python (nicknamed CPython). This is what you will get if you use the above link, or with most of the alternative Python installations such as Anaconda. See [Python download alternatives](https://www.python.org/download/alternatives/) for more details.