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

Removing python headers and Win32 Python2 inits in C++ #3011

Merged
merged 2 commits into from
Nov 16, 2020

Conversation

datumbox
Copy link
Contributor

@datumbox datumbox commented Nov 16, 2020

As discussed with @fmassa, we do some clean up on the C++ files:

  • Removed unnecessary imports of Python headers.
  • Eliminated Python2 inits for windows

Unfortunately removing completely the initialization functions for Win32 is not possible.

@datumbox datumbox changed the title [WIP] Removing python headers and code for Python2 compatibility. Removing python headers and Python2 inits in C++ Nov 16, 2020
@datumbox datumbox changed the title Removing python headers and Python2 inits in C++ Removing python headers and Win32 Python2 inits in C++ Nov 16, 2020
@datumbox datumbox requested a review from fmassa November 16, 2020 13:45
Copy link
Member

@fmassa fmassa left a comment

Choose a reason for hiding this comment

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

Great, thanks!

For the future, we should try to figure out how to make the linker on Windows to not prune PyInit__C etc, as we are now (unnecessarily?) introducing a dependency on Python.h.

FYI we could probably move the #include <Python.h> inside the ifdef _WIN32 now.

@fmassa fmassa merged commit 4fcf11d into pytorch:master Nov 16, 2020
@datumbox datumbox deleted the cleanup/remove_python_headers branch November 17, 2020 12:40
bryant1410 pushed a commit to bryant1410/vision-1 that referenced this pull request Nov 22, 2020
* Removing python headers and code for Python2 compatibility.

* Restoring python3 inits.
vfdev-5 pushed a commit to Quansight/vision that referenced this pull request Dec 4, 2020
* Removing python headers and code for Python2 compatibility.

* Restoring python3 inits.
@datumbox datumbox mentioned this pull request Jan 5, 2021
13 tasks
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.

3 participants