2016-12-26 14:20:36 +03:00
# HACKING
The following commands will be useful for anyone writing patches:
```sh
2018-02-07 02:59:48 +03:00
./setup.py test # Run local unit test suite
./setup.py pylint # Run a pylint script against the codebase
2018-05-21 22:42:49 +03:00
./setup.py codespell # Run a codespell script against the codebase
2016-12-26 14:20:36 +03:00
```
2018-05-21 22:42:49 +03:00
Any patches shouldn't change the output of 'test', 'pylint' or 'codespell'. The
'pylint' requires [`pylint` ](https://github.com/PyCQA/pylint ) and
[`pycodestyle` ](https://github.com/pycqa/pycodestyle ) to be installed. The
'codespell' requires
[`codespell` ](https://github.com/codespell-project/codespell ) to be installed.
2016-12-26 14:20:36 +03:00
Our pylint script uses a blacklist rather than a whitelist approach,
so it could throw some false positives or useless messages. If you think
your patch exposes one of these, bring it up on the mailing list.
'test*' have a `--debug` option if you are hitting problems.
2018-02-07 02:59:48 +03:00
For more options, use `./setup.py test --help` .
2016-12-26 14:20:36 +03:00
One useful way to manually test virt-manager's UI is using libvirt's
unit test driver. From the source directory, Launch virt-manager like:
```sh
virt-manager --connect test://$PWD/tests/testdriver.xml
```
This testdriver has many fake XML definitions that can be used to see each bit
of virt-manager's UI. It also enables testing the various wizards without
having to alter your host virt config.
Also, there's a few standalone specialty tests:
```sh
2018-02-07 02:59:48 +03:00
./setup.py test_urls # Test fetching media from distro URLs
./setup.py test_initrd_inject # Test --initrd-inject
2016-12-26 14:20:36 +03:00
```
We use [glade-3 ](https://glade.gnome.org/ ) for building virt-manager's UI.
It is recommended you have a fairly recent version of `glade-3` . If a small UI
change seems to rewrite the entire glade file, you likely have a too old
(or too new :) glade version.
## Submitting patches
Patches should be developed against a git checkout and **not** a source
release(see [git repository ](https://github.com/virt-manager/virt-manager )).
Patches should be sent to the
2018-04-30 15:56:53 +03:00
[mailing list ](https://www.redhat.com/mailman/listinfo/virt-tools-list ).
2016-12-26 14:20:36 +03:00
Using git format-patch/send-email is preferred, but an attachment with
format-patch output is fine too.
Small patches are acceptable via github pull-request, but anything
non-trivial should be sent to the mailing list.
## Translations
Translations are handled at `fedora.zanata.org` . Please register for a Fedora
account and request access to a translation team, as described at
2018-04-30 15:56:53 +03:00
[Translate on Zanata ](https://fedoraproject.org/wiki/L10N/Translate_on_Zanata ).
2016-12-26 14:20:36 +03:00
And contribute to
[virt-manager at Zanata ](https://fedora.zanata.org/project/view/virt-manager/ ).