Skip to content

Commit

Permalink
Merge pull request #299 from lf-lang/python-12
Browse files Browse the repository at this point in the history
Added documentation for the python-version option
  • Loading branch information
edwardalee authored Dec 18, 2024
2 parents bdc11d6 + e3c096b commit a48826b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
19 changes: 19 additions & 0 deletions docs/reference/target-declaration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -514,6 +515,24 @@ included in the generated code. For an example, see
</ShowIf>
</ShowIfs>

## python-version

<ShowIfs>
<ShowIf c rs cpp ts >
This target does not support the `python-version` target option.
</ShowIf>
<ShowIf py>
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"
}
```
</ShowIf>
</ShowIfs>

## runtime-version

<ShowIfs>
Expand Down
4 changes: 3 additions & 1 deletion docs/reference/target-language-details.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ The following tools are required in order to compile the generated C++ source co
</ShowIf>
<ShowIf py>

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.

Expand Down

0 comments on commit a48826b

Please sign in to comment.