Commit Graph

121 Commits

Author SHA1 Message Date
Pavel Hrdina
ec266d3cda setup: introduce --jobs for pylint
Pylint supports configuring jobs to use multiple processes to
speed up Pylint.  Default value is 1.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-09-09 11:10:42 +02:00
Chen Hanxiao
c92aade081 pycodestyle: fix all E203 warnings
Fix all E203 whitespace before ':'
   Also remove E203 ignore option of pycodestyle

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-08-11 00:01:38 +08:00
Radostin Stoyanov
b93cc3bbc9 pycodestyle: Do not use bare 'except:'
A bare 'except:' catches all exceptions [1], including SystemExit,
KeyboardInterrupt, and GeneratorExit (which is not an error and should
not normally be caught by user code). In situations where you need to
catch all “normal” errors, you can catch the base class for all normal
exceptions, Exception [2].

[1] https://docs.python.org/2/howto/doanddont.html#except
[2] https://docs.python.org/2/library/exceptions.html#Exception
2017-08-02 13:57:43 -04:00
Radostin Stoyanov
2fd6d9aa32 tests: Upgrade pep8 to pycodestyle
The PEP8 [1] project has been renamed to pycodestyle [2].

[1] https://github.com/codeclimate/pep8
[2] https://github.com/pycqa/pycodestyle
2017-08-02 13:23:20 -04:00
Cole Robinson
8d8b353b28 virtinst: Fix bare python3 style print()
We want a newline, so pass it ""
2017-07-10 09:34:22 -04:00
Cole Robinson
ced1d3cadb setup: pylint: use pylint-2 binary if available 2017-06-15 08:11:34 -04:00
Cole Robinson
f551d7e55d Replace file() usage with open()
Same semantics, but the latter is needed for python3
2017-05-05 14:53:12 -04:00
Cole Robinson
55288c4551 Convert to python3 style print() syntax
Use __future__ imports to keep this working for python2
2017-05-05 14:52:37 -04:00
Cole Robinson
158a1e0572 setup: test: up verbosity if --debug is passed 2016-07-20 18:15:27 -04:00
Cole Robinson
df5c688c11 tests_inject: Update to use standard --only option
Rather than custom --distro option. And fix the URL list
2016-06-17 18:41:50 -04:00
Cole Robinson
cf3a1cc1f0 appdata: Modernize, and translate it
This also revealed our translations were busted for .desktop files
as well, so rework the POTFILES.in generation to account for it
2016-06-17 18:06:07 -04:00
Cole Robinson
927990ad9d tests: clitest: Allow --only matching on output filename
So you can do "python setup.py --only many-devices' to only run the
clitest compare tests that output their results to files with
"many-devices" in the name
2016-06-11 15:58:48 -04:00
Cole Robinson
f4dfb6de9d Fix recent pylint/pep8 output 2016-04-18 16:42:12 -04:00
Cole Robinson
fe722b99cb setup: Make gsettings always work regardless of install dir (bz #1267377)
Most of this is lifted from 'meld'. The bits are

- compile gsettings schemas at setup.py install time
- add options to disable that, and use them in the RPM
- always pass GSETTINGS_SCHEMA_DIR so gsettings loading always works
  regardless of the install dir

https://bugzilla.redhat.com/show_bug.cgi?id=1267377
2015-11-02 21:02:42 -05:00
Cole Robinson
293a1d1509 setup: Use full distutils import paths
Improves clarity
2015-11-02 17:21:06 -05:00
Cole Robinson
554a39ddae setup: Fix system install on ubuntu
Ubuntu ends up installing in /usr/local, even though system prefix
variable tells us it's /usr. Lots of UI things don't work in /usr/local,
so point it back at /usr.
2015-09-23 19:29:13 -04:00
Cole Robinson
d5d6cfff2c Copy urlgrabber progress bar code into virt-manager.git
This is so we can drop the dep on system python-urlgrabber, which will
block us from going to python3.

All we need is like 300 lines from python-urlgrabber for the progress
bar. In reality our needs are much lower, we don't need the fancy
progress bar that urlgrabber provides, but it's nice to have. So if
keeping a copy of this code causes issues in the future, we can probably
come up with something simpler (or hopefully there's a more common
python progressbar impl that we can use at that point).
2015-09-18 20:55:44 -04:00
Cole Robinson
a51c12660f setup: Do pep8 before pylint
pep8 is super quick, so if there's issue devs can fix those while pylint
is running and gives exhaustive output
2015-09-13 15:07:23 -04:00
Cole Robinson
91e2d502bb tests: Add test_ui target for dogtail UI tests, add an example 2015-09-09 14:26:50 -04:00
Cole Robinson
1237be9d1a virt-install: Clean up created disk images if VM creation fails
We are conservative here, only cleaning up disk images if libvirt
fails to even accept the XML. Otherwise the VM may already be
running or defined, and the user has to do some cleanup anyways.
2015-09-06 14:27:37 -04:00
Cole Robinson
4c361933ea tests: Have the property checker work on whole test suite
Not just xmlparse.py. So we can test a new property via clitest and
not always via xmlparse
2015-04-21 20:15:37 -04:00
Cole Robinson
ef5552d0aa configure: Add --default-hvs, kill --with-bhyve
Takes a comma separated list of HVs, and only shows those as options in
the 'Open Connection' wizard. This option can be used to hide the bhyve
option as well, so drop --with-bhyve
2015-04-06 16:29:28 -04:00
Cole Robinson
6ccbec6b30 setup: Give warning if installing schemas into non-/usr/share (bz 1122537) 2015-04-06 16:03:42 -04:00
Cole Robinson
a773a66a3f virtcli: Export config variables in a class object
Makes things easier to extend later
2015-04-06 15:54:35 -04:00
Cole Robinson
1e2f605e81 virtcli: Drop custom version handling
No one uses it, and it can be handled easy enough with a wrapper script or
similar.
Message-Id: <1b33f161591b86407f78fb307aa4f89f6eee9e4e.1428346382.git.crobinso@redhat.com>
2015-04-06 15:54:35 -04:00
Guido Günther
a41e2c6f5a Add conversion file to migrate GConf values to GSettings
This makes sure we don't lose already configured connections.

Reference: http://bugs.debian.org/740047
2014-09-29 08:56:14 -04:00
Cole Robinson
5aafe008bc Remove virt-image, as scheduled
As promised with the last release, remove virt-image. In 6 months I didn't
hear a peep from any actual users that cared.
2014-09-06 18:05:43 -04:00
Roman Bogorodskiy
613d933d31 setup: drop obsolete virtconv/parsers data_files
Commit 0b4a72f dropped virtconv/parsers/ files, so remove
them from data_files list in setup.py as well.
2014-07-12 16:08:08 -04:00
Roman Bogorodskiy
05df5a6484 Add bhyve support
Allow connection to bhyve using bhyve:///system URI. That is
disabled by default and could be enabled using the new
configure option 'with-bhyve'.
2014-04-11 15:52:31 -04:00
Cole Robinson
a398d245cb Clean up pylint integration
- Drop no longer needed disable= bits
- Use string names for all skipped pylint messages
2014-04-02 19:00:24 -04:00
Martin Kletzander
4196f4287b Use proper python version
since we work with python2 only, mentioning it in all shebangs make
the commands from git work even when python3 is set as default.

This also fixes one test where command being ran is 'virt-xml' through
subprocess.Popen().

While at that, add '-tt' where possible in order to make everyone use
same indentation characters.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-02-12 21:55:32 +01:00
Martin Kletzander
ab4fd40e96 pylint: Don't use space after 'print'
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-02-12 21:55:32 +01:00
Cole Robinson
35d06e668a setup: Add tests --regenerate-output
Static variable is too dangerous (notice I forgot to unset it with a
recent commit)
2014-02-03 15:55:20 -05:00
Cole Robinson
748ff1c4cc virt-xml: Initial commit, basic set of tests 2014-01-25 17:20:29 -05:00
Martin Kletzander
dc0b9bbaaf Rename hide_unsupported_rhel_options to stable_defaults and clean-up its usage
There were multiple problems with the setting and usage of
hide_unsupported_rhel_options.  Due to the fact that the option has
several diferent namings throughout the code, this patch is renaming
it to stable_defaults, which basically says what the option does and
makes it possible to use it without need for more than one negation
(where the old code had up to 4 of them in some places), which also
helps understanding it.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-01-21 17:13:18 +01:00
Chen Hanxiao
2427254ffe set cov as None if python-coverage not installed
If we didn't install python-coverage, we could not
run 'python setup.py test'.
This patch fixes this little bug.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-01-11 13:24:38 -05:00
Giuseppe Scrivano
0df75c7603 headers: update "Red Hat, Inc." copyright for the year 2013
Ensure that any file touched by a @redhat.com author in 2013 has an
updated copyright header.

The files were updated using the build-aux/update-copyright gnulib
script and manually added where the copyright line wasn't present.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-28 17:22:26 +01:00
Cole Robinson
e93a984377 setup: Store canonical configure defaults in virtcli 2013-10-02 18:50:01 -04:00
Cole Robinson
4f59c24b40 tests: Add test_initrd_inject command
This is a standalone test like test_urls, and requires interraction. It
pulls down a bunch of kernels from public URL trees, inject known
kickstarts that induce quick failure. User inspects the output to
ensure initrd inject is working as expected.
2013-09-28 16:50:08 -04:00
Cole Robinson
74a2ab5612 test_urls: Fix --path option 2013-09-26 18:32:50 -04:00
Cole Robinson
ff5b8d29e2 test_urls: Use multiple unittests, not a single big one 2013-09-26 11:49:16 -04:00
Cole Robinson
15eac4de59 tests: Fix and update test_urls 2013-09-25 19:36:15 -04:00
Cole Robinson
2148eaa2ae Distribute appdata xml (bz 1011120)
More info: http://people.freedesktop.org/~hughsient/appdata/
2013-09-24 08:38:12 -04:00
Cole Robinson
8aa3ba9b63 man: Fix a build error, misc improvements 2013-08-18 16:04:54 -04:00
Cole Robinson
d6f5c3a729 setup.py: Add test --only option
Allows running only tests that match the passed string.
2013-07-13 16:33:14 -04:00
Cole Robinson
351ff1ae57 tests: Add --coverage option to print a report 2013-07-02 17:37:45 -04:00
Cole Robinson
de1695b2a9 setup.py: Change default-graphics from spice->vnc
It's still changeable with 'configure', but this makes the unconfigured
default in line with what modern distros should use.
2013-05-27 18:51:12 -04:00
Cole Robinson
44f788bb99 setup.py: Fix sdist 2013-04-27 09:28:15 -04:00
Cole Robinson
d6d3d9e78c setup: Drop use of python-distutils-extra
The only bits were were using was the icon installation and
translation building, which amounted to about 70 lines of code.

Just steal it so we can avoid the dep which will cause trouble
for future RHEL.
2013-04-18 17:20:10 -04:00
Cole Robinson
f6f55314cb Remove virt-manager-tui
Was originally added with hopes for being used in an ovirt related
product, but was more or less a code dump, and the author has been
allocated to other things. He confirmed it's okay to remove.

That, and it's currently broken, and we've had approximately 0 user
feedback since it was committed.
2013-04-18 16:12:03 -04:00
Cole Robinson
7e23244096 Port from gconf to gsettings
This unfortunately has a decent amount of fallout: add a wrapper class
in config.py that reduces much of the churn.

Another big piece is that gsettings can't accept arbitrary paths like
gconf would, everything needs to be described in the schema.

Also do a bunch more RPM spec modernizing
2013-04-18 12:43:16 -04:00
Cole Robinson
1c51a39903 setup: Make it executable 2013-04-17 15:48:39 -04:00
Cole Robinson
52d9436c3b Fix up some pylint from previous patches 2013-04-17 15:14:52 -04:00
Gene Czarcinski
b8b1b6d4d4 add option for snapshot-id suffix to __version__
1.  The added suffix is in the form YYYYMMDD and that is all.

2.  Code is added to classes my_sdist and my_rpm to check if
a snapshot id is requested (--snapshot or -s) and, if
requested, to append the id to the value of cliconfig.__version__

3.  The added suffix only applies to the name of the sdist-tarball
and the rpm spec file it includes ... the "internal" version
remains unchanged.
.
Signed-off-by: Gene Czarcinski <gene@czarc.net>
2013-04-17 15:03:26 -04:00
Gene Czarcinski
fd8420ef1b add user setable version using configure
1. update setup.py-configure to add keyword pkgversion

2. If pkgversion is specified in cli.cfg, update __version__
with its value.
.
Signed-off-by: Gene Czarcinski <gene@czarc.net>
2013-04-17 15:03:21 -04:00
Gene Czarcinski
ad3f69e12d automate @VERSION@ in virt-manager.spec
This update renames virt-manager.spec to be
virt-manager.spec.in and changes the version-id to
@VERSION@ ... setup.py is modified to copy the
virt-manager-spec.in file to virt-manager.spec and
replace @VERSION@ with the current/actual version id.

.gitignore is updated to ignore virt-manager.spec
.
Signed-off-by: Gene Czarcinski <gene@czarc.net>
2013-04-17 15:02:58 -04:00
Cole Robinson
31b303f3b1 Remove unused Tui/importblacklist
We will solve the same problem with unittests
2013-04-15 14:18:33 -04:00
Cole Robinson
cdac966360 setup: Make 'install' work even if 'configure' wasn't run 2013-04-14 12:51:22 -04:00
Cole Robinson
1771f6a300 tests: Replace 'scriptimports' with a much simpler method 2013-04-13 15:38:53 -04:00
Cole Robinson
0d243983d0 Revive pep8 and clean up the code
autopep8 is pretty cool :)
2013-04-13 15:22:43 -04:00
Cole Robinson
fcc680cae1 Use an RC file for pylint
Will let use tweak things easier in the future
2013-04-13 15:22:29 -04:00
Cole Robinson
ae471007fc Tons of misc pylint fixes 2013-04-13 13:40:29 -04:00
Cole Robinson
d323fbbe23 pylint: Disable 'Use of property on old style class' warning
pylint can't handle the fact that our Gtk subclasses _are_ new
style classes.
2013-04-12 08:27:45 -04:00
Cole Robinson
aead0135b0 setup.py: Re-add 'pylint' subcommand
We drop our hacky shell wrappers, and just track it all in setup.py
2013-04-12 08:27:09 -04:00
Cole Robinson
3ef6e4d539 Fix wrapper scripts
Reported-by: Gene Czarcinski <gene@czarc.net>
2013-04-10 17:45:13 -04:00
Cole Robinson
ffb876e3a1 setup: Make sure non-/usr prefix works
Basically mandate that configure is passed a prefix, since we need this
info before the install process.
2013-04-10 17:45:13 -04:00
Gene Czarcinski
2a7a634df0 Install virtcli directory 2013-04-10 17:45:12 -04:00
Cole Robinson
dfaf00af4c Autogenerate POTFILES.in 2013-04-03 19:42:59 -04:00
Cole Robinson
3c251d3d8b Make RPM build work
And wire up man page creation
2013-04-03 19:40:39 -04:00
Cole Robinson
d6c8ad0297 Wire up python unit tests, unify gettext setup 2013-04-03 18:22:05 -04:00
Cole Robinson
9d05583c26 Remove autotools, replace with distutils-extra
Despite being a known quantity, autotools is so overkill for our needs,
so let's drop it and replace it with a much simpler and easy to customize
system.
2013-04-03 18:20:51 -04:00