Closed Bug 1428716 Opened 7 years ago Closed 5 years ago

[mozsystemmonitor] Add support for Python 3


(Testing :: Mozbase, enhancement, P3)

Version 3


(firefox71 fixed)

Tracking Status
firefox71 --- fixed


(Reporter: whimboo, Assigned: championshuttler, Mentored)



(Keywords: good-first-bug)


(2 files, 1 obsolete file)

Without dropping support for legacy Python, we need to add support for Python 3 to mozsystemmonitor.
Priority: -- → P3
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 for help getting Mercurial on your system. Once installed, there are some extensions we recommend installing, details of these can be found here:

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:

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 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/mozsystemmonitor/tests/manifest.ini`

To run the tests against Python 3, execute the following command:

mach python-test --python=3.5 testing/mozbase/mozsystemmonitor

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 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

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/mozsystemmonitor/` to "1.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/mozsystemmonitor/setup.cfg` file with the following contents:


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:

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!
Mentor: dave.hunt
No longer depends on: 1471916
Keywords: good-first-bug

Hello, I'm an Outreachy applicant. Can I work on this bug ?

(In reply to hafsa from comment #2)

Hello, I'm an Outreachy applicant. Can I work on this bug ?

It's not currently assigned, and I'm not aware of anyone else working on it so please go ahead! :)


Do we have to create our own hgrc file according to this ?

Flags: needinfo?(dave.hunt)

(In reply to aish98 from comment #4)

Do we have to create our own hgrc file according to this ?

You will need a .hgrc file. I believe this will be created for you when you run ./mach bootstrap

Flags: needinfo?(dave.hunt)
Assignee: nobody → shivams2799
Attachment #9096985 - Attachment is obsolete: true
Pushed by
Bump mozsystemmonitor to v1.0.0 and add classifiers. r=ahal
Create setup.cfg for universal wheels in mozsystemmonitor. r=ahal
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
See Also: → 1800121
You need to log in before you can comment on or make changes to this bug.