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

Move iocpsupport to external dist #1446

Merged
merged 9 commits into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Sean Riley
Software Freedom Conservancy
Tavendo GmbH
Thijs Triemstra
Thomas Grainger
Thomas Herve
Timothy Allen
Tom Most
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ install_requires =
Automat >= 0.8.0
hyperlink >= 17.1.1
attrs >= 19.2.0
twisted-iocpsupport ~= 1.0.0; platform_system == "Windows"
setup_requires = incremental >= 16.10.1
include_package_data = True
zip_safe = False
Expand Down
16 changes: 1 addition & 15 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
"""

import pathlib
import platform
import re
import sys

import setuptools

Expand All @@ -24,17 +22,5 @@
r"`\1 <https://github.com/twisted/twisted/blob/trunk/\2>`_",
pathlib.Path("README.rst").read_text(encoding="utf8"),
flags=re.I,
),
ext_modules=[
setuptools.Extension(
"twisted.internet.iocpreactor.iocpsupport",
sources=[
"src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c",
"src/twisted/internet/iocpreactor/iocpsupport/winsock_pointers.c",
],
libraries=["ws2_32"],
)
]
if sys.platform == "win32" and platform.python_implementation() == "CPython"
else [],
)
)
27 changes: 27 additions & 0 deletions src/twisted/internet/iocpreactor/iocpsupport.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
__all__ = [
"CompletionPort",
"Event",
"accept",
"connect",
"get_accept_addrs",
"have_connectex",
"makesockaddr",
"maxAddrLen",
"recv",
"recvfrom",
"send",
]

from twisted_iocpsupport.iocpsupport import (
Copy link
Member

Choose a reason for hiding this comment

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

can we have all this as from twisted_iocpsupport import recv ?

And maybe add a deprecation so that in the future the code will import directly from twisted_iocpsupport and not from this redirection.

Copy link
Member Author

Choose a reason for hiding this comment

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

probably worth doing https://github.com/asottile/reorder_python_imports everywhere in a followup

Copy link
Member

Choose a reason for hiding this comment

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

Well.. in Twisted we have backward compatibility policy, so you can't remove something from the public namespace without a prior deprecation warning.

But I can create the deprecation part after this is merged.

CompletionPort,
Event,
accept,
connect,
get_accept_addrs,
have_connectex,
makesockaddr,
maxAddrLen,
recv,
recvfrom,
send,
)
43 changes: 0 additions & 43 deletions src/twisted/internet/iocpreactor/iocpsupport/acceptex.pxi

This file was deleted.

43 changes: 0 additions & 43 deletions src/twisted/internet/iocpreactor/iocpsupport/connectex.pxi

This file was deleted.

Loading