Skip to content

Rust API for pyinitconfig - #6173

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

Rust API for pyinitconfig#6173
Person-93 wants to merge 31 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 degrade performance by 0.43%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 2 improved benchmarks
❌ 2 regressed benchmarks
✅ 137 untouched benchmarks
⏩ 6 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
into_u128_small 876.1 ns 1,041.4 ns -15.87%
into_u128_zero 816 ns 925.7 ns -11.85%
into_biguint_small 1.5 µs 1.3 µs +16.79%
into_biguint_zero 1.4 µs 1.2 µs +13.49%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing Person-93:pyinitconfig (5a5770e) with main (6a930e9)

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 Outdated
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!

@Person-93

Copy link
Copy Markdown
Contributor Author

I'm ignoring the test_init_fail testcase for now.

Comment thread tests/test_init_config_init_fail.rs
Comment thread src/interpreter_lifecycle.rs Outdated
@Person-93

Copy link
Copy Markdown
Contributor Author

@ngoldbaum what happened to CI for this PR? I see that you cancelled them after they were stuck for a few hours, so what happens now?

@ngoldbaum

Copy link
Copy Markdown
Contributor

Maybe try debugging locally or in your fork? I canceled CI because it was blocking CI on other PRs.

@Person-93

Copy link
Copy Markdown
Contributor Author

@ngoldbaum , I tried running CI again to see if it was a transient issue or if I could get logs, and I've confirmed that the pytest test_comparisons.py is what hangs. Please cancel CI again; sorry for the trouble.

@ngoldbaum

Copy link
Copy Markdown
Contributor

I usually enable actions in my fork of a project when I’m limited by permissions like you’re hitting here.

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