PyO3/pyo3

Expose a way to access the `PYO3_CONFIG_FILE` values

开放

#2,033 创建于 2021年11月29日

 (2 条评论) (0 个反应) (0 位负责人)Rust (668 个派生)batch import
Good First Issueneeds-implementer

仓库指标

星标
 (10,152 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Some users have specific use cases where they would benefit from being able to access the PYO3_CONFIG_FILE values in some form from the pyo3 crate.

I generally wouldn't advise this, as a lot of these config files (such as library path) are unique to the build environment so wouldn't have any useful meaning in binaries intended to be deployed on other systems.

See original comment from #2000 below.

If anyone has need for this, I'm happy to help review designs and implementation.


It would be nice to have access to the library path from PYO3_CONFIG (or all values) but that is not a problem for me.

E.g. it could be based off the PYO3_CONFIG build mechanism - maybe we could have pyo3_config_var!("lib_path"). Or maybe just pyo3_lib_path!(). I'm open to hearing ideas on what's better.

An alternative could be a module filled with many const values, similar to what built does.

Originally posted by @jonasbb in https://github.com/PyO3/pyo3/issues/2000#issuecomment-979985994

贡献者指南