<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libvirt-python.git, branch v8.5.0</title>
<subtitle>libvirt.org: git/libvirt-python.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libvirt-python.git/'/>
<entry>
<title>setup: make 'clean' command compatible again with distutils</title>
<updated>2022-06-25T04:38:30+00:00</updated>
<author>
<name>Pino Toscano</name>
<email>ptoscano@redhat.com</email>
</author>
<published>2022-06-25T04:30:45+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libvirt-python.git/commit/?id=ba4db43f636d701411b10b44fbb77f02393b4e98'/>
<id>ba4db43f636d701411b10b44fbb77f02393b4e98</id>
<content type='text'>
After the switch of 'my_clean' to a simple Command, the 'clean' command
has no more bits for options, resulting in distutils (either external
or embedded in setuptools) complaining about it:

  distutils.errors.DistutilsClassError: command class &lt;class '__main__.my_clean'&gt; must provide 'user_options' attribute (a list of tuples)

To overcome that, provide all the standard bits from options, i.e. the
'user_options' list, and the 'initialize_options' &amp; 'finalize_options'
methods. In addition, add a dummy 'all' option, as distutils wants it:

  error: error in [...]/.pydistutils.cfg: command 'my_clean' has no such option 'all'

Fixes commit a965c91c6fa1275613edbbef75c0422574eb9ff2

Signed-off-by: Pino Toscano &lt;ptoscano@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After the switch of 'my_clean' to a simple Command, the 'clean' command
has no more bits for options, resulting in distutils (either external
or embedded in setuptools) complaining about it:

  distutils.errors.DistutilsClassError: command class &lt;class '__main__.my_clean'&gt; must provide 'user_options' attribute (a list of tuples)

To overcome that, provide all the standard bits from options, i.e. the
'user_options' list, and the 'initialize_options' &amp; 'finalize_options'
methods. In addition, add a dummy 'all' option, as distutils wants it:

  error: error in [...]/.pydistutils.cfg: command 'my_clean' has no such option 'all'

Fixes commit a965c91c6fa1275613edbbef75c0422574eb9ff2

Signed-off-by: Pino Toscano &lt;ptoscano@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>setup: advertize Python 3.9 and 3.10 support</title>
<updated>2022-06-08T15:43:52+00:00</updated>
<author>
<name>Daniel P. Berrangé</name>
<email>berrange@redhat.com</email>
</author>
<published>2022-05-16T16:37:20+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libvirt-python.git/commit/?id=b34fbaf405c61935efbd0d3e9b3a134f26097ea7'/>
<id>b34fbaf405c61935efbd0d3e9b3a134f26097ea7</id>
<content type='text'>
Add classifiers that indicate we intend to support python versions
3.9 and 3.10.

Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add classifiers that indicate we intend to support python versions
3.9 and 3.10.

Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>examples: remove use of deprecated setDaemon method</title>
<updated>2022-06-08T15:43:52+00:00</updated>
<author>
<name>Daniel P. Berrangé</name>
<email>berrange@redhat.com</email>
</author>
<published>2022-05-17T14:40:03+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libvirt-python.git/commit/?id=693a93f85b267f7156a906a88ba95f6128802fea'/>
<id>693a93f85b267f7156a906a88ba95f6128802fea</id>
<content type='text'>
In Python 3.10 the setDaemon method was deprecated. It is redundant
since the 'daemon' parameter can be given when creating the thread,
or the 'daemon' attribute can be set after it was created.

Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In Python 3.10 the setDaemon method was deprecated. It is redundant
since the 'daemon' parameter can be given when creating the thread,
or the 'daemon' attribute can be set after it was created.

Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: expand AIO tests and add more comments</title>
<updated>2022-06-08T15:43:52+00:00</updated>
<author>
<name>Daniel P. Berrangé</name>
<email>berrange@redhat.com</email>
</author>
<published>2022-05-17T14:31:16+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libvirt-python.git/commit/?id=438b86fda1b48ff3eab25b9c7ffaf156e7bc8759'/>
<id>438b86fda1b48ff3eab25b9c7ffaf156e7bc8759</id>
<content type='text'>
Add a test for one more usage scenario that was possible in the past,
whereby libvirt events are registered before starting the asyncio
loop, but we let libvirt find the loop associated with the current
thread.

Skip the test relies on auto-creating an event loop with Python &gt;= 3.10
since it now triggers a deprecation warning which will soon turn into a
RuntimeError.

Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a test for one more usage scenario that was possible in the past,
whereby libvirt events are registered before starting the asyncio
loop, but we let libvirt find the loop associated with the current
thread.

Skip the test relies on auto-creating an event loop with Python &gt;= 3.10
since it now triggers a deprecation warning which will soon turn into a
RuntimeError.

Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: use mocks to allow calling virEventRegisterImpl many times</title>
<updated>2022-06-08T15:43:52+00:00</updated>
<author>
<name>Daniel P. Berrangé</name>
<email>berrange@redhat.com</email>
</author>
<published>2022-05-17T14:01:19+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libvirt-python.git/commit/?id=e3fab09382d4a6c439820ed5e6930e57716dcb50'/>
<id>e3fab09382d4a6c439820ed5e6930e57716dcb50</id>
<content type='text'>
We currently have to run each of the test_aio.py test cases in a
separate process, because libvirt.virEventRegisterImpl can only be
called once per process. This leads to quite unpleasant console
output when running tests.

By introducing a mock for libvirt.virEventRegisterImpl we can
regain the ability to run everything in a single process. The only
caveat is that it relies on tests to fully cleanup, but in practice
this is ok for our current tests.

Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We currently have to run each of the test_aio.py test cases in a
separate process, because libvirt.virEventRegisterImpl can only be
called once per process. This leads to quite unpleasant console
output when running tests.

By introducing a mock for libvirt.virEventRegisterImpl we can
regain the ability to run everything in a single process. The only
caveat is that it relies on tests to fully cleanup, but in practice
this is ok for our current tests.

Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: add libvirtaio test coverage</title>
<updated>2022-06-08T15:43:52+00:00</updated>
<author>
<name>Chris Gunn</name>
<email>chrisgun@microsoft.com</email>
</author>
<published>2022-02-11T00:49:06+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libvirt-python.git/commit/?id=b9f79758c973db088b5c687425c6613796fdb250'/>
<id>b9f79758c973db088b5c687425c6613796fdb250</id>
<content type='text'>
Signed-off-by: Chris Gunn &lt;chrisgun@microsoft.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Chris Gunn &lt;chrisgun@microsoft.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libvirtaio: add better docs on best practice usage pattern</title>
<updated>2022-06-08T15:43:52+00:00</updated>
<author>
<name>Daniel P. Berrangé</name>
<email>berrange@redhat.com</email>
</author>
<published>2022-05-17T14:36:01+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libvirt-python.git/commit/?id=c2fae558c363c253a0356fafceb73f5b13b5f0f3'/>
<id>c2fae558c363c253a0356fafceb73f5b13b5f0f3</id>
<content type='text'>
Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libvirtio: lazy create the Event object in drain()</title>
<updated>2022-06-08T15:43:52+00:00</updated>
<author>
<name>Daniel P. Berrangé</name>
<email>berrange@redhat.com</email>
</author>
<published>2022-05-17T13:11:55+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libvirt-python.git/commit/?id=376a9776598f5a5d44c70c7e844f5cab7e9bae2d'/>
<id>376a9776598f5a5d44c70c7e844f5cab7e9bae2d</id>
<content type='text'>
The drain method uses an asyncio.Event object to be notified when other
coroutines have removed all registered callbacks. The Event object needs
to be associated with the coroutine that the event loop is running with
and currently this is achieved by passing in the 'loop' parameter.

Unfortunately Python 3.10 has removed the 'loop' parameter and now the
object is associated implicitly with the current thread's event loop.
At the time the virEventAsyncIOImpl constructor is called, however,
there is no guarantee that an event loop has been set for the thread.
The explicitly passed in 'loop' parameter would handle this scenario.

For portability with Python &gt;= 3.10 we need to delay creation of the
Event object until we have a guarantee that there is a loop associated
with the current thread. This is achieved by lazily creating the Event
object inside the 'drain' method, which is expected to be invoked from
coroutine context and thus ensure a loop is associated.

Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The drain method uses an asyncio.Event object to be notified when other
coroutines have removed all registered callbacks. The Event object needs
to be associated with the coroutine that the event loop is running with
and currently this is achieved by passing in the 'loop' parameter.

Unfortunately Python 3.10 has removed the 'loop' parameter and now the
object is associated implicitly with the current thread's event loop.
At the time the virEventAsyncIOImpl constructor is called, however,
there is no guarantee that an event loop has been set for the thread.
The explicitly passed in 'loop' parameter would handle this scenario.

For portability with Python &gt;= 3.10 we need to delay creation of the
Event object until we have a guarantee that there is a loop associated
with the current thread. This is achieved by lazily creating the Event
object inside the 'drain' method, which is expected to be invoked from
coroutine context and thus ensure a loop is associated.

Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libvirtaio: convert to using 'async' / 'await' syntax</title>
<updated>2022-06-08T15:43:52+00:00</updated>
<author>
<name>Chris Gunn</name>
<email>chrisgun@microsoft.com</email>
</author>
<published>2022-05-16T16:56:50+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libvirt-python.git/commit/?id=30f8123072a8b665abcbd5d49c1ec69accd4f58c'/>
<id>30f8123072a8b665abcbd5d49c1ec69accd4f58c</id>
<content type='text'>
The 'async' keyword is new in Python 3.5, as a way to declare that a
method is a coroutine. This replaces the '@asyncio.coroutine' decorator
that is deprecated since 3.8 and scheduled to be removed in 3.11

The 'await' keyword has to be used instead of 'yield' from any
coroutines declared with 'async'.

Signed-off-by: Chris Gunn &lt;chrisgun@microsoft.com&gt;
[DB: Split off from a larger patch mixing multiple changes]
Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The 'async' keyword is new in Python 3.5, as a way to declare that a
method is a coroutine. This replaces the '@asyncio.coroutine' decorator
that is deprecated since 3.8 and scheduled to be removed in 3.11

The 'await' keyword has to be used instead of 'yield' from any
coroutines declared with 'async'.

Signed-off-by: Chris Gunn &lt;chrisgun@microsoft.com&gt;
[DB: Split off from a larger patch mixing multiple changes]
Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libvirtaio: drop back compat for python &lt; 3.4.4</title>
<updated>2022-06-08T15:43:52+00:00</updated>
<author>
<name>Chris Gunn</name>
<email>chrisgun@microsoft.com</email>
</author>
<published>2022-05-16T16:34:59+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libvirt-python.git/commit/?id=ca3731a126da2ed7f2c235f84daf54638e8933a5'/>
<id>ca3731a126da2ed7f2c235f84daf54638e8933a5</id>
<content type='text'>
setup.py ensures we have python &gt;= 3.5, so there is no need to do
back compat with the 'asyncio.ensure_future' method, which was new
in 3.4.4

Signed-off-by: Chris Gunn &lt;chrisgun@microsoft.com&gt;
[DB: Split off from a larger patch mixing multiple changes]
Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
setup.py ensures we have python &gt;= 3.5, so there is no need to do
back compat with the 'asyncio.ensure_future' method, which was new
in 3.4.4

Signed-off-by: Chris Gunn &lt;chrisgun@microsoft.com&gt;
[DB: Split off from a larger patch mixing multiple changes]
Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
