Commit Graph

111 Commits

Author SHA1 Message Date
Cole Robinson
1d256bccd0 setup: Use smarter py file searching 2019-06-17 00:12:31 -04:00
Cole Robinson
44cf01cee1 setup: Fix test_urls coverage testing
And exclude some error handling
2019-06-16 14:41:54 -04:00
Cole Robinson
ab7b3c189f Move virtcli/cliconfig.py to virtinst/buildconfig.py
There's really no reason for the split, just contain it all
within virtinst for simplicity
2019-06-14 17:12:19 -04:00
Cole Robinson
361657ad15 virtinst: Add a lot of test code coverage
* Delete dead code
* Add tests for various device default code paths
* Rework certain conditions a bit so code coverage always hits them
2019-06-09 18:59:50 -04:00
Cole Robinson
ae06ed7aaa setup: Omit progress.py from coverage output
Since it's copied code that we rarely touch
2019-06-09 11:36:07 -04:00
Cole Robinson
d50187e65c setup: Make codespell an optional part of the 'pylint' target 2019-05-16 14:43:31 -04:00
Cole Robinson
3be238b03e tests: test_urls: Add --*libosinfo, --iso-only, --url-only
These are options that will help tweak the test_urls logic,
to help as we try to ensure libosinfo covers all the cases
we care about.
2019-03-24 12:32:03 -04:00
Cole Robinson
4b54b281b9 setup: Remove vestiges of test_urls --path option 2019-02-03 12:05:18 -05:00
Cole Robinson
a9f818b44b pycodestyle: Only use format=pylint from setup.py
Don't force it on users who are running the tool manually
2019-01-30 17:25:14 -05:00
Cole Robinson
8502b84dbd Move tests.pycodestyle.cfg to setup.cfg
This makes manual pycodestyle calls pick up our project config
2019-01-30 17:25:14 -05:00
Cole Robinson
90603cdc6e Move tests/pylint.cfg to pylintrc
This makes manual pylint calls pick up our project config
2019-01-30 17:25:14 -05:00
Cole Robinson
73f07c54ee setup: Generate bashcompletion files in builddir 2018-12-18 14:23:01 -05:00
Lin Ma
a2850f345b setup.py: Install the bash completion files
Signed-off-by: Lin Ma <lma@suse.com>
2018-12-18 11:20:35 -05:00
Radostin Stoyanov
5b1f6ad2b8 pylint: Don't exclude progress.py
Currently progress.py file was excluded from pylint/pycodestyle check
because the code was straight from python-urlgrabber and it was not
PEP8 compliant. The following patched resolve the code style issues.

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-11-12 08:34:55 -05:00
Cole Robinson
88cacb0295 setup: Remove configure --openssh-askpass
For one, we don't offer to install it anymore because we dropped
packagekit stuff. But even having a single package here isn't
really the whole story because different desktops have their
own askpass providers, like Fedora has openssh-askpass for GNOME,
but ksshaskpass for KDE

So drop it all, make the error more generic, and point people
to setting up SSH keys too
2018-10-08 13:59:13 -04:00
Cole Robinson
f1d169ad7b setup: Remove configure --{libvirt,kvm}-package-names
This was really only useful with packagekit integration, which
is now gone
2018-10-07 14:27:20 -04:00
Cole Robinson
7eaf036acf virtinst: Remove stable_defaults concept
This switch says: if we detect a rhel host, use special version
checks that match rhel backports. This pattern sucks. The way
forward is to have libvirt advertise the bits that are supported,
through domcapabilities. Then virt-manager/virtinst can react
as appropriate.
2018-10-06 19:45:51 -04:00
Cole Robinson
c9f0641700 cliconfig: Remove --preferred-distros
It's less relevant with our new search based OS list
2018-10-06 12:33:15 -04:00
Cole Robinson
e6738d9827 cliconfig: Remove --default-qemu-user
Libvirt has given us this info in capabilities for a long time,
this shouldn't matter anymore
2018-10-06 12:30:59 -04:00
Radostin Stoyanov
bb06053a8a setup: Integrate codespell
Codespell is a tool for checking misspelled words in source code [1].
Integrating this tool will enable automated spell check of the code
base.

Usage example:
        ./setup.py codespell

[1] https://github.com/codespell-project/codespell

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-06-05 14:27:29 -04:00
Luca Weiss
e9ba30a255 setup: Install files in new virtinst folders
In commits fe9ed23 and 3909c10 several files were moved to subfolder of
virtinst, but they are not covered by the existing glob in the setup.py
file. Fix that by adding those subfolders explicitely.
2018-04-12 10:15:51 +02:00
Daniel P. Berrangé
48e32b429d Fix copyright header to specify GPLv2 or later, not GPLv2 only.
The copyright headers in every file were chjanged in this previous commit

  commit b6dcee8eb7
  Author: Cole Robinson <crobinso@redhat.com>
  Date:   Tue Mar 20 15:00:02 2018 -0400

    Use consistent and minimal license header for every file

Where before this they said "

  "either version 2 of the License, or (at your option) any later version."

Now they just say

  "GNU GPLv2"

This fixes it to say "GNU GPLv2 or later" again.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-04 16:51:37 -04:00
Cole Robinson
bd891eb380 virtcli: Add python3 version check
Assume 3.4 is needed, we may support earlier but I doubt anyone
is going to get all the deps in place on a distro that old
2018-03-21 18:00:38 -04:00
Cole Robinson
b6dcee8eb7 Use consistent and minimal license header for every file 2018-03-21 07:29:40 -04:00
Cole Robinson
465b04ea18 Remove gconf->gsettings conversion script
It was first released with v1.2.0 in May 2015. I think that's long
enough for people to have run the app and had their settings
converted.
2018-03-16 14:41:53 -04:00
Radostin Stoyanov
a52c282ed3 pycodestyle: Use module instead of executable
The `pycodestyle-3` executable is provided by the
`python3-pycodestyle` rpm package.
On Debian the corresponding executable is called `pycodestyle3`.
Arch Linux uses Python 3 by default and `python2-pycodestyle`
package is used for the py2 version.

To get around this inconsistency, import the `pycodestyle` module and
call the corresponding methods. The implementation has similar
behaviour to what happens when `pycodestyle` [1] is executed from the
command-line.

[1] https://github.com/PyCQA/pycodestyle/blob/master/pycodestyle.py

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-03-03 16:04:18 -05:00
Radostin Stoyanov
4f7bc4f4e6 pylint: Use pylint.lint module
The `pylint-3` executable is provided by the python3-pylint rpm
package on Fedora.
For Debian the equivalent is `pylint3`.
On Arch Linux the default version of Python is 3.

Pylint lints for the version of Python it is running. Instead of
spawning an executable, import the `pylint.lint` module and call
`Run()`.

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-03-03 15:59:05 -05:00
Cole Robinson
47afa912b3 setup: tests: Add --testverbose option
Can't use --verbose because it conflicts with setuptools options
2018-02-22 15:18:47 -05:00
Cole Robinson
c05cd52772 setup: Use CLIState for setting --debug value 2018-02-22 15:18:47 -05:00
Cole Robinson
4205272384 tests: Add explicit test_dist target
Things like po validation don't need to be done on every test run
2018-02-20 12:33:57 -05:00
Cole Robinson
1302156265 setup: Add explicit error if running with python2 2018-02-16 12:37:54 -05:00
Cole Robinson
de791136c1 setup: Use pylint-3 2018-02-06 19:02:53 -05:00
Cole Robinson
ddba9c1702 Switch to python3 in script shebang
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2018-02-06 18:56:15 -05:00
Cole Robinson
4b4f532417 uitests: Wire up --coverage
Need to launch the external coverage process to actually measure
things
2018-01-09 13:51:53 -05:00
Cole Robinson
044d93d471 tests: Rework how we pass command line objects down to test data 2018-01-08 17:05:55 -05:00
Cole Robinson
89945118df uitests: Make unittest.installHandler work as expected
And ctrl-c exiting in general.
2018-01-08 09:21:42 -05:00
Cole Robinson
cf165241a1 tests: Force verbose mode for UI tests 2018-01-08 09:21:42 -05:00
Cole Robinson
6009044463 tests: Don't always generate coverage data
We were doing this unconditionally, and on my laptop it seems to be
responsible for about 20% of the runtime... whoops!
2018-01-08 09:21:42 -05:00
Cole Robinson
c727db2380 tests: Drop --skipcli option
cli tests are much faster nowadays, this option isn't all that useful
2018-01-06 14:04:34 -05:00
Cole Robinson
c7ed34de63 tests: test_urls: Big rework
Move all the test cases to an .ini file. Various cleanups and
minor improvements throughout
2018-01-06 14:04:34 -05:00
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