[−][src]Struct python_config::PythonConfig
Exposes Python distribution information
Methods
impl PythonConfig
[src]
pub fn new() -> Self
[src]
Create a new PythonConfig
that uses the system installed Python 3
distribution.
pub fn version(version: Version) -> Self
[src]
Create a new PythonConfig
that uses the system installed Python
of version
.
Example
use python_config::{PythonConfig, Version}; // Interface the system-wide Python2 interpreter let cfg = PythonConfig::version(Version::Two);
pub fn interpreter<P: AsRef<Path>>(interpreter: P) -> PyResult<Self>
[src]
Create a PythonConfig
that uses the interpreter at the path interpreter
.
This fails if the path cannot be represented as a string, or if a query for the Pythonn version fails.
Example
use python_config::PythonConfig; let cfg = PythonConfig::interpreter("/usr/local/bin/python3"); assert!(cfg.is_ok());
pub fn version_raw(&self) -> PyResult<String>
[src]
Returns the Python version string
This is the raw return of python --version
. Consider using
semantic_version
for something more programatic.
pub fn semantic_version(&self) -> PyResult<Version>
[src]
Returns the Python version as a semver
pub fn prefix(&self) -> PyResult<String>
[src]
Returns the installation prefix of the Python interpreter as a string
pub fn prefix_path(&self) -> PyResult<PathBuf>
[src]
Like prefix
, but returns
the installation prefix as a PathBuf
.
pub fn exec_prefix(&self) -> PyResult<String>
[src]
Returns the executable path prefix for the Python interpreter as a string
pub fn exec_prefix_path(&self) -> PyResult<PathBuf>
[src]
Like exec_prefix
, but
returns the executable prefix as a PathBuf
.
pub fn includes(&self) -> PyResult<String>
[src]
Returns a list of paths that represent the include paths
for the distribution's headers. This is a space-delimited
string of paths prefixed with -I
.
pub fn include_paths(&self) -> PyResult<Vec<PathBuf>>
[src]
Returns a list of paths that represent the include paths
for the distribution's headers. Unlike includes
,
This is simply a collection of paths.
pub fn cflags(&self) -> PyResult<String>
[src]
All the flags useful for C compilation. This includes the include
paths (see includes
) as well as other compiler
flags for this target. The return is a string with spaces separating
the flags.
pub fn libs(&self) -> PyResult<String>
[src]
Returns a collection linker flags required for linking this Python
distribution. All libraries / frameworks have the appropriate -l
or -framework
prefixes.
pub fn ldflags(&self) -> PyResult<String>
[src]
Returns a collection of linker flags required for creating
a shared library for this Python distribution. All libraries / frameworks
have the appropriate -l
or -framework
prefixes.
pub fn extension_suffix(&self) -> Py3Only<String>
[src]
Returns a string that represents the file extension for this distribution's library
This is only available when your interpreter is a Python 3 interpreter! This is for
feature parity with the python3-config
script.
pub fn abi_flags(&self) -> Py3Only<String>
[src]
The ABI flags specified when building this Python distribution
This is only available when your interpreter is a Python 3 interpreter! This is for
feature parity with the python3-config
script.
pub fn config_dir(&self) -> Py3Only<String>
[src]
The location of the distribution's actual python-config
script
This is only available when your interpreter is a Python 3 interpreter! This is for
feature parity with the python3-config
script.
pub fn config_dir_path(&self) -> Py3Only<PathBuf>
[src]
Like config_dir
, but returns the path to
the distribution's python-config
script as a PathBuf
.
This is only available when your interpreter is a Python 3 interpreter! This is for
feature parity with the python3-config
script.
Trait Implementations
impl Default for PythonConfig
[src]
fn default() -> PythonConfig
[src]
Auto Trait Implementations
impl Send for PythonConfig
impl Sync for PythonConfig
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
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, 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,