Bug 537246 - RFE: python3-virtualenv
Summary: RFE: python3-virtualenv
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-virtualenv
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Steve Milner
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: Python3F13 1010767
TreeView+ depends on / blocked
 
Reported: 2009-11-12 22:02 UTC by Dave Malcolm
Modified: 2015-05-06 16:14 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-05-06 16:14:06 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
separate specfile that builds but shows runtime errors (3.05 KB, text/plain)
2009-11-12 22:22 UTC, Dave Malcolm
no flags Details
draft spec update (4.22 KB, application/octet-stream)
2011-04-13 21:08 UTC, Felix Schwarz
no flags Details
python3 support for python-virtualenv-1.7.1.2 (3.29 KB, patch)
2012-04-11 08:46 UTC, Felix Schwarz
no flags Details | Diff
python3 support for python-virtualenv-1.7.1.2, using python3-virtualenv for the executable (3.31 KB, patch)
2012-07-12 08:15 UTC, Felix Schwarz
no flags Details | Diff

Description Dave Malcolm 2009-11-12 22:02:31 UTC
I'm working on adding a python 3 stack to Fedora 13, parallel-installable with
the main python 2 stack:
https://fedoraproject.org/wiki/Features/Python3F13

There are two approaches I'm experimenting with to packaging modules for python
3:
  (a) create an separate specfile/srpm for the python 3 version
  (b) extend an existing specfile so that it emits a python3- subpackage as
part of the build.

See: https://fedoraproject.org/wiki/PackagingDrafts/Python3

We have a preliminary, working python3-setuptools rpm, though not yet in CVS/Koji (see the tracker bug)

Any idea what upstream's plans are for python 2 vs python 3 support?

http://stackoverflow.com/questions/1416005/python-virtualenv-python-3

Comment 1 Steve Milner 2009-11-12 22:17:00 UTC
I don't know how they will be handling Python 3 users at the moment, so I opened up an issue with them to find out:

    http://bitbucket.org/ianb/virtualenv/issue/10/python-3-support

I'll if I can get it working with a 2to3 in the meantime.

Comment 2 Dave Malcolm 2009-11-12 22:20:11 UTC
A simple 2to3 invocation doesn't appear to be enough; I get a runtime failure
trying to extract the big base64-encoded script files in virtualenv.py; I'm
guessing these may also need 2to3 on them even after extraction:

Traceback (most recent call last):
  File "/usr/bin/virtualenv3", line 8, in <module>
    load_entry_point('virtualenv==1.3.3', 'console_scripts', 'virtualenv3')()
  File "/usr/lib/python3.1/site-packages/pkg_resources.py", line 281, in
load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.1/site-packages/pkg_resources.py", line 2201, in
load_entry_point
    return ep.load()
  File "/usr/lib/python3.1/site-packages/pkg_resources.py", line 1920, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python3.1/site-packages/virtualenv.py", line 1093, in <module>
    """.decode("base64").decode("zlib")
AttributeError: 'str' object has no attribute 'decode'

Comment 3 Dave Malcolm 2009-11-12 22:22:27 UTC
Created attachment 369337 [details]
separate specfile that builds but shows runtime errors

Comment 4 Dave Malcolm 2010-02-03 14:53:44 UTC
As noted on: http://bitbucket.org/ianb/virtualenv/issue/10/python-3-support#comment-110814
> Brandon Rhodes forked and seems to have a working virtualenv3:
> http://pypi.python.org/pypi/virtualenv3
> http://bitbucket.org/brandon/virtualenv3/

It's not clear to me how "official" the fork is.

Packaging this as, say, python3-virtualenv.spec would be approach (a) in comment #0 above.

Comment 5 Steve Milner 2010-02-03 18:03:56 UTC
I think (a) is going to be the best option at this point.

Comment 6 Steve Milner 2010-06-08 18:21:05 UTC
It seems like work on the fork has stopped :-(

Comment 7 Felix Schwarz 2011-04-13 20:35:41 UTC
Good news is that virtualenv 1.6 has official Python 3 support :-)

Comment 8 Felix Schwarz 2011-04-13 21:08:06 UTC
Created attachment 491905 [details]
draft spec update

I did a lot of copy/paste from python-nose to have python-virtualenv 1.6 with a python3 subpackage. No runtime testing so far.

Comment 9 Felix Schwarz 2011-04-17 20:07:15 UTC
Actually the spec above works for me on Fedora 14.

Comment 10 Felix Schwarz 2012-04-11 08:46:18 UTC
Created attachment 576707 [details]
python3 support for python-virtualenv-1.7.1.2

proposed patch adds a Python3 subpackage for python-virtualenv. Works for me on F16.

Comment 11 Ralph Bean 2012-07-11 14:56:16 UTC
Felix, I think the patch should be revised (only slightly) to move the exectuable from "virtualenv" to "python3-virtualenv" instead of "virtualenv3" as you have done.

See the discussion of "python3-coverage" here http://fedoraproject.org/wiki/Packaging:Python

Other than that, it looks great.  Is there anything else standing in the way of applying this and creating an update?

Comment 12 Felix Schwarz 2012-07-11 18:41:10 UTC
(In reply to comment #11)
> Other than that, it looks great.  Is there anything else standing in the way
> of applying this and creating an update?

I don't have commit access to virtualenv and Steve did not express any interest in this so far. 

I'll update my patch and hopefully we can set this one as fixed then :-)

Comment 13 Felix Schwarz 2012-07-12 08:15:59 UTC
Created attachment 597734 [details]
python3 support for python-virtualenv-1.7.1.2, using python3-virtualenv for the executable

I updated the patch so that the executable is named python3-virtualenv. I didn't test it on rawhide but the F16 version works well and I believe rawhide will just be fine as well.

One thing I noticed is that the python3 package includes '__pycache__' directory and I'm not sure if we should package that. 

I now applied for commit access to python-virtualenv, so hopefully I'll be able to resolve the bug myself soon. Would be grateful to get this bug of my plate soon.

Comment 14 Ralph Bean 2012-07-12 12:09:17 UTC
You should package it, I think; it gets re-created during runtime.  That's where the *.pyc and *.pyo files get stored for python3.

Comment 15 Dhiru Kholia 2013-04-06 06:56:27 UTC
Any updates on this?

Comment 16 Ralph Bean 2013-04-06 15:31:43 UTC
I'd note that in python 3.3, virtualenv have been moved into the core:

http://docs.python.org/3/library/venv.html#module-venv

In my opinion, there is no longer a need for a python3-virtualenv.  With due respect for those who worked on it, I propose that the owner or reporter close this bug as wontfix.

Comment 17 Yury V. Zaytsev 2013-08-09 08:24:59 UTC
I've just tried `virtualenv` from the `python-virtualenv` package and it is able to successfully create and activate Python 3 virtualenvs (provided that `python3` package is installed, of course):

  $ virtualenv --system-site-packages -p /usr/bin/python3 py3k.env
  $ source py3k.env/bin/activate
  $ python
  Python 3.3.0 (default, Sep 29 2012, 22:33:28)

So it would appear that the problem has solved itself with time :-) Thus I second the notion that this bug can be closed.

Comment 18 Christopher Meng 2013-12-14 08:32:49 UTC
But why do I see so many distros have parallel installable package of virtualenv...

Comment 19 Orion Poplawski 2015-05-06 16:14:06 UTC
This was fixed a while back.

commit 83fb3a6012a3bc5447d5a57a2893c65a49f03d8d
Author: Matthias Runge <mrunge>
Date:   Thu Jan 15 11:14:18 2015 +0100

    add python3 subpackage

with 1.11.6-2


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