[meld] Add checking for python version in Setup.py, like meld itself (bgo#772934).
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Add checking for python version in Setup.py, like meld itself (bgo#772934).
- Date: Wed, 18 Jan 2017 20:47:58 +0000 (UTC)
commit 691cb53327b199e929ef51fe7d2116560146b83f
Author: Vasily Galkin <galkin-vv yandex ru>
Date: Wed Jan 18 22:34:04 2017 +0300
Add checking for python version in Setup.py, like meld itself (bgo#772934).
Also setup.py PyPI classifier updated according to 2->3 porting guide.
bin/meld | 5 ++---
meld/conf.py | 1 +
setup.py | 6 +++++-
3 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/bin/meld b/bin/meld
index 483b705..21c47d4 100755
--- a/bin/meld
+++ b/bin/meld
@@ -170,7 +170,6 @@ def show_error_and_exit(error_text):
def check_requirements():
- pyver = (3, 3)
gtk_requirement = (3, 14)
glib_requirement = (2, 36, 0)
gtksourceview_requirement = (3, 14, 0)
@@ -182,8 +181,8 @@ def check_requirements():
modver = mod + " " + ".".join(map(str, ver))
show_error_and_exit(_("Meld requires %s or higher.") % modver)
- if sys.version_info[:2] < pyver:
- missing_reqs("Python", pyver)
+ if sys.version_info[:2] < meld.conf.PYTHON_REQUIREMENT_TUPLE:
+ missing_reqs("Python", meld.conf.PYTHON_REQUIREMENT_TUPLE)
# gtk+ and related imports
try:
diff --git a/meld/conf.py b/meld/conf.py
index 6c8f2cd..2aafdde 100644
--- a/meld/conf.py
+++ b/meld/conf.py
@@ -11,6 +11,7 @@ LOCALEDIR = os.path.join(sys.prefix, "share", "locale")
# END
UNINSTALLED = False
UNINSTALLED_SCHEMA = False
+PYTHON_REQUIREMENT_TUPLE = (3, 3)
# Installed from main script
_ = lambda x: x
diff --git a/setup.py b/setup.py
index 05f0af6..abb768e 100755
--- a/setup.py
+++ b/setup.py
@@ -2,10 +2,14 @@
from distutils.core import setup
import glob
+import sys
import meld.build_helpers
import meld.conf
+if sys.version_info[:2] < meld.conf.PYTHON_REQUIREMENT_TUPLE:
+ version = ".".join(map(str, meld.conf.PYTHON_REQUIREMENT_TUPLE))
+ raise Exception("Meld setup requires Python %s or higher." % version)
setup(
name=meld.conf.__package__,
@@ -22,7 +26,7 @@ setup(
'Intended Audience :: System Administrators',
'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)',
'Programming Language :: Python',
- 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3 :: Only',
'Topic :: Desktop Environment :: Gnome',
'Topic :: Software Development',
'Topic :: Software Development :: Version Control',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]