-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-35081: Rename internal headers #10275
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
Conversation
Why not use just the underscore prefix for distinguishing from public names, as common in Python? |
I plan to add one or two more subdirectories, so I will need more distinct prefixes, especially for "#ifndef Py_LIMITED_API" code. See: |
I created https://bugs.python.org/issue35134 and PR #10285 which should show better what I would like to do. |
@nascheme, @serhiy-storchaka, @zooba, @ncoghlan: Would you mind to review this PR? I would prefer to not rename/move files multiple times :-) |
Ah. There are now conflicts. I will fix them when this PR will be approved. |
Rename Include/internal/ headers: * pycore_hash.h -> pycore_pyhash.h * pycore_lifecycle.h -> pycore_pylifecycle.h * pycore_mem.h -> pycore_pymem.h * pycore_state.h -> pycore_pystate.h Add missing headers to Makefile.pre.in and PCbuild: * pycore_condvar.h. * pycore_hamt.h * pycore_pyhash.h
I plan to merge this change next week, if I don't get any feedback in the meanwhile. I rebased my change and fixed merge conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjust the header names so the regular headers and the pycore headers appear in the same order makes sense to me.
Oh, you shouldn't skip the NEWS entry though - NEWS entries are also for folks building from source, and moving header files around can absolutely break third party build scripts. |
Include/internal/ only contains code for Py_BUILD_CORE. This API is strictly private and so can be broken anytime. Do you see anything in Include/internal/ which is not... internal? |
I don't understand what you mean here. |
me:
@ncoghlan: I added again "skip news". Please tell me if I misunderstood you. Do you really want to describe internal changes in the Changelog? Benjamin Peterson documented "bpo-32264: Moved the pygetopt.h header into internal/, since it has no public APIs." This change impacts the "public API", so I agree that it deserves a NEWS entry. But here, I only modify the private internal API. |
Thanks for your review @ncoghlan! |
@vstinner For folks consuming source archives (Linux distros, anyone embedding Python in a larger application, etc) rather than prebuilt binaries, the build process is something that can break, even for For those folks, when they pull a new source archive, their builds may break, especially if they're applying additional downstream patches the way Linux distros do. The NEWS entry for this header file rearrangement should go in the Build section (https://github.com/python/cpython/tree/master/Misc/NEWS.d/next/Build) rather than the C API section (since these headers aren't part of the public API at all), but it should still exist. |
Rename Include/internal/ headers:
Add missing headers to Makefile.pre.in and PCbuild:
https://bugs.python.org/issue35081