Commit Graph

149 Commits

Author SHA1 Message Date
Cole Robinson
65d568ebf9 Scrub references to virt-tools-list
* Remove .gitpublish, we only use github for patches now
* Drop author* fields entirely from setuptools, that seems fine.
* Drop other references

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-09-06 15:10:04 -04:00
Cole Robinson
29145b9e93 Fix some pylint
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-26 11:36:01 -04:00
Pino Toscano
231a3dbc87 build: use setuptools.command.build when available
Setuptools 62.4.0 adds setuptools.command.build to transparently replace
the old distutils equivalent; hence, use it when available to fully
switch away from distutils.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2024-04-07 14:29:48 -04:00
Pino Toscano
4f4e73d017 build: use super()
... rather than explicitly calling the parent class; this will make
further changes easier.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2024-04-07 14:29:48 -04:00
Cole Robinson
0d3b7f673f Fix pylint 3.1.0 issues
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-03-03 10:43:30 -05:00
Cole Robinson
6710ca6969 setup: Allow pylint -j0
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-02-14 12:34:27 -05:00
Cole Robinson
bb1afaba29 Fix pylint/pycodestyle warnings with latest versions
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-12-13 11:23:45 -05:00
Miro Hrončok
90e13549b4 Fix build with setuptools 61+
+ ./setup.py configure --default-hvs qemu,xen,lxc
    error: Multiple top-level packages discovered in a flat-layout: ['po', 'ui', 'man', 'data', 'virtinst', 'virtManager'].
    To avoid accidental inclusion of unwanted files or directories,
    setuptools will not proceed with this build.
    If you are trying to create a single distribution with multiple packages
    on purpose, you should not rely on automatic discovery.
    Instead, consider the following options:
    1. set up custom discovery (`find` directive with `include` or `exclude`)
    2. use a `src-layout`
    3. explicitly set `py_modules` or `packages` with a list of names
    To find more information, look for "package discovery" on setuptools docs.

Downstream bug report: https://bugzilla.redhat.com/2113754
2022-08-02 12:05:39 -04:00
Ryan Schmidt
49c2e046a1 Install before updating cache & compiling schemas
Closes #400
2022-06-13 15:18:19 -04:00
Peter Alfredsen
46dc061630 setup: add bits for setuptools-61
Quoting https://github.com/pypa/setuptools/issues/3227
"Setuptools >= 61, intentionally changes the way packages are built in the
 sensec that it will try to find files and fail if something is weird.

 Empty packages (like this one), are asked to explicitly add packages=[]
 to their configuration.

 This intentional change in behaviour is described in
 https://setuptools.pypa.io/en/latest/history.html#v61-0-0."

Bug: https://bugs.gentoo.org/836645
Signed-off-by: Peter Alfredsen <crabbedhaloablution@icloud.com>
2022-04-13 08:35:40 -04:00
Cole Robinson
7ee01c7eeb setup: Plan for newer setuptools providing distutils back compat
setuptools still doesn't natively provide some infrastructure we
need, but newer versions will keep 'import distutils' working until
those issues are addressed. I think we need to reorder imports to take
advantage of it though. It silences some deprecation warnings at
least

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-27 10:19:43 -05:00
Cole Robinson
758eb74ba3 Replace deprecated imp usage with importlib
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-10-04 16:04:44 -04:00
Cole Robinson
27525f4bab pylint: More attempts to silence gi warnings with -j option
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-07-29 11:45:06 -04:00
Cole Robinson
12d40bdf62 setup: Mostly convert to setuptools
distutils is slated for removal in python3 eventually:
https://www.python.org/dev/peps/pep-0632/

Mostly switch to setuptools. There's still an issue with the way
that we extend the 'build' command that doesn't seem to have a
setuptools equivalent, but we can hack around it if needed.

Closes: #252

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-05-23 14:23:59 -04:00
Cole Robinson
5b93a43622 pylint: Make sure we lint against Gtk3
We need to pass virtmanager.py to pylint first, so it detects
the require_version() call

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-04-06 18:28:48 -04:00
Cole Robinson
65a39a7495 man: Convert .pod files to .rst
Used pod2rst for the initial conversion but a lot of manual fixup
afterwards.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-13 09:58:39 -04:00
Cole Robinson
c01fbcc885 Rename pylintrc -> .pylintrc
Plain pylint calls pick that up as well

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 16:00:32 -04:00
Cole Robinson
62e7f1c521 spec: Move virt-manager.spec.in -> virt-manager.spec
Drop the VERSION templating. Tools today like packit and tito
work best when a working .spec file exists. The extra burden is
we need to update the version at release time, but that's no
big deal

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 16:00:32 -04:00
Cole Robinson
b9dfd92bf0 setup: Force 'rpm' to output to the git dir
And modernize it to use subprocess and report error output

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 16:00:32 -04:00
Cole Robinson
4226a4c1d5 setup: Kill old test_* command infrastructure
pytest invocations are now preferred. Leave plain `./setup.py test`
as a stub that errors and points to pytest.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 16:00:32 -04:00
Cole Robinson
e9b3ed509f tests: Add pytest conftest.py
Makes 'pytest' and 'pytest --cov' work for the standard tests.
uitests run with `pytest --uitests --cov=virtManager`.
test_urls.py, test_dist.py, test_inject.py need to be invoked like

pytest $PATH

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 14:57:03 -04:00
Cole Robinson
35bfdc26a6 setup: Use xgettext --add-comments=translators
So in the code we can prefix comments with 'translators:' before
translated strings to have them show up in .pot file output

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-11 19:18:38 -04:00
Cole Robinson
14f8d2ff7a setup: Tweak extract_messages
* Use long xgettext options
* Truncate .pot file upfront so every call uses --join-existing

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-11 19:18:38 -04:00
Pino Toscano
61b75ba0fb Handle AppStream files using gettext
Starting from version 0.19.6, gettext has native capabilities to extract
from, and merge back translations in AppStream files.

Hence, use xgettext to extract messages, and msgfmt to create AppStream
files with translations; because of this, there no more need to prefix
with underscore the tags to be translated.

Update the gettext required version in INSTALL.md.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-11 14:59:56 -04:00
Pino Toscano
33d8bc9ae2 Handle desktop files using gettext
Starting from version 0.19, gettext has native capabilities to extract
from, and merge back translations in desktop files.

Hence, use xgettext to extract messages, and msgfmt to create a desktop
file with translations; because of this, there no more need to prefix
with underscore the keys to be translated.

Update the gettext required version in INSTALL.md.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-11 14:59:56 -04:00
Pino Toscano
a1f0e07cd9 setup: use msgmerge for updating translations
Switch from intltool to msgmerge to merge the translations to the
catalog, as it is much easier.

Remove the writing of the temporary POTFILES.in, as it is no more needed
now.

Also, since now gettext is used at installation time:
- mention the gettext requirement in INSTALL.md
- add the gettext BuildRequires in the RPM spec file

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-11 14:59:56 -04:00
Pino Toscano
d306d7ef7c setup: add a extract_messages command
Add a separate command to extract the messages; this also changes the
way messages are extracted:
- keep using intltool for desktop and AppStream files
- use xgettext directly for Python sources, and UI files; this is way
  more flexible than intltool

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-11 14:59:56 -04:00
Pino Toscano
fdc902e461 setup: split listing of .in sources for POTFILES
Extract them from _generate_potfiles_in() to an own
_generate_meta_potfiles_in() function.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-11 14:59:56 -04:00
Cole Robinson
01ccaf03be setup: Run codespell on more files
And fix the results

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-28 14:31:28 -05:00
Cole Robinson
3440d8c59d urlfetcher: move mock code to the testsuite
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 13:08:12 -05:00
Cole Robinson
49d16912c3 setup: Skip coverage report when tests are aborted or skipped
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 06:57:37 -05:00
Cole Robinson
e784376699 tests: Rename all test files to have test_ prefix
This will help for a possible future conversion to pytest

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 06:57:37 -05:00
Cole Robinson
78c8aef75e tests: Move all data directories to data/
This cleans up the file hierarchy a bit

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 06:57:37 -05:00
Cole Robinson
8fe0a208db Move virt-* code into their modules
This layout is closer to what most python modules have nowadays.
It also simplifies testing and static analysis setup.

Keep virt-* wrappers locally, for ease of running these commands
from a git checkout.

Adjust the wrapper binaries we install on via packaging to be
pure python, which makes things like running gdb easier.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 18:27:20 -05:00
Cole Robinson
ee9f93074b Remove virt-convert
This was raised here:
https://www.redhat.com/archives/virt-tools-list/2019-June/msg00117.html

Quoting from that:

"""
virt-convert takes an ovf/ova or vmx file and spits
out libvirt XML. It started as a code drop a long time ago that could
translate back and forth between vmx, ovf, and virt-image, a long dead
appliance format. In 2014 I converted it to do vmx -> libvirt and ovf ->
libvirt which was a CLI breaking change, but I never heard a peep of a
complaint. It doesn't seem to do a particularly thorough job at its
intended goal, I've seen 2-3 bug reports in the past 5 years and
generally it doesn't seem to have any users. Let's kill it. If anyone
has the desire to keep it alive it could live as a separate project
that's a wrapper around virt-install but there's no compelling reason to
keep it in virt-manager.git IMO
"""

Nothing has changed since then, so here is the removal.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-24 17:04:29 -05:00
Pino Toscano
9b7c819c64 Install the AppStream file to the canonical location
The canonical location for AppStream XML files has been changed to
/usr/share/metainfo four years ago at least, with /usr/share/appdata
left as legacy location. It is time to switch to the right location.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-01-14 12:40:44 -05:00
Cole Robinson
c92693a276 setup: Remove dep on importing virtinst
Import BuildConfig directly from the source file using import hackery.
buildconfig.py is independent of virtinst code so it already does
the right thing. Add some checking to make sure this doesn't regress
in the future.

Drop the now unneeded RPM deps.
2019-06-17 13:18:50 -04:00
Cole Robinson
5ef458a428 setup: Undo previous file search changes
They were totally busted
2019-06-17 01:27:08 -04:00
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