PyO3 / PyO3/pyo3

Expose a way to access the `PYO3_CONFIG_FILE` values

Open
#2,033 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Good First Issue needs-implementer
Dominant language
Rust
Stars
16.2k
Forks
1k
Avg merge
2d 6h
Merged PRs (30d)
66

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the PYO3_CONFIG_FILE/PYO3_CONFIG build mechanism and the discussion in issue #2000; compare the proposed macro and generated-constant approaches. Done means establishing a reviewed design and implementation plan for exposing the configuration values while accounting for build-environment-specific paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.