Struct pyo3_pack::PythonInterpreter[][src]

pub struct PythonInterpreter {
    pub major: usize,
    pub minor: usize,
    pub abiflags: String,
    pub target: Target,
    pub executable: PathBuf,
}

The location and version of an interpreter

Fields

Python's major version

Python's minor version

For linux and mac, this contains the value of the abiflags, e.g. "m" for python3.5m or "mu" for python2.7mu. On windows, the value is always "".

See PEP 261 and PEP 393 for details

Currently just the value of Target::os(), i.e. "windows", "linux" or "macos"

Path to the python interpreter, e.g. /usr/bin/python3.6

Just the name of the binary in PATH does also work, e.g. python3.5

Methods

impl PythonInterpreter
[src]

Returns the supported python environment in the PEP 425 format: {python tag}-{abi tag}-{platform tag}

Don't ask me why or how, this is just what setuptools uses so I'm also going to use

Generates the correct suffix for shared libraries

For python 2, it's just .so. For python 3, there is PEP 3149, but that is only valid for 3.2 - 3.4. Since only 3.5+ is supported, the templates are adapted from the (also incorrect) release notes of python 3.5: https://docs.python.org/3/whatsnew/3.5.html#build-and-c-api-changes

Examples for 64-bit on Python 3.5m: Linux: steinlaus.cpython-35m-x86_64-linux-gnu.so Windows: steinlaus.cp35-win_amd64.pyd Mac: steinlaus.cpython-35m-darwin.so

Examples for 64-bit on Python 2.7mu: Linux: steinlaus.so Windows: steinlaus.pyd Mac: steinlaus.so

Checks whether the given command is a python interpreter and returns a PythonInterpreter if that is the case

Tries to find all installed python versions using the heuristic for the given platform

Checks that given list of executables are al valid python intepreters, determines the abiflags and versions of those interpreters and returns them as PythonInterpreter

Trait Implementations

impl Debug for PythonInterpreter
[src]

Formats the value using the given formatter. Read more

impl Clone for PythonInterpreter
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Eq for PythonInterpreter
[src]

impl PartialEq for PythonInterpreter
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Display for PythonInterpreter
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations