Bug 1024805
| Summary: | mock: Use Python 3 instead of Python 2 | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Miro Hrončok <mhroncok> |
| Component: | mock | Assignee: | Miroslav Suchý <msuchy> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | karlthered, mebrown, msuchy, pingou, redhat-bugzilla, williams |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-11-18 16:23:26 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | 1014563, 1024806, 1136366 | ||
| Bug Blocks: | 1024796 | ||
|
Description
Miro Hrončok
2013-10-30 13:15:38 UTC
Interesting. I started looking at what it would take to port mock to python3 last week and now I actually have a request for it :) I created a work-python3 branch in my local git tree, ran 2to3 over the mock directory and then started looking at the changes. So far I have two things that are show-stoppers: 1. Figuring out how to tell rpm to use python3 to byte-compile modules when packaging. 2. Translating the trace_decorator code. I'm sure more things will crop up as we move forward. The question is, should we try and maintain 2 and 3 simultaneously or should we do a cut-over to 3 at some point? I believe that RPM bytecompiles python3 modules by default, see for example this log: http://kojipkgs.fedoraproject.org/packages/python-setuptools/0.9.8/2.fc20/data/logs/noarch/build.log (search for byte-compiling) I think that dropping Python 2 support is not yet a very good idea for systems with doesn't offer Python 3, such as RHEL/CentOS. It's relatively easy to keep one code working with Pythons 2.6, 2.7 and 3.3. This is a very good text about it: http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/ Thanks to msimacek work, mock and mockchain are python3 ready. If you change #!/usr/bin/python in both scripts to #!/usr/bin/python3 it will work. I do not want to change it for current RHELs and stable Fedora and F21, which is just before release. I changed those shebang by sed in spec file for F22. Commit e75d55b. However there is one problem. There is no lvm2-python3-libs yet (see bug 1136366). Therefore build of mock-lvm subpackage is temporary disabled for F22. I hope I can enable it before we cut next release. By curiosity, from which version of mock is the API compatible py3 ? mock-1.2.0 is the first version which works under python3 rawhide version of mock now run under python3 |