Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-110722: Add PYTHON_PRESITE to import a module before site.py is run #110769

Merged
merged 10 commits into from
Oct 14, 2023

Conversation

ambv
Copy link
Contributor

@ambv ambv commented Oct 12, 2023

… before site.py is run

This is only available --with-pydebug.
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

It may be interesting to make this feature to release build.

For the doc, I suggest to replace package.module with module. You can explain in the doc that the argument can be a module of a package, with an example. I don't know.

Overall, the implementation looks correct.

Doc/using/cmdline.rst Outdated Show resolved Hide resolved
Python/pylifecycle.c Outdated Show resolved Hide resolved
Doc/c-api/init_config.rst Show resolved Hide resolved
Python/pylifecycle.c Outdated Show resolved Hide resolved
Python/initconfig.c Outdated Show resolved Hide resolved
Copy link
Member

@gpshead gpshead left a comment

Choose a reason for hiding this comment

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

LGTM - some minor cleanup to do, feel free to merge after that if CI says "ano" (CZ)

Doc/c-api/init_config.rst Outdated Show resolved Hide resolved
Doc/using/cmdline.rst Show resolved Hide resolved
Python/pylifecycle.c Show resolved Hide resolved
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

I'm fine with the C implementation and the overall feature, I just have some remarks on the doc.

I suggest to replace site.py with the site module. In Sphinx, you can even create a link if you want:

the :mod:`site` module

The presite module is imported, it's exactly run. But I'm fine with run_presite name :-) Well, in fact, it can be seed as being "run" ;-)

Doc/using/cmdline.rst Outdated Show resolved Hide resolved
@ambv ambv merged commit 84b7e9e into python:main Oct 14, 2023
@vstinner
Copy link
Member

Congrats!

@ambv ambv deleted the gh-110722-presite branch October 15, 2023 17:00
@ambv ambv restored the gh-110722-presite branch October 25, 2023 12:13
@ambv ambv deleted the gh-110722-presite branch November 1, 2023 13:15
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants