Skip to content

gh-148641: Implement PEP 829 - startup configuration files#149109

Merged
warsaw merged 58 commits intopython:mainfrom
warsaw:warsaw/829
May 3, 2026
Merged

gh-148641: Implement PEP 829 - startup configuration files#149109
warsaw merged 58 commits intopython:mainfrom
warsaw:warsaw/829

Conversation

@warsaw
Copy link
Copy Markdown
Member

@warsaw warsaw commented Apr 28, 2026

warsaw added 23 commits March 31, 2026 17:13
It's okay to be missing, but if it's given it must be an expected
version (i.e. currently, 1).
* Add _print_error() helper function for printing exceptions to sys.stderr.  These are not hidden
  behind -v
* `warnings` can be lazy imported.
* Since the site.toml file is no longer proposed, rewrite how .pth and .start files are parsed and
  processed.
* addpackage() -- which was never documented -- is deprecated; there are a few usages in the wild so
  we can't get rid of it, but it's generally unnecessary now, has different semantics.
* Update tests
@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented Apr 28, 2026

Documentation build overview

📚 cpython-previews | 🛠️ Build #32516357 | 📁 Comparing 5019131 against main (2b6a137)

  🔍 Preview build  

54 files changed · ± 54 modified

± Modified

@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 2, 2026

Thanks for making the requested changes!

@brettcannon: please review the changes made to this pull request.

@bedevere-app bedevere-app Bot requested a review from brettcannon May 2, 2026 01:08
Copy link
Copy Markdown
Contributor

@ncoghlan ncoghlan left a comment

Choose a reason for hiding this comment

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

Huzzah! However, I have some backwards compatibility concerns with the details of the site module changes (basically, I don't think we can reasonably semantically overload known_paths=None to avoid adding a new keyword parameter to addsitedir, and potentially not even to addsitepackages or addusersitepackages)

Comment thread Doc/library/site.rst
Comment thread Doc/library/site.rst
Comment thread Doc/library/site.rst
Comment thread Doc/library/site.rst Outdated
Comment thread Lib/site.py Outdated
Comment thread Lib/site.py Outdated
Comment thread Lib/site.py Outdated
@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 2, 2026

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

warsaw added 5 commits May 2, 2026 10:29
* flush_pth_start() -> process_startup_files()
* Move around some versionchanged and deprecated-removed sections
* Add: kw-only arg `defer_processing_start_files` in several places to ensure that the
  reverse-engineered semantics of the undocumented functions are preserved.
@warsaw
Copy link
Copy Markdown
Member Author

warsaw commented May 3, 2026

I have made the requested changes; please review again

@ncoghlan

@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 3, 2026

Thanks for making the requested changes!

@brettcannon, @ncoghlan: please review the changes made to this pull request.

@bedevere-app bedevere-app Bot requested a review from ncoghlan May 3, 2026 02:15
@warsaw
Copy link
Copy Markdown
Member Author

warsaw commented May 3, 2026 via email

Copy link
Copy Markdown
Contributor

@ncoghlan ncoghlan left a comment

Choose a reason for hiding this comment

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

Thanks @warsaw, this iteration looks good for 3.15b1 to me (one minor parameter naming nitpick, but it's in an API detail I'd like to revisit in more depth for 3.15b2 anyway, hence I don't think it's a merge blocker)

Comment thread Doc/library/site.rst
@warsaw warsaw enabled auto-merge (squash) May 3, 2026 16:51
@warsaw warsaw dismissed brettcannon’s stale review May 3, 2026 16:51

Got approval from @NCoughlan

@warsaw
Copy link
Copy Markdown
Member Author

warsaw commented May 3, 2026

Argh! Sorry for the typo in the review dismissal. GH doesn't actually autocomplete in that dialog and it can't be edited. Approval was received from @ncoghlan

@warsaw warsaw merged commit 24c4aec into python:main May 3, 2026
51 checks passed
@warsaw warsaw deleted the warsaw/829 branch May 3, 2026 17:21
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.

5 participants