The Wayback Machine - https://web.archive.org/web/20221223130340/https://github.com/python/cpython/pull/27980
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

bpo-45019: Add a tool to generate list of modules to include for frozen modules #27980

Merged

Conversation

ericsnowcurrently
Copy link
Member

@ericsnowcurrently ericsnowcurrently commented Aug 26, 2021

Frozen modules must be added to several files in order to work properly. Before this change this had to be done manually. Here we add a tool to generate the relevant lines in those files instead. This helps us avoid mistakes and omissions.

https://bugs.python.org/issue45019

@gvanrossum
Copy link
Member

gvanrossum commented Aug 27, 2021

Is this ready for review (apart from the failing test)?

@gvanrossum gvanrossum self-requested a review Aug 27, 2021
@ericsnowcurrently
Copy link
Member Author

ericsnowcurrently commented Aug 27, 2021

Is this ready for review (apart from the failing test)?

Yes.

(I need to figure out why "make regen-keywords" isn't working for me locally. Something about ModuleNotFoundError('dataclasses').)

@brettcannon brettcannon changed the title bpo-45019: Add a tool to generate lines for frozen modules. bpo-45019: Add a tool to generate list of modules to include for frozen modules Aug 27, 2021
Copy link
Member

@gvanrossum gvanrossum left a comment

I've only gotten to frozen.c, I'll review the rest later. So far this is great, I just have a few nits about outdated comments.

Python/frozen.c Outdated Show resolved Hide resolved
PCbuild/readme.txt Outdated Show resolved Hide resolved
Programs/_freeze_module.c Outdated Show resolved Hide resolved
Programs/_freeze_module.c Outdated Show resolved Hide resolved
Programs/_freeze_module.c Outdated Show resolved Hide resolved
Python/frozen.c Outdated Show resolved Hide resolved
Python/frozen.c Outdated Show resolved Hide resolved
Copy link
Member

@gvanrossum gvanrossum left a comment

Here's the rest. It's looking much better than the version I used for my "codegen" experiments!

Python/frozen_modules/hello.h Show resolved Hide resolved
Tools/scripts/freeze_modules.py Outdated Show resolved Hide resolved
Tools/scripts/freeze_modules.py Outdated Show resolved Hide resolved
Tools/scripts/freeze_modules.py Show resolved Hide resolved
Tools/scripts/freeze_modules.py Outdated Show resolved Hide resolved
Tools/scripts/update_file.py Show resolved Hide resolved
Copy link
Member

@gvanrossum gvanrossum left a comment

LGTM! Do you want any other reviewers? Pablo?

@ericsnowcurrently
Copy link
Member Author

ericsnowcurrently commented Aug 30, 2021

This change is focused on cleanup, so other reviewers probably aren't necessary. The next PR (freezing some of the stdlib modules) might deserve more than one.

@ericsnowcurrently ericsnowcurrently merged commit 044e8d8 into python:main Aug 30, 2021
13 checks passed
@ericsnowcurrently ericsnowcurrently deleted the frozen-modules-cleanup branch Aug 31, 2021
ericsnowcurrently added a commit that referenced this pull request Sep 13, 2021
There are a few things I missed in gh-27980. This is a follow-up that will make subsequent PRs cleaner. It includes fixes to tests and tools that reference the frozen modules.

https://bugs.python.org/issue45019
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.

None yet

4 participants