Files
ortools-clone/ortools/python/setup.py.in
2024-11-06 10:35:46 +01:00

180 lines
6.4 KiB
Python

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 :
https://pypi.python.org/pypi/setuptools
make sure you use \"""" + executable + """\" during the installation"""
try:
from setuptools import find_packages, setup
from setuptools.dist import Distribution
from setuptools.command.install import install
except ImportError:
raise ImportError(setuptools_import_error_message)
class BinaryDistribution(Distribution):
def is_pure(self):
return False
def has_ext_modules(self):
return True
class InstallPlatlib(install):
def finalize_options(self):
install.finalize_options(self)
self.install_lib = self.install_platlib
# 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()
setup(
name='@PYTHON_PROJECT@',
version='@PROJECT_VERSION@',
packages=find_packages(),
python_requires='>= 3.8',
install_requires=[
'absl-py >= 2.0.0',
'numpy >= 1.13.3',
'pandas >= 2.0.0',
'protobuf >= 5.28.2,<5.29',
'immutabledict >= 3.0.0',
],
package_data={
'@PYTHON_PROJECT@':[
'.libs/*',
$<$<STREQUAL:$<TARGET_PROPERTY:@PROJECT_NAME@,TYPE>,SHARED_LIBRARY>:'../$<TARGET_SONAME_FILE_NAME:@PROJECT_NAME@>'>
],
'@PYTHON_PROJECT@.init.python':[
'$<TARGET_FILE_NAME:init_pybind11>',
'*.pyi'
],
'@PYTHON_PROJECT@.algorithms.python':[
'$<TARGET_FILE_NAME:knapsack_solver_pybind11>',
'$<TARGET_FILE_NAME:set_cover_pybind11>',
'*.pyi'
],
'@PYTHON_PROJECT@.bop':['*.pyi'],
'@PYTHON_PROJECT@.glop':['*.pyi'],
'@PYTHON_PROJECT@.graph.python':[
'$<TARGET_FILE_NAME:linear_sum_assignment_pybind11>',
'$<TARGET_FILE_NAME:max_flow_pybind11>',
'$<TARGET_FILE_NAME:min_cost_flow_pybind11>',
'*.pyi'],
'@PYTHON_PROJECT@.gscip':['*.pyi'],
'@PYTHON_PROJECT@.constraint_solver':[
'$<TARGET_FILE_NAME:pywrapcp>',
'*.pyi'
],
'@PYTHON_PROJECT@.constraint_solver.python':[
'$<TARGET_FILE_NAME:constraint_solver_pybind11>',
'*.pyi'
],
'@PYTHON_PROJECT@.linear_solver':[
'$<TARGET_FILE_NAME:pywraplp>',
'*.pyi'
],
'@PYTHON_PROJECT@.linear_solver.python':[
'$<TARGET_FILE_NAME:model_builder_helper_pybind11>',
'*.pyi',
'py.typed'
],
'pybind11_abseil':[
'$<TARGET_FILE_NAME:status_py_extension_stub>',
'*.pyi'
],
'@PYTHON_PROJECT@.math_opt':['*.pyi'],
'@PYTHON_PROJECT@.math_opt.core.python':[
'$<TARGET_FILE_NAME:math_opt_pybind11>',
'*.pyi'
],
'@PYTHON_PROJECT@.math_opt.python':['*.pyi'],
'@PYTHON_PROJECT@.math_opt.solvers':['*.pyi'],
'@PYTHON_PROJECT@.service.v1':['*.pyi'],
'@PYTHON_PROJECT@.service.v1.mathopt':['*.pyi'],
'@PYTHON_PROJECT@.packing':['*.pyi'],
'@PYTHON_PROJECT@.pdlp':['*.pyi'],
'@PYTHON_PROJECT@.pdlp.python':[
'$<TARGET_FILE_NAME:pdlp_pybind11>',
'*.pyi'
],
'@PYTHON_PROJECT@.routing':[
'$<TARGET_FILE_NAME:pywraprouting>',
'*.pyi'
],
'@PYTHON_PROJECT@.routing.python':[
'$<TARGET_FILE_NAME:routing_pybind11>',
'*.pyi'
],
'@PYTHON_PROJECT@.sat':['*.pyi'],
'@PYTHON_PROJECT@.sat.colab':['*.pyi', 'py.typed'],
'@PYTHON_PROJECT@.sat.python':[
'$<TARGET_FILE_NAME:swig_helper_pybind11>',
'*.pyi',
'py.typed'
],
'@PYTHON_PROJECT@.scheduling.python':[
'$<TARGET_FILE_NAME:rcpsp_pybind11>',
'*.pyi'
],
'@PYTHON_PROJECT@.util.python':[
'$<TARGET_FILE_NAME:sorted_interval_list_pybind11>',
'*.pyi'
],
},
include_package_data=True,
license='Apache 2.0',
author='Google LLC',
author_email='or-tools@google.com',
description='Google OR-Tools python libraries and modules',
long_description=read('README.txt'),
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',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Information Technology',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Operating System :: Unix',
'Operating System :: POSIX :: Linux',
'Operating System :: POSIX :: BSD :: FreeBSD',
'Operating System :: POSIX :: BSD :: NetBSD',
'Operating System :: POSIX :: BSD :: OpenBSD',
'Operating System :: MacOS',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: C++',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Office/Business :: Scheduling',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries :: Python Modules',
],
distclass=BinaryDistribution,
cmdclass={'install': InstallPlatlib},
)