Skip to content

Commit

Permalink
Fix wheel pure lib generation (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Mar 8, 2018
1 parent 5674e1d commit 1292f58
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions tools/setup.py
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 :
Expand All @@ -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',
Expand All @@ -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'],
Expand All @@ -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',
Expand All @@ -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'),
)

0 comments on commit 1292f58

Please sign in to comment.