update setup.py usage and docs to meson

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2024-10-25 14:48:27 +02:00 committed by Pavel Hrdina
parent 31cb321909
commit cbd2a7ef92
3 changed files with 9 additions and 19 deletions

View File

@ -34,8 +34,7 @@ it by running the latest code using the steps above.
The following commands will be useful for anyone writing patches: The following commands will be useful for anyone writing patches:
```sh ```sh
pytest # Run local unit test suite meson test -C build
./setup.py pylint # Run pylint/pycodestyle checking
``` ```
Any patches shouldn't change the output of 'pytest' or 'pylint'. Depending Any patches shouldn't change the output of 'pytest' or 'pylint'. Depending
@ -43,8 +42,9 @@ on what version of libvirt or pylint is installed, you may see some
pre-existing errors from these commands. The important thing is that pre-existing errors from these commands. The important thing is that
any changes you make do not add additional errors. any changes you make do not add additional errors.
The 'pylint' command requires [`pylint`](https://github.com/PyCQA/pylint) The 'test' command requires [`pylint`](https://github.com/PyCQA/pylint),
and [`pycodestyle`](https://github.com/pycqa/pycodestyle) to be installed. [`pycodestyle`](https://github.com/pycqa/pycodestyle) and
['pytest'](https://github.com/pytest-dev/pytest/) to be installed.
If [`codespell`](https://github.com/codespell-project/codespell) is installed, If [`codespell`](https://github.com/codespell-project/codespell) is installed,
it will be invoked as well. it will be invoked as well.

View File

@ -11,20 +11,10 @@ For more details on that, see [CONTRIBUTING.md](CONTRIBUTING.md)
To install the software into `/usr/local` (usually), you can do: To install the software into `/usr/local` (usually), you can do:
```sh ```sh
./setup.py install meson setup build
meson install -C build
``` ```
To build an RPM, you can run:
```sh
./setup.py rpm
```
`setup.py` generally has all the build and install commands, for more info see:
- `./setup.py --help-commands`
- `./setup.py install --help`
- [Python Standard Build and Install](https://docs.python.org/3/install/#standard-build-and-install)
## Pre-requisite software ## Pre-requisite software

View File

@ -34,14 +34,14 @@ def test_validate_po_files():
def test_validate_pot_strings(): def test_validate_pot_strings():
""" """
Validate that xgettext via `setup.py extract_messages` don't print Validate that xgettext via don't print any warnings.
any warnings
""" """
potfile = "po/virt-manager.pot" potfile = "po/virt-manager.pot"
origpot = open(potfile).read() origpot = open(potfile).read()
try: try:
subprocess.run(["meson", "setup", "build"], check=True)
out = subprocess.check_output( out = subprocess.check_output(
["./setup.py", "extract_messages"], ["meson", "compile", "-C", "build", "virt-manager-pot"],
stderr=subprocess.STDOUT) stderr=subprocess.STDOUT)
warnings = [l for l in out.decode("utf-8").splitlines() warnings = [l for l in out.decode("utf-8").splitlines()
if "warning:" in l] if "warning:" in l]