Bug 485268 - pymol currently incompatible with python 2.6
pymol currently incompatible with python 2.6
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: pymol (Show other bugs)
11
All Linux
low Severity medium
: ---
: ---
Assigned To: Tim Fenn
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-12 12:46 EST by Need Real Name
Modified: 2009-11-30 15:58 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-11-30 15:58:40 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2009-02-12 12:46:44 EST
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 12:48:43 EST
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 14:40:45 EST
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-24 21:20:17 EST
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-24 22:45:17 EST
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-24 23:06:46 EST
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 15:33:24 EST
(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 15:35:57 EST
(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 05:24:40 EDT
(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 07:18:54 EDT
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 18:56:16 EDT
OK to close?

Note You need to log in before you can comment on or make changes to this bug.