-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Client: Python Patch: Thomas Bartelmess, Eevee (Alex Munroe), helgridly, Christian Verkerk, Jeroen Vlek, Nobuaki Sukegawa This closes #213 and closes #680
- Loading branch information
Showing
40 changed files
with
460 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
# under the License. | ||
# | ||
|
||
import platform | ||
import sys | ||
try: | ||
from setuptools import setup, Extension | ||
|
@@ -69,14 +70,15 @@ def run_setup(with_binary): | |
) | ||
else: | ||
extensions = dict() | ||
|
||
setup(name = 'thrift', | ||
version = '1.0.0-dev', | ||
description = 'Python bindings for the Apache Thrift RPC system', | ||
author = 'Thrift Developers', | ||
author_email = 'dev@thrift.apache.org', | ||
url = 'http://thrift.apache.org', | ||
license = 'Apache License 2.0', | ||
install_requires=['six>=1.7.2'], | ||
packages = [ | ||
'thrift', | ||
'thrift.protocol', | ||
|
@@ -90,15 +92,20 @@ def run_setup(with_binary): | |
'Intended Audience :: Developers', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 3', | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
nsuke
Author
Member
|
||
'Topic :: Software Development :: Libraries', | ||
'Topic :: System :: Networking' | ||
], | ||
use_2to3 = True, | ||
**extensions | ||
) | ||
|
||
try: | ||
run_setup(True) | ||
with_binary = False | ||
# Don't even try to build the C module unless we're on CPython 2.x. | ||
# TODO: fix it for CPython 3.x | ||
if platform.python_implementation() == 'CPython' and sys.version_info < (3,): | ||
with_binary = True | ||
run_setup(with_binary) | ||
except BuildFailed: | ||
print() | ||
print('*' * 80) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import sys | ||
|
||
if sys.version_info[0] == 2: | ||
|
||
from cStringIO import StringIO as BufferIO | ||
|
||
def binary_to_str(bin_val): | ||
return bin_val | ||
|
||
def str_to_binary(str_val): | ||
return str_val | ||
|
||
else: | ||
|
||
from io import BytesIO as BufferIO | ||
|
||
def binary_to_str(bin_val): | ||
try: | ||
return bin_val.decode('utf8') | ||
except: | ||
return bin_val | ||
|
||
def str_to_binary(str_val): | ||
try: | ||
return bytearray(str_val, 'utf8') | ||
except: | ||
return str_val |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
@nsuke This Python 3 trove classifier is not replicated at https://pypi.python.org/pypi/thrift/0.9.3 so thrift is unjustifiably marked as red instead of green on http://python3wos.mybluemix.net/