From 92b183ac3cedb2ad569f589ae11c04a633efb2de Mon Sep 17 00:00:00 2001 From: Driss Lahlou Date: Tue, 12 Jul 2016 14:55:11 +0200 Subject: [PATCH] python examples : check python version to choose between ortools and py3_ortools archive --- tools/README.examples.python | 2 -- tools/setup.py | 2 ++ tools/setup_data.py | 13 ++++++++++++- tools/setup_py3.py | 2 ++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tools/README.examples.python b/tools/README.examples.python index 5ed967c6b5..89e3baf7e0 100644 --- a/tools/README.examples.python +++ b/tools/README.examples.python @@ -17,8 +17,6 @@ or-tools/ To install the package, please run: - sudo python setup.py install -or python setup.py install --user This will pull ortools binary modules from Pypi and install them. diff --git a/tools/setup.py b/tools/setup.py index d1284cc4f8..9ba80a5cb1 100644 --- a/tools/setup.py +++ b/tools/setup.py @@ -49,6 +49,8 @@ setup( 'Operating System :: MacOS :: MacOS X', 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Office/Business :: Scheduling', 'Topic :: Scientific/Engineering', diff --git a/tools/setup_data.py b/tools/setup_data.py index 877e4be30c..dc6675db3c 100644 --- a/tools/setup_data.py +++ b/tools/setup_data.py @@ -1,6 +1,8 @@ from setuptools import setup, Extension from os.path import join as pjoin from os.path import dirname +from sys import version_info + # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level @@ -9,10 +11,15 @@ from os.path import dirname def read(fname): return open(pjoin(dirname(__file__), fname)).read() +if version_info[0] >= 3: + install_requires = ["py3-ortools >= VVVV"] +else: + install_requires = ["ortools >= VVVV"] + setup( name='ortools_examples', version='VVVV', - install_requires = ['ortools >= VVVV'], + install_requires = install_requires, license='Apache 2.0', author = 'Google Inc', author_email = 'lperron@google.com', @@ -28,8 +35,12 @@ setup( 'Operating System :: MacOS :: MacOS X', 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', 'Topic :: Office/Business :: Scheduling', 'Topic :: Scientific/Engineering', 'Topic :: Scientific/Engineering :: Mathematics', diff --git a/tools/setup_py3.py b/tools/setup_py3.py index f0e4fa3aee..9b2aff84e5 100644 --- a/tools/setup_py3.py +++ b/tools/setup_py3.py @@ -50,6 +50,8 @@ setup( 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', 'Topic :: Office/Business :: Scheduling', 'Topic :: Scientific/Engineering', 'Topic :: Scientific/Engineering :: Mathematics',