| 8c95d0fc | 29-Jun-2021 |
John Snow <jsnow@redhat.com> |
python: update help text for check-tox
Move it up near the check-pipenv help text, and update it to suggest parity.
(At the time I first added it, I wasn't sure if I would be keeping it, but I've c
python: update help text for check-tox
Move it up near the check-pipenv help text, and update it to suggest parity.
(At the time I first added it, I wasn't sure if I would be keeping it, but I've come to appreciate it as it has actually helped uncover bugs I would not have noticed without it. It should stay.)
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Message-id: 20210629214323.1329806-9-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 6f84d726 | 29-Jun-2021 |
John Snow <jsnow@redhat.com> |
python: rename 'venv-check' target to 'check-pipenv'
Well, Cleber was right, this is a better name.
In preparation for adding a different kind of virtual environment check (One that simply uses whi
python: rename 'venv-check' target to 'check-pipenv'
Well, Cleber was right, this is a better name.
In preparation for adding a different kind of virtual environment check (One that simply uses whichever version of Python you happen to have), rename this test 'check-pipenv' so that it matches the CI job 'check-python-pipenv'.
Remove the "If you don't know which test to run" hint, because it's not actually likely you have Python 3.6 installed to be able to run the test. It's still the test I'd most prefer you to run, but it's not the test you are most likely to be able to run.
Rename the 'venv' target to 'pipenv' as well, and move the more pertinent help text under the 'check-pipenv' target.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Message-id: 20210629214323.1329806-8-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| d2ae9429 | 29-Jun-2021 |
John Snow <jsnow@redhat.com> |
python: Add no-install usage instructions
It's not encouraged, but it's legitimate to want to know how to do.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Willian Rampazzo <willianr@red
python: Add no-install usage instructions
It's not encouraged, but it's legitimate to want to know how to do.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Message-id: 20210629214323.1329806-7-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 4176dbd8 | 29-Jun-2021 |
John Snow <jsnow@redhat.com> |
python: README.rst touchups
Clarifying a few points; removing the reference to 'setuptools' because it isn't referenced anywhere else in this document and doesn't really provide any useful informati
python: README.rst touchups
Clarifying a few points; removing the reference to 'setuptools' because it isn't referenced anywhere else in this document and doesn't really provide any useful information to a Python newcomer.
Adjusting the language elsewhere to be less ambiguous and have fewer run-on sentences.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Message-id: 20210629214323.1329806-6-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 3afa3501 | 29-Jun-2021 |
John Snow <jsnow@redhat.com> |
python: Re-lock pipenv at *oldest* supported versions
tox is already testing the most recent versions. Let's use pipenv to test the oldest versions we claim to support. This matches the stylistic ch
python: Re-lock pipenv at *oldest* supported versions
tox is already testing the most recent versions. Let's use pipenv to test the oldest versions we claim to support. This matches the stylistic choice to have pipenv always test our oldest supported Python version, 3.6.
The effect of this is that the python-check-pipenv CI job on gitlab will now test against much older versions of these linters, which will help highlight incompatible changes that might otherwise go unnoticed.
Update instructions for adding and bumping versions in setup.cfg. The reason for deleting the line that gets added to Pipfile is largely just to avoid having the version minimums specified in multiple places in config checked into the tree.
(This patch was written by deleting Pipfile and Pipfile.lock, then explicitly installing each dependency manually at a specific version. Then, I restored the prior Pipfile and re-ran `pipenv lock --dev --keep-outdated` to re-add the qemu dependency back to the pipenv environment while keeping the "old" packages. It's annoying, yes, but I think the improvement to test coverage is worthwhile.)
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Message-id: 20210629214323.1329806-5-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 82e6517d | 29-Jun-2021 |
John Snow <jsnow@redhat.com> |
python: Remove global pylint suppressions
These suppressions only apply to a small handful of places. Instead of disabling them globally, disable them just in the cases where we need. The design of
python: Remove global pylint suppressions
These suppressions only apply to a small handful of places. Instead of disabling them globally, disable them just in the cases where we need. The design of the machine class grew quite organically with tons of constructor and class instance variables -- there's little chance of meaningfully refactoring it in the near term, so just suppress the warnings for that class.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Message-id: 20210629214323.1329806-4-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 7f179082 | 29-Jun-2021 |
John Snow <jsnow@redhat.com> |
python: expose typing information via PEP 561
https://www.python.org/dev/peps/pep-0561/#specification
Create 'py.typed' files in each subpackage that indicate to mypy that this is a typed module, s
python: expose typing information via PEP 561
https://www.python.org/dev/peps/pep-0561/#specification
Create 'py.typed' files in each subpackage that indicate to mypy that this is a typed module, so that users of any of these packages can use mypy to check their code as well.
Note: Theoretically it's possible to ditch MANIFEST.in in favor of using package_data in setup.cfg, but I genuinely could not figure out how to get it to include things from the *source root* into the *package root*; only how to include things from each subpackage. I tried!
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Message-id: 20210629214323.1329806-3-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 00376d13 | 29-Jun-2021 |
John Snow <jsnow@redhat.com> |
python/qom: Do not use 'err' name at module scope
Pylint updated to 2.9.0 upstream, adding new warnings for things that re-use the 'err' variable. Luckily, this only breaks the python-check-tox job,
python/qom: Do not use 'err' name at module scope
Pylint updated to 2.9.0 upstream, adding new warnings for things that re-use the 'err' variable. Luckily, this only breaks the python-check-tox job, which is allowed to fail as a warning.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Message-id: 20210629214323.1329806-2-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 957f3c5c | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
python: add qmp-shell entry point
now 'qmp-shell' should be available from the command line when installing the python package.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 2021060720064
python: add qmp-shell entry point
now 'qmp-shell' should be available from the command line when installing the python package.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-42-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 6be7206e | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: move to python/qemu/qmp/qmp_shell.py
The script will be unavailable for a commit or two, which will help preserve development history attached to the new file. A forwarder will be
scripts/qmp-shell: move to python/qemu/qmp/qmp_shell.py
The script will be unavailable for a commit or two, which will help preserve development history attached to the new file. A forwarder will be added shortly afterwards.
With qmp_shell in the python qemu.qmp package, now it is fully type checked, linted, etc. via the Python CI. It will be quite a bit harder to accidentally break it again in the future.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-41-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| eac8aabc | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
python/qmp: return generic type from context manager
__enter__ can be invoked from a subclass, so it needs a more flexible type.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 202106072006
python/qmp: return generic type from context manager
__enter__ can be invoked from a subclass, so it needs a more flexible type.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-31-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 1acde763 | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
python/qmp: add QMPObject type alias
This is meant to represent any generic object seen in a QMPMessage, not just the root object itself.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 202
python/qmp: add QMPObject type alias
This is meant to represent any generic object seen in a QMPMessage, not just the root object itself.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-27-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 7e7c2a0d | 04-Jun-2021 |
John Snow <jsnow@redhat.com> |
python/qemu-ga-client: add entry point
Remove the shebang, and add a package-defined entry point instead. Now, it can be accessed using 'qemu-ga-client' from the command line after installing the pa
python/qemu-ga-client: add entry point
Remove the shebang, and add a package-defined entry point instead. Now, it can be accessed using 'qemu-ga-client' from the command line after installing the package.
The next commit adds a forwarder shim that allows the running of this script without needing to install the package again.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210604155532.1499282-11-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 1e129afc | 04-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qemu-ga-client: move to python/qemu/qmp/qemu_ga_client.py
The script itself will be unavailable for a few commits before being restored, with no way to run it right after this commit. This h
scripts/qemu-ga-client: move to python/qemu/qmp/qemu_ga_client.py
The script itself will be unavailable for a few commits before being restored, with no way to run it right after this commit. This helps move git history into the new file. To prevent linter regressions, though, we do need to immediately touch up the filename to remove dashes (to make the module importable), and remove the executable bit.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210604155532.1499282-10-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 1f639939 | 04-Jun-2021 |
John Snow <jsnow@redhat.com> |
python/qmp: Correct type of QMPReturnValue
It's only a Dict[str, Any] most of the time. It's not actually guaranteed to be anything in particular. Fix this type to be more accurate to the reality we
python/qmp: Correct type of QMPReturnValue
It's only a Dict[str, Any] most of the time. It's not actually guaranteed to be anything in particular. Fix this type to be more accurate to the reality we live in.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210604155532.1499282-8-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 176c5490 | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
python/qmp: add fuse command to 'qom' tools
The 'fuse' command will be unavailable if 'fusepy' is not installed. It will simply not load and subsequently be unavailable as a subcommand.
Signed-off-
python/qmp: add fuse command to 'qom' tools
The 'fuse' command will be unavailable if 'fusepy' is not installed. It will simply not load and subsequently be unavailable as a subcommand.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20210603003719.1321369-20-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 173d185d | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qom-fuse: move to python/qemu/qmp/qom_fuse.py
Move qom-fuse over to the python package now that it passes the linter. Update the import paradigms so that it continues to pass in the context
scripts/qom-fuse: move to python/qemu/qmp/qom_fuse.py
Move qom-fuse over to the python package now that it passes the linter. Update the import paradigms so that it continues to pass in the context of the Python package.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210603003719.1321369-18-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| c63f3b0b | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
python: add optional FUSE dependencies
In preparation for moving qom-fuse over to the python package, we need some new dependencies to support it.
Add an optional 'fusepy' dependency that users of
python: add optional FUSE dependencies
In preparation for moving qom-fuse over to the python package, we need some new dependencies to support it.
Add an optional 'fusepy' dependency that users of the package can opt into with e.g. "pip install qemu[fuse]" which installs the requirements necessary to obtain the additional functionality.
Add the same fusepy dependency to the 'devel' extras group -- unfortunately I do not see a way for optional groups to imply other optional groups at present, so the dependency is repeated. The development group needs to include the full set of dependencies for the purpose of static analysis of all features offered by this library.
Lastly, add the [fuse] extras group to tox's configuration as a workaround so that if a stale tox environment is found when running `make check-tox`, tox will know to rebuild its environments.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210603003719.1321369-17-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 30ec845c | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qom-fuse: add static type hints
Because fusepy does not have type hints, add some targeted warning suppressions.
Namely, we need to allow subclassing something of an unknown type (in qom_fu
scripts/qom-fuse: add static type hints
Because fusepy does not have type hints, add some targeted warning suppressions.
Namely, we need to allow subclassing something of an unknown type (in qom_fuse.py), and we need to allow missing imports (recorded against fuse itself) because mypy will be unable to import fusepy (even when installed) as it has no types nor type stubs available.
Note: Until now, it was possible to run invocations like 'mypy qemu/' from ./python and have that work. However, these targeted suppressions require that you run 'mypy -p qemu/' instead. The correct, canonical invocation is recorded in ./python/tests/mypy.sh and all of the various CI invocations always use this correct form.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210603003719.1321369-16-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| d229f1c8 | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
python: Add 'fh' to known-good variable names
fd and fh are fine: we often use these for "file descriptor" or "file handle" accordingly. It is rarely the case that you need to enforce a more semanti
python: Add 'fh' to known-good variable names
fd and fh are fine: we often use these for "file descriptor" or "file handle" accordingly. It is rarely the case that you need to enforce a more semantically meaningful name beyond "This is the file we are using right now."
While we're here: add comments for all of the non-standard pylint names. (And the underscore.)
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210603003719.1321369-10-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 7c4c595f | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
python/qmp: add qom script entry points
Add the 'qom', 'qom-set', 'qom-get', 'qom-list', and 'qom-tree' scripts to the qemu.qmp package. When you install this package, these scripts will become avai
python/qmp: add qom script entry points
Add the 'qom', 'qom-set', 'qom-get', 'qom-list', and 'qom-tree' scripts to the qemu.qmp package. When you install this package, these scripts will become available on your command line.
(e.g. when inside of a venv, `cd python && pip install .` will add 'qom', 'qom-set', etc to your $PATH.)
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20210603003719.1321369-6-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| c750c028 | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
python/qmp: Add qom script rewrites
Inspired by qom-set, qom-get, qom-tree and qom-list; combine all four of those scripts into a single script.
A later addition of qom-fuse as an 'extension' neces
python/qmp: Add qom script rewrites
Inspired by qom-set, qom-get, qom-tree and qom-list; combine all four of those scripts into a single script.
A later addition of qom-fuse as an 'extension' necessitates that some common features are split out and shared between them.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210603003719.1321369-5-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 587adaca | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
python/qmp: add parse_address classmethod
This takes the place of qmp-shell's __get_address function. It also allows other utilities to share the same parser and syntax for specifying QMP locations.
python/qmp: add parse_address classmethod
This takes the place of qmp-shell's __get_address function. It also allows other utilities to share the same parser and syntax for specifying QMP locations.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210603003719.1321369-4-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 5d15c9b8 | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
python/qmp: Fix type of SocketAddrT
In porting the qom tools, qmp-shell, etc; it becomes evident that this type is wrong.
This is an integer, not a string. We didn't catch this before because none
python/qmp: Fix type of SocketAddrT
In porting the qom tools, qmp-shell, etc; it becomes evident that this type is wrong.
This is an integer, not a string. We didn't catch this before because none of QEMUMonitorProtocol's *users* happen to be checked, and the internal logic of this class is otherwise self-consistent. Additionally, mypy was not introspecting into the socket() interface to realize we were passing a bad type for AF_INET. Fixed now.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20210603003719.1321369-3-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 9d0ead63 | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
python/pipenv: Update Pipfile.lock
In a previous commit, I added tox to the development requirements of the Python library. I never bothered to add them to the Pipfile, because they aren't needed th
python/pipenv: Update Pipfile.lock
In a previous commit, I added tox to the development requirements of the Python library. I never bothered to add them to the Pipfile, because they aren't needed there. Here, I sync it anyway in its own commit so that when we add new packages later that the diffstats will not confusingly appear to pull in lots of extra packages.
Ideally I could tell Pipenv simply not to install these, but it doesn't seem to support that, exactly. The alternative is removing Tox from the development requires, which I'd rather not do.
The other alternative is re-specifying all of the dependencies of setup.cfg in the Pipfile, which I'd also rather not do.
Picking what feels least-worst here.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210603003719.1321369-2-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|