Closed
Bug 1471622
Opened 6 years ago
Closed 6 years ago
[mozfile] Add support for Python 3
Categories
(Testing :: Mozbase, enhancement, P3)
Tracking
(firefox64 fixed)
VERIFIED
FIXED
mozilla64
Tracking | Status | |
---|---|---|
firefox64 | --- | fixed |
People
(Reporter: davehunt, Assigned: raphael, Mentored)
References
Details
(Keywords: good-first-bug)
Attachments
(7 files)
59 bytes,
text/x-review-board-request
|
davehunt
:
review+
|
Details |
59 bytes,
text/x-review-board-request
|
davehunt
:
review+
|
Details |
46 bytes,
text/x-phabricator-request
|
ahal
:
review+
|
Details | Review |
46 bytes,
text/x-phabricator-request
|
Details | Review | |
46 bytes,
text/x-phabricator-request
|
Details | Review | |
46 bytes,
text/x-phabricator-request
|
Details | Review | |
46 bytes,
text/x-phabricator-request
|
Details | Review |
+++ This bug was initially created as a clone of Bug #1388018 +++
Without dropping support for legacy Python, we need to add support for Python 3 to mozfile. Whilst some aspects were taken care of in bug 1388018 we are now able to run the unit tests against Python 3, and many of these are failing.
To work on this bug you will need to install and configure Mercurial, which will enable you to download the Firefox source code. It will also be used to commit your changes locally and prepare a patch for review. See the installation guide at https://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/installing.html for help getting Mercurial on your system. Once installed, there are some extensions we recommend installing, details of these can be found here: https://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/extensions.html
To clone the Firefox source code we recommend using the unified repository. Details of this and how to create a bookmark for your work can be found here: https://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/unifiedrepo.html
As this bug relates to Python 3, you will need to have this installed on your system. Our continuous integration is currently using Python 3.5, so for best results we recommend using the same version locally. There are a number of ways to install Python, and they vary depending on your environment. We suggest reading over the guides at http://docs.python-guide.org/en/latest/starting/installation/#python-3-installation-guides to find the best method for you. Note that we also need to maintain support for Python 2, so you'll also need to have Python 2.7 installed.
Whilst we're moving towards adding support for Python 3, we've disabled any tests that fail against this version. This means that in order to work on this bug you will need to enable the tests. This can be done by removing "skip-if = python == 3" from the manifest file in `testing/mozbase/mozfile/tests/manifest.ini`
To run the tests against Python 3, execute the following command:
```
mach python-test --python=3.5 testing/mozbase/mozfile
```
Work through the test failures, and update the tests and source code for the package to simultaneously support Python 2.7 and Python 3.5. You can always check that your changes have not inadvertently broken support for Python 2 by using `--python=2.7` on the command line.
If you're new to Python 3, the guide at https://docs.python.org/3/howto/pyporting.html may help you to get started with understanding the differences. To assist with supporting both Python 2 and 3, we have vendored the "six" package. You can read more about this and how to use it at https://pythonhosted.org/six/
Note that this package depends on others that may not yet support Python 3. If these dependencies are preventing tests from passing, then we can block this bug on getting support in those packages. If there are circular dependencies then we may need to coordinate landing a sequence of patches between bugs,
Once the package supports Python 3 and the tests pass, we will also need to prepare for a new release. Bump the version number in `testing/mozbase/mozfile/setup.py` to "2.0.0", and update the classifiers so they reflect the versions of Python that we now support.
Finally, to prepare a universal distribution, create a `testing/mozbase/mozfile/setup.cfg` file with the following contents:
```
[bdist_wheel]
universal=1
```
When your patch(es) are ready, you will need to push them for review. We are use MozReview for this, and instructions for how to prepare your machine and how to structure your commit messages can be found in our guide: https://mozilla-version-control-tools.readthedocs.io/en/latest/mozreview-user.html
There may be some review issues to address, but once your contribution has been approved and subsequently landed, we will release the new version of the package!
Updated•6 years ago
|
Priority: -- → P3
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Reporter | ||
Updated•6 years ago
|
Assignee: nobody → rpierzina
Status: NEW → ASSIGNED
Reporter | ||
Comment 3•6 years ago
|
||
mozreview-review |
Comment on attachment 8989379 [details]
Bug 1471622 - Fix mozfile's test_tempfile.py under Python 3.5;
https://reviewboard.mozilla.org/r/254474/#review261246
Attachment #8989379 -
Flags: review?(dave.hunt) → review+
Reporter | ||
Comment 4•6 years ago
|
||
mozreview-review |
Comment on attachment 8989378 [details]
Bug 1471622 - Fix mozfile's test_extract.py under Python 3.5;
https://reviewboard.mozilla.org/r/254472/#review261248
Attachment #8989378 -
Flags: review?(dave.hunt) → review+
Reporter | ||
Updated•6 years ago
|
Keywords: leave-open
Pushed by dhunt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f79b493702d6
Fix mozfile's test_extract.py under Python 3.5; r=davehunt
https://hg.mozilla.org/integration/autoland/rev/fe40015f4640
Fix mozfile's test_tempfile.py under Python 3.5; r=davehunt
Comment 6•6 years ago
|
||
bugherder |
Reporter | ||
Updated•6 years ago
|
Blocks: mozbuild-py3
Assignee | ||
Comment 7•6 years ago
|
||
This patch updates mozfile test_move_remove.py to use `open` instead of `file`
and enables the according test module for Python 3.5.
Comment 8•6 years ago
|
||
Comment on attachment 9010189 [details]
mozfile: Fix Python 3 compat issue in mozfile test_move_remove.py (Bug 1471622)
Andrew Halberstadt [:ahal] has approved the revision.
Attachment #9010189 -
Flags: review+
Pushed by dhunt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c36d288368a1
mozfile: Fix Python 3 compat issue in mozfile test_move_remove.py r=ahal
Comment 10•6 years ago
|
||
bugherder |
Assignee | ||
Comment 11•6 years ago
|
||
[mozfile] Bump version to 2.0.0, update classifiers and add setup.cfg (Bug 1471622)
Assignee | ||
Comment 12•6 years ago
|
||
Assignee | ||
Comment 13•6 years ago
|
||
Depends on D8096
Assignee | ||
Comment 14•6 years ago
|
||
Depends on D8097
Comment 15•6 years ago
|
||
Pushed by dhunt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5c168bf3ca2f
Update dependency specifier for mozfile in mozprofile; r=davehunt
https://hg.mozilla.org/integration/autoland/rev/d3ae81a06c15
Update dependency specifier for mozfile in mozrunner; r=davehunt
https://hg.mozilla.org/integration/autoland/rev/6b1fd4c384b9
Update dependency specifier for mozfile in tps; r=davehunt
Comment 16•6 years ago
|
||
bugherder |
Comment 17•6 years ago
|
||
Pushed by dhunt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/172e41126955
[mozfile] Bump version to 2.0.0, update classifiers and add setup.cfg r=davehunt
Reporter | ||
Updated•6 years ago
|
Keywords: leave-open
Comment 18•6 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Reporter | ||
Comment 19•6 years ago
|
||
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•