summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Post-release version bump to 7.0.0Jiri Denemark2020-12-011-1/+1
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* MANIFEST.in: Distribute MANIFEST.in in the source tarballv6.10.0Erik Skultety2020-11-271-0/+1
| | | | | | | | | | Follow the same procedure as we do with specfiles in the main library where we distribute libvirt.spec.in along with the generated libvirt.spec inside the tarball. Fixes: https://gitlab.com/libvirt/libvirt-python/-/issues/5 Signed-off-by: Erik Skultety <eskultet@redhat.com>
* Implement virDomainAuthorizedSSHKeys{Get,Set}Michal Privoznik2020-11-193-0/+113
| | | | | | | | Both APIs work with string lists (the getter returns it, the setter gets keys to set from it) -> represent that as a python list. The rest is kept as is in C. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* Add support for memory failure event callbacksDaniel P. Berrangé2020-11-123-0/+75
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Replace deprecated PyEval_CallObject with PyObject_CallDaniel P. Berrangé2020-11-121-8/+8
| | | | | | | The former is deprecated since Python 3.9, and the latter has existed for all 3.x and probably before. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Pass -Werror when building extensionDaniel P. Berrangé2020-11-121-0/+2
| | | | | | | This ensures we pick up warnings from new python headers or other problems. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Avoid truncating python version number when running sanity testDaniel P. Berrangé2020-11-121-1/+3
| | | | | | | The current code assumes the version number string will be only three characters long, which fails with "3.10". Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Avoid use of thread function deprecated in 3.9Daniel P. Berrangé2020-11-121-4/+24
| | | | | | | | PyEval_ThreadsInitialized was deprecated in 3.9, with deletion targetted for 3.11. Furthermore since 3.7 it is guaranteed that threads are always initialized by Py_Initialize(), so checking it is redundant. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Add unit tests for openAuth methodDaniel P. Berrangé2020-11-061-0/+76
| | | | | | Validate that the type hinting is working as expected Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Post-release version bump to 6.10.0Jiri Denemark2020-11-021-1/+1
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* gitlab: optimize CI job dependenciesv6.9.0Daniel P. Berrangé2020-10-061-0/+25
| | | | | | Allow more parallelization by giving explicit dependencies between jobs. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* tests: start basic unit tests for more APIsDaniel P. Berrangé2020-10-067-0/+109
| | | | | | | | | | | To prevent regressions, especially with generated code, we need to have test coverage of more APIs. This starts off with coverage for object creation for all object types supported by the test driver currently. This exercises constructors which have been broken several times in the past. Related https://gitlab.com/libvirt/libvirt-python/-/issues/4 Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* fix constructor param name for virDomainSnapshot / virDomainCheckpointDaniel P. Berrangé2020-10-061-1/+1
| | | | | | | Fixes 7f021c21d6a091ca33615852d6061e75b2500f3f Resolves https://gitlab.com/libvirt/libvirt-python/-/issues/4 Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Post-release version bump to 6.9.0Jiri Denemark2020-10-011-1/+1
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* generator: Work around type changev6.8.0Philipp Hahn2020-09-011-3/+2
| | | | | | | a variable should not change its type. Signed-off-by: Philipp Hahn <hahn@univention.de> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* generator: Add PEP 484 type annotationsPhilipp Hahn2020-09-011-49/+55
| | | | Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Merge common code of print_function_wrapperPhilipp Hahn2020-09-011-20/+15
| | | | Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Merge code for __init__ genrationPhilipp Hahn2020-09-011-11/+5
| | | | Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Expand tuple to names in for loopPhilipp Hahn2020-09-011-4/+2
| | | | | | Assign tuple to multiple loop variables for better readability Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: break lines in generated codePhilipp Hahn2020-09-011-14/+28
| | | | | | | to be closes to pep8 which makes reading the generated code easier and reduces the number of issues found by flake8. Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Use empty string instead of NonePhilipp Hahn2020-09-011-14/+14
| | | | | | for better type checking: both are bool()==False, but None is not str. Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Convert to defaultdict()Philipp Hahn2020-09-011-20/+7
| | | | | | | | for nested dictionaries allows to remove the case distinction for "first" from "all other" cases. Signed-off-by: Philipp Hahn <hahn@univention.de> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* generator: Move funcs_failed into buildStubs()Philipp Hahn2020-09-011-7/+1
| | | | | | The variables are local to that funcion Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Convert list() to set()Philipp Hahn2020-09-011-23/+24
| | | | | | | tuple() and list() are sequences, while dict() and set() are hash-based, which is more efficient for contains(). Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Convert dict() to set()Philipp Hahn2020-09-011-24/+24
| | | | | | Python has a native type for set()s. Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Simplify boolean conditionPhilipp Hahn2020-09-011-15/+15
| | | | | | no need to compare with None or empty string. Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Simplify loop breakPhilipp Hahn2020-09-011-8/+4
| | | | Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Simplify sortingPhilipp Hahn2020-09-011-15/+6
| | | | | | Use sorted(..., key=...) instead of using explicit list.sort() Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Fixed writing cached=NonePhilipp Hahn2020-09-011-1/+1
| | | | Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Store arguments and return as tuplePhilipp Hahn2020-09-011-63/+67
| | | | | | instead of list. Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Expand tuple to names in for loopPhilipp Hahn2020-09-011-26/+26
| | | | | | Assign tuple to multiple loop variables for better readability Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Initialize with empty stringsPhilipp Hahn2020-09-011-12/+13
| | | | | | instead of using None as this has a different type. Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Simplify XML attribute fetchingPhilipp Hahn2020-09-011-29/+11
| | | | | | | | | | | | Use attr.get(key, default) instead. Also use the empty sting "" as the default value instead of "None": Both are "False" when used as a bool()ean, but "None" would require an explicit check for "not None" in many places as str() and None have different types. Signed-off-by: Philipp Hahn <hahn@univention.de> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* generator: Convert in_function to boolPhilipp Hahn2020-09-011-9/+9
| | | | Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Use string formattingPhilipp Hahn2020-09-011-13/+13
| | | | | | instead of sting concatenating. Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Use SAX method namesPhilipp Hahn2020-09-011-13/+7
| | | | | | | directly instead of using legacy method names from xmllib. Depends: 3740a5e4c701281ac76a55e3f02b1d4221f1f9f0 Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Remove unused SAX content handler methodsPhilipp Hahn2020-09-011-13/+0
| | | | | | | | getmethodname() close() cdata() Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Refactor parser creationPhilipp Hahn2020-09-011-11/+7
| | | | | | to use closing context manager. Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Open file with context managerPhilipp Hahn2020-09-011-6/+4
| | | | Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Use splitlines()Philipp Hahn2020-09-011-11/+2
| | | | | | instead of hand-coded implementation. Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Just walk the dictPhilipp Hahn2020-09-011-1/+1
| | | | | | instead of generating a list first. Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Directly get dict lengthPhilipp Hahn2020-09-011-2/+2
| | | | | | instead of generating a list and then counting the elements. Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Walk only the valuesPhilipp Hahn2020-09-011-2/+2
| | | | | | instead of the keys and then doing a lookup. Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Use dict.item() to walk keys and valuesPhilipp Hahn2020-09-011-12/+7
| | | | | | which saves a lookup of each key. Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Check contained in hashPhilipp Hahn2020-09-011-10/+10
| | | | | | | | | | | directly instead of explicitly requesting only the keys as a list and converting that list to another list. Checking directly for an element to be contained in a hash is much more efficient as this is done using hashing O(1) instead of walking the list in half on average O(n). Signed-off-by: Philipp Hahn <hahn@univention.de> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* generator: Initialize function_classes directlyPhilipp Hahn2020-09-011-3/+3
| | | | Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Remove global declarationsPhilipp Hahn2020-09-011-28/+0
| | | | | | for variables with are not assigned. Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Use string concatenationPhilipp Hahn2020-09-011-15/+15
| | | | | | :%s,\(\w\+\)\s*=\s*\1\s*+,\1 +=, Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Use increment assignmentPhilipp Hahn2020-09-011-3/+3
| | | | | | :%s,\(\w\+\)\s*=\s*\1\s*+,\1 +=, Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Use enumerate()Philipp Hahn2020-09-011-27/+9
| | | | | | instead of manual iteration counting. Signed-off-by: Philipp Hahn <hahn@univention.de>