Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@akihironitta
Copy link
Member

@akihironitta akihironitta commented May 25, 2025

Motivated by pytorch/vision#8413.

Copy link

Copilot AI left a 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_PYTHON flag in setup.py and 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.h is 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 (returning PyObject*) 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 .pyd suffix is now applied for all MSVC builds, even when not building a Python extension. Restore the AND USE_PYTHON condition to avoid incorrect artifact naming.
elseif (MSVC)

@akihironitta akihironitta marked this pull request as ready for review June 8, 2025 19:43
@github-actions github-actions bot added the ci label Jun 11, 2025
@akihironitta akihironitta changed the base branch from master to aki/tmp June 15, 2025 13:03
Base automatically changed from aki/tmp to master June 15, 2025 17:08
@github-actions github-actions bot removed the ci label Jun 15, 2025
@akihironitta akihironitta merged commit f921229 into master Jun 16, 2025
269 of 283 checks passed
@akihironitta akihironitta deleted the aki/python branch June 16, 2025 09:20
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.

2 participants