From 9c52a9df914ba79349210ddc9d1460c2d46d82eb Mon Sep 17 00:00:00 2001 From: Brett Gianpetro Date: Mon, 12 Mar 2018 10:43:34 -0500 Subject: [PATCH 1/4] Added Windows support with win_inet_pton --- radix/radix.py | 3 +++ setup.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/radix/radix.py b/radix/radix.py index 15b1048..142590a 100644 --- a/radix/radix.py +++ b/radix/radix.py @@ -1,3 +1,6 @@ +import sys +if sys.platform.startswith('win'): + import win_inet_pton from socket import (getaddrinfo, gaierror, inet_pton, inet_ntop, AF_INET, AF_INET6, SOCK_RAW, AI_NUMERICHOST) diff --git a/setup.py b/setup.py index 0759445..5cf32ca 100755 --- a/setup.py +++ b/setup.py @@ -56,6 +56,9 @@ ], tests_require=tests_require, packages=find_packages(exclude=['tests', 'tests.*']), + install_requires=[ + 'win-inet-pton;platform_system=="Windows"' + ], test_suite='nose.collector', **extra_kwargs ) From 9d4d1e1df1c0b0d8bd94f48b93a2daa01067f445 Mon Sep 17 00:00:00 2001 From: Brett Gianpetro Date: Mon, 12 Mar 2018 12:29:27 -0500 Subject: [PATCH 2/4] Updated README to include message about Windows support --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index 40f4754..4853f1c 100644 --- a/README.rst +++ b/README.rst @@ -32,6 +32,10 @@ want the C extension, set the environment variable ``RADIX_NO_EXT=1``. Tests are in the ``tests/`` directory and can be run with ``python setup.py nosetests``. +Windows +^^^^^^^ +Windows support depends on a third-party library--`win-inet-pton`--to provide `inet_pton` and `inet_ntop` wrappers for the socket library. It is automatically included for installations on the Windows platform. + Usage ----- From f6c33c182f0fec829096372402b81cdfd789689a Mon Sep 17 00:00:00 2001 From: Brett Gianpetro Date: Tue, 13 Mar 2018 09:21:21 -0500 Subject: [PATCH 3/4] Added version rqmt to win-inet-pton --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5cf32ca..7cea567 100755 --- a/setup.py +++ b/setup.py @@ -57,7 +57,7 @@ tests_require=tests_require, packages=find_packages(exclude=['tests', 'tests.*']), install_requires=[ - 'win-inet-pton;platform_system=="Windows"' + 'win-inet-pton >= 1.0.1;platform_system=="Windows"' ], test_suite='nose.collector', **extra_kwargs From 873e929fbbc6adcc17644c3a939edcf93d6faa4b Mon Sep 17 00:00:00 2001 From: Brett Gianpetro Date: Tue, 13 Mar 2018 09:29:53 -0500 Subject: [PATCH 4/4] Added comma at the end of 'install_requires' list --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7cea567..b425b5a 100755 --- a/setup.py +++ b/setup.py @@ -57,7 +57,7 @@ tests_require=tests_require, packages=find_packages(exclude=['tests', 'tests.*']), install_requires=[ - 'win-inet-pton >= 1.0.1;platform_system=="Windows"' + 'win-inet-pton >= 1.0.1;platform_system=="Windows"', ], test_suite='nose.collector', **extra_kwargs