Skip to content

Rust API for pyinitconfig - #6173

Open
Person-93 wants to merge 23 commits into
PyO3:mainfrom
Person-93:pyinitconfig
Open

Rust API for pyinitconfig#6173
Person-93 wants to merge 23 commits into
PyO3:mainfrom
Person-93:pyinitconfig

Conversation

@Person-93

Copy link
Copy Markdown
Contributor

Adds a rust API to initialize the embedded interpreter with configuration.

Closes #6153

@Person-93 Person-93 changed the title Ruat API for pyinitconfig Rust API for pyinitconfig Jun 30, 2026
@Person-93
Person-93 force-pushed the pyinitconfig branch 4 times, most recently from 2f0308c to f15f4fc Compare June 30, 2026 14:44
@ngoldbaum

Copy link
Copy Markdown
Contributor

According to codecov almost none of the API surface is tested. Can you please make sure there's coverage for all the InitConfig methods you're proposing to add?

@Person-93
Person-93 force-pushed the pyinitconfig branch 8 times, most recently from 57b35c8 to f622003 Compare July 1, 2026 07:45
Comment thread src/init_config.rs Outdated
Comment thread src/init_config.rs Outdated
@codspeed-hq

codspeed-hq Bot commented Jul 4, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 141 untouched benchmarks
⏩ 6 skipped benchmarks1


Comparing Person-93:pyinitconfig (9a0494f) with main (d44dcca)

Open in CodSpeed

Footnotes

  1. 6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Person-93

Copy link
Copy Markdown
Contributor Author

@codspeedbot fix this regression

@Person-93

Person-93 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Maintainers (@ngoldbaum), is test coverage OK. Do we need a test case which deliberately causes initialization to fail so the error handling code is covered?

@Person-93
Person-93 force-pushed the pyinitconfig branch 2 times, most recently from c8f66ec to 99b41b0 Compare July 30, 2026 01:35
@Person-93
Person-93 force-pushed the pyinitconfig branch 3 times, most recently from 141a505 to 7931138 Compare August 7, 2026 05:08

@davidhewitt davidhewitt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, some various thoughts and suggestions. Sorry it took a long time to get around to this one.

Comment thread src/init_config.rs Outdated
Comment thread src/init_config.rs
Comment thread tests/test_init_config_init_fail.rs Outdated
Comment thread tests/test_init_config_add_module.rs Outdated
Comment thread src/init_config.rs Outdated
@Person-93
Person-93 force-pushed the pyinitconfig branch 3 times, most recently from 5ca5f0a to 5c01d67 Compare August 27, 2026 22:59

@davidhewitt davidhewitt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good to me!

@davidhewitt
davidhewitt added this pull request to the merge queue Aug 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 29, 2026
@Person-93

Copy link
Copy Markdown
Contributor Author

The test case for successfully returning an error if initialization fails is failing on a few platforms as well as python 3.15.

I am not sure if this is because the hack I used to make the interpreter fail doesn't fail successfully on those platforms or if there is a problem with the error reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Initialize python from Config

4 participants