[−][src]Struct pyo3_pack::PythonInterpreter
The location and version of an interpreter
Fields
major: usizePython's major version
minor: usizePython's minor version
abiflags: StringFor 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
target: TargetCurrently just the value of Target::os(), i.e. "windows", "linux" or "macos"
executable: PathBufPath 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]
pub fn get_tag(&self, manylinux: &Manylinux) -> String[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
pub fn get_library_extension(&self) -> String[src]
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
pub fn check_executable(
executable: impl AsRef<Path>,
target: &Target
) -> Result<Option<PythonInterpreter>, Error>[src]
executable: impl AsRef<Path>,
target: &Target
) -> Result<Option<PythonInterpreter>, Error>
Checks whether the given command is a python interpreter and returns a PythonInterpreter if that is the case
pub fn find_all(target: &Target) -> Result<Vec<PythonInterpreter>, Error>[src]
Tries to find all installed python versions using the heuristic for the given platform
pub fn check_executables(
executables: &[String],
target: &Target
) -> Result<Vec<PythonInterpreter>, Error>[src]
executables: &[String],
target: &Target
) -> Result<Vec<PythonInterpreter>, Error>
Checks that given list of executables are all valid python intepreters, determines the abiflags and versions of those interpreters and returns them as PythonInterpreter
Trait Implementations
impl Clone for PythonInterpreter[src]
fn clone(&self) -> PythonInterpreter[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Eq for PythonInterpreter[src]
impl PartialEq<PythonInterpreter> for PythonInterpreter[src]
fn eq(&self, other: &PythonInterpreter) -> bool[src]
fn ne(&self, other: &PythonInterpreter) -> bool[src]
impl Display for PythonInterpreter[src]
impl Debug for PythonInterpreter[src]
Auto Trait Implementations
impl Send for PythonInterpreter
impl Sync for PythonInterpreter
Blanket Implementations
impl<T> From for T[src]
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Erased for T
impl<T> Same for T
type Output = T
Should always be Self
impl<Q, K> Equivalent for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,