-
Couldn't load subscription status.
- Fork 53
Remove Python.h
#462
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
Remove Python.h
#462
Conversation
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.
Pull Request Overview
This PR removes Python linkage from the build system, stripping out Python.h includes and the USE_PYTHON option, and updates relevant build scripts and documentation.
- Drop
-DUSE_PYTHONflag insetup.pyand remove Python find/link steps in CMake. - Remove Python headers and stub module init in
library.cpp. - Adjust Windows suffix logic and update changelog to note removed Python linking.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| setup.py | Removed -DUSE_PYTHON cmake argument |
| pyg_lib/csrc/library.cpp | Stripped out #include <Python.h> and Python init stub |
| CMakeLists.txt | Deleted USE_PYTHON option and Python linking; tweaked MSVC suffix |
| CHANGELOG.md | Added note for removed Python linking |
Comments suppressed due to low confidence (3)
pyg_lib/csrc/library.cpp:11
- [nitpick] This comment is outdated since
Python.his removed. Consider deleting or updating it to reflect the current codebase and avoid confusion.
// For PyMODINIT_FUNC to work, we need to include Python.h
pyg_lib/csrc/library.cpp:12
- The PyInit__C function signature no longer matches the expected Python module init signature. It should use
PyMODINIT_FUNC(returningPyObject*) or an equivalent to ensure the module can initialize correctly when Python support is restored or needed.
void* PyInit__C(void) {
CMakeLists.txt:156
- The
.pydsuffix is now applied for all MSVC builds, even when not building a Python extension. Restore theAND USE_PYTHONcondition to avoid incorrect artifact naming.
elseif (MSVC)
Motivated by pytorch/vision#8413.