setup.py: don't install py3 scripts with python2

If one calls 'python2 setup.py install', python replaces the script shebangs
with python2 ones, regardless of the code being mint python3, and vice versa.
In setup.py, name only the scripts that match the current python version.

Change-Id: I84a5c8ec108a99f527b0d2fb5bf4e312df5f7403
This commit is contained in:
Neels Hofmeyr 2017-10-17 04:02:31 +02:00
parent 726b58dcfb
commit 4e8d6eec5c
1 changed files with 9 additions and 4 deletions

View File

@ -17,15 +17,20 @@
from distutils.core import setup
from osmopy import __version__
import sys
if sys.version_info.major == 2:
scripts = ["osmopy/osmodumpdoc.py", "osmopy/osmotestconfig.py",
"osmopy/osmotestvty.py"]
elif sys.version_info.major == 3:
scripts = ["osmopy/osmo_verify_transcript_vty.py",
"osmopy/osmo_verify_transcript_ctrl.py"]
setup(
name = 'osmopython',
version = __version__,
packages = ["osmopy"],
scripts = ["osmopy/osmodumpdoc.py", "osmopy/osmotestconfig.py",
"osmopy/osmotestvty.py",
"osmopy/osmo_verify_transcript_vty.py",
"osmopy/osmo_verify_transcript_ctrl.py"],
scripts = scripts,
license = "AGPLv3",
description = "Osmopython: osmocom testing scripts",
author = "Katerina Barone-Adesi",