-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix wheel pure lib generation (#616)
- Loading branch information
Showing
1 changed file
with
24 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
from sys import executable | ||
from os.path import join as pjoin | ||
from os.path import dirname | ||
|
||
setuptools_import_error_message = """setuptools is not installed for """ + executable + """ | ||
Please follow this link for installing instructions : | ||
|
@@ -10,21 +12,24 @@ | |
except ImportError: | ||
raise ImportError(setuptools_import_error_message) | ||
|
||
from os.path import join as pjoin | ||
from os.path import dirname | ||
|
||
# Utility function to read the README file. | ||
# Used for the long_description. It's nice, because now 1) we have a top level | ||
# README file and 2) it's easier to type in the README file than to put a raw | ||
# string in below ... | ||
def read(fname): | ||
return open(pjoin(dirname(__file__), fname)).read() | ||
|
||
|
||
class BinaryDistribution(Distribution): | ||
def has_ext_modules(foo): | ||
return True | ||
def is_pure(self): | ||
return False | ||
def has_ext_modules(self): | ||
return True | ||
|
||
from setuptools.command.install import install | ||
class InstallPlatlib(install): | ||
def finalize_options(self): | ||
install.finalize_options(self) | ||
self.install_lib = self.install_platlib | ||
|
||
setup( | ||
name='ORTOOLS_PYTHON_VERSION', | ||
|
@@ -40,11 +45,11 @@ def has_ext_modules(foo): | |
'ortools.sat.python', | ||
'ortools.util', | ||
], | ||
install_requires = [ | ||
install_requires=[ | ||
'protobuf >= PROTOBUF_TAG', | ||
'six >= 1.10', | ||
], | ||
package_data = { | ||
package_data={ | ||
'ortools.constraint_solver' : ['_pywrapcp.dll'], | ||
'ortools.data' : ['_pywraprcpsp.dll'], | ||
'ortools.linear_solver' : ['_pywraplp.dll'], | ||
|
@@ -55,15 +60,15 @@ def has_ext_modules(foo): | |
}, | ||
include_package_data=True, | ||
license='Apache 2.0', | ||
author = 'Google Inc', | ||
author_email = '[email protected]', | ||
description = 'Google OR-Tools python libraries and modules', | ||
keywords = ('operations research, constraint programming, ' + | ||
'linear programming,' + 'flow algorithms,' + | ||
'python'), | ||
url = 'https://developers.google.com/optimization/', | ||
download_url = 'https://github.com/google/or-tools/releases', | ||
classifiers = [ | ||
author='Google Inc', | ||
author_email='[email protected]', | ||
description='Google OR-Tools python libraries and modules', | ||
keywords=('operations research, constraint programming, ' + | ||
'linear programming,' + 'flow algorithms,' + | ||
'python'), | ||
url='https://developers.google.com/optimization/', | ||
download_url='https://github.com/google/or-tools/releases', | ||
classifiers=[ | ||
'Development Status :: 5 - Production/Stable', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: Apache Software License', | ||
|
@@ -80,5 +85,6 @@ def has_ext_modules(foo): | |
'Topic :: Scientific/Engineering :: Mathematics', | ||
'Topic :: Software Development :: Libraries :: Python Modules'], | ||
distclass=BinaryDistribution, | ||
long_description = read('README.txt'), | ||
cmdclass={'install': InstallPlatlib}, | ||
long_description=read('README.txt'), | ||
) |