[103753] trunk/dports/python
eborisch at macports.org
eborisch at macports.org
Wed Mar 6 07:17:59 PST 2013
Revision: 103753
https://trac.macports.org/changeset/103753
Author: eborisch at macports.org
Date: 2013-03-06 07:17:59 -0800 (Wed, 06 Mar 2013)
Log Message:
-----------
py-spyder[-devel]: Fix PyQt4 version checks. Implemented upstream in hg version.
Modified Paths:
--------------
trunk/dports/python/py-spyder/Portfile
trunk/dports/python/py-spyder-devel/Portfile
Added Paths:
-----------
trunk/dports/python/py-spyder/files/spyderlib_requirements.py.diff
trunk/dports/python/py-spyder-devel/files/spyderlib_requirements.py.diff
Modified: trunk/dports/python/py-spyder/Portfile
===================================================================
--- trunk/dports/python/py-spyder/Portfile 2013-03-06 15:13:45 UTC (rev 103752)
+++ trunk/dports/python/py-spyder/Portfile 2013-03-06 15:17:59 UTC (rev 103753)
@@ -4,6 +4,7 @@
PortSystem 1.0
name py-spyder
version 2.1.13
+revision 1
epoch 20111202
PortGroup python 1.0
@@ -54,7 +55,8 @@
spyderlib_plugins_editor.py.diff \
spyderlib_spyder.py.diff \
spyderlib_utils_programs.py.diff \
- spyderlib_widgets_shell.py.diff
+ spyderlib_widgets_shell.py.diff \
+ spyderlib_requirements.py.diff
post-patch {
reinplace "s|@@WINPDB_BIN_NAME@@|${WINPDB_BIN_NAME}|g" \
Added: trunk/dports/python/py-spyder/files/spyderlib_requirements.py.diff
===================================================================
--- trunk/dports/python/py-spyder/files/spyderlib_requirements.py.diff (rev 0)
+++ trunk/dports/python/py-spyder/files/spyderlib_requirements.py.diff 2013-03-06 15:17:59 UTC (rev 103753)
@@ -0,0 +1,34 @@
+--- spyderlib/requirements.py.orig 2013-03-05 15:00:42.000000000 -0600
++++ spyderlib/requirements.py 2013-03-05 15:02:35.000000000 -0600
+@@ -9,13 +9,7 @@
+ import sys
+ import os
+ import os.path as osp
+-
+-def check_version(actual_str, required_str):
+- """Return True if actual_str version fit required_str requirement"""
+- actual = actual_str.split('.')
+- required = required_str.split('.')
+- return actual[0] < required[0] or \
+- (actual[0] == required[0] and actual[1] < required[1])
++from distutils.version import LooseVersion
+
+ def show_warning(message):
+ """Show warning using Tkinter if available"""
+@@ -43,12 +37,12 @@
+ qt_infos = dict(pyqt=("PyQt4", "4.4"), pyside=("PySide", "1.0"))
+ try:
+ from spyderlib import qt
+- package_name, required_str = qt_infos[qt.API]
+- actual_str = qt.__version__
+- if check_version(actual_str, required_str):
++ package_name, required_ver = qt_infos[qt.API]
++ actual_ver = qt.__version__
++ if LooseVersion(actual_ver) < LooseVersion(required_ver):
+ show_warning("Please check Spyder installation requirements:\n"
+ "%s %s+ is required (found v%s)."
+- % (package_name, required_str, actual_str))
++ % (package_name, required_ver, actual_ver))
+ except ImportError:
+ show_warning("Please check Spyder installation requirements:\n"
+ "%s %s+ (or %s %s+) is required."
Modified: trunk/dports/python/py-spyder-devel/Portfile
===================================================================
--- trunk/dports/python/py-spyder-devel/Portfile 2013-03-06 15:13:45 UTC (rev 103752)
+++ trunk/dports/python/py-spyder-devel/Portfile 2013-03-06 15:17:59 UTC (rev 103753)
@@ -4,7 +4,7 @@
PortSystem 1.0
name py-spyder-devel
version 2.2.0beta3
-revision 0
+revision 1
epoch 20130115
PortGroup python 1.0
@@ -54,7 +54,8 @@
spyderlib_baseconfig.py.diff \
spyderlib_plugins_editor.py.diff \
spyderlib_spyder.py.diff \
- spyderlib_utils_programs.py.diff
+ spyderlib_utils_programs.py.diff \
+ spyderlib_requirements.py.diff
post-patch {
reinplace "s|@@WINPDB_BIN_NAME@@|${WINPDB_BIN_NAME}|g" \
Added: trunk/dports/python/py-spyder-devel/files/spyderlib_requirements.py.diff
===================================================================
--- trunk/dports/python/py-spyder-devel/files/spyderlib_requirements.py.diff (rev 0)
+++ trunk/dports/python/py-spyder-devel/files/spyderlib_requirements.py.diff 2013-03-06 15:17:59 UTC (rev 103753)
@@ -0,0 +1,33 @@
+--- spyderlib/requirements.py.orig 2013-03-05 15:00:42.000000000 -0600
++++ spyderlib/requirements.py 2013-03-05 15:02:35.000000000 -0600
+@@ -9,12 +9,6 @@
+ import sys
+ import os.path as osp
+-
+-def check_version(actual_str, required_str):
+- """Return True if actual_str version fit required_str requirement"""
+- actual = actual_str.split('.')
+- required = required_str.split('.')
+- return actual[0] < required[0] or \
+- (actual[0] == required[0] and actual[1] < required[1])
++from distutils.version import LooseVersion
+
+ def show_warning(message):
+ """Show warning using Tkinter if available"""
+@@ -42,12 +36,12 @@
+ qt_infos = dict(pyqt=("PyQt4", "4.4"), pyside=("PySide", "1.0"))
+ try:
+ from spyderlib import qt
+- package_name, required_str = qt_infos[qt.API]
+- actual_str = qt.__version__
+- if check_version(actual_str, required_str):
++ package_name, required_ver = qt_infos[qt.API]
++ actual_ver = qt.__version__
++ if LooseVersion(actual_ver) < LooseVersion(required_ver):
+ show_warning("Please check Spyder installation requirements:\n"
+ "%s %s+ is required (found v%s)."
+- % (package_name, required_str, actual_str))
++ % (package_name, required_ver, actual_ver))
+ except ImportError:
+ show_warning("Please check Spyder installation requirements:\n"
+ "%s %s+ (or %s %s+) is required."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130306/7880a44b/attachment-0001.html>
More information about the macports-changes
mailing list