Bug 485268

Summary: pymol currently incompatible with python 2.6
Product: [Fedora] Fedora Reporter: Need Real Name <howarth>
Component: pymolAssignee: Tim Fenn <tim.fenn>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: tim.fenn
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-11-30 20:58:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2009-02-12 17:46:44 UTC
Description of problem:
The current pymol releases are still incompatible with python 2.6

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
The removal of 'as' support in python 2.6 breaks sections of pymol's code.
Specifically if you look at...

http://pymol.svn.sourceforge.net/viewvc/pymol/trunk/pymol/modules/pymol/api.py?view=markup

You will see at the end of that file...

# dang! Python 2.6 will break PyMOL's "as" method.
# Proposal:
#  1. stick with Python <=2.5 for as long as possible
#  2. convert API method to cmd.show_as() and leave "as" in the scripting langauge
#  3. allow "show_as" in the scripting language
as = show_as

I believe the author of pymol said this issue might not be fixed until
pymol 1.5.
  
Actual results:


Expected results:


Additional info:

Comment 1 Need Real Name 2009-02-12 17:48:43 UTC
This issue should pop up during the packaging/installation of the pymol rpm if the python files in pymol are being compiled to optimized byte-code. The python files that require the depreciated 'as' construct will fail to compile under python 2.6.

Comment 2 Tim Fenn 2009-02-12 19:40:45 UTC
If pymol is not python 2.6 ready in time for fedora 11, what should be done with the package?

Comment 3 Tim Fenn 2009-02-25 02:20:17 UTC
fixed in SVN trunk rev. 3615, committed to devel branch:

http://koji.fedoraproject.org/koji/taskinfo?taskID=1165037

Comment 4 Need Real Name 2009-02-25 03:45:17 UTC
Current pymol trunk still isn't fully python2.6 compatible. My pymol-py package for fink on Mac OS X
compiles the python scripts when the deb file is installed. This reveals...

Compiling /sw/lib/pymol-py26/modules/pymol2/cmd2.py ...
SyntaxError: ('invalid syntax', ('/sw/lib/pymol-py26/modules/pymol2/cmd2.py', 264, 10, '    def as(self, *a, **k):\n'))

You really should make sure that a postinstall script runs on the pymol rpm to attempt to
compile all the python scripts that are installed. This will automatically validate the syntax
compatibility with python 2.6 for you.

Comment 5 Need Real Name 2009-02-25 04:06:46 UTC
The following patch should be sufficient to handle the last remaining cases of as...

--- pymol/modules/pymol2/cmd2.py.org    2009-02-24 22:57:16.000000000 -0500
+++ pymol/modules/pymol2/cmd2.py        2009-02-24 22:57:40.000000000 -0500
@@ -261,9 +261,9 @@
         k['_self']=self
         return apply(global_cmd.angle, a, k)
     
-    def as(self, *a, **k):
+    def as_(self, *a, **k):
         k['_self']=self
-        return apply(global_cmd.as, a, k)
+        return apply(global_cmd.as_, a, k)
     
     def attach(self, *a, **k):
         k['_self']=self

Do you see faint text in the Representations demo in the svn build on fedora 11?

Comment 6 Tim Fenn 2009-02-26 20:33:24 UTC
(In reply to comment #4)
> Current pymol trunk still isn't fully python2.6 compatible. My pymol-py package
> for fink on Mac OS X
> compiles the python scripts when the deb file is installed. This reveals...
> 
> Compiling /sw/lib/pymol-py26/modules/pymol2/cmd2.py ...
> SyntaxError: ('invalid syntax', ('/sw/lib/pymol-py26/modules/pymol2/cmd2.py',
> 264, 10, '    def as(self, *a, **k):\n'))
> 
> You really should make sure that a postinstall script runs on the pymol rpm to
> attempt to
> compile all the python scripts that are installed. This will automatically
> validate the syntax
> compatibility with python 2.6 for you.

setup.py doesn't list pymol2 as a module, so it wasn't being included/compiled.  I discussed this with upstream, and its OK to include (although not for "production use" at the moment), so I've just patched setup.py.

Comment 7 Tim Fenn 2009-02-26 20:35:57 UTC
(In reply to comment #5)
> The following patch should be sufficient to handle the last remaining cases of
> as...
> 
> --- pymol/modules/pymol2/cmd2.py.org    2009-02-24 22:57:16.000000000 -0500
> +++ pymol/modules/pymol2/cmd2.py        2009-02-24 22:57:40.000000000 -0500
> @@ -261,9 +261,9 @@
>          k['_self']=self
>          return apply(global_cmd.angle, a, k)
> 
> -    def as(self, *a, **k):
> +    def as_(self, *a, **k):
>          k['_self']=self
> -        return apply(global_cmd.as, a, k)
> +        return apply(global_cmd.as_, a, k)
> 
>      def attach(self, *a, **k):
>          k['_self']=self
> 

its in SVN rev 3616 now, which is included with the latest build:

http://koji.fedoraproject.org/koji/taskinfo?taskID=1195022

> Do you see faint text in the Representations demo in the svn build on fedora
> 11?

I've been having difficulty getting F11 to bring up X on my development machine, but I'll check this when I get it working.

Comment 8 Tim Fenn 2009-03-13 09:24:40 UTC
(In reply to comment #5)
> 
> Do you see faint text in the Representations demo in the svn build on fedora
> 11?  

Sorry this took me awhile to respond to - yes, using both the nv and nvidia driver, I observe this behavior.

Comment 9 Bug Zapper 2009-06-09 11:18:54 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 10 Tim Fenn 2009-07-15 22:56:16 UTC
OK to close?