IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
When -Ibuild flag is passed to compiler then build/ can be dropped
from includes. This is safe to do, because the prefix is only on
local includes (#include "") not system ones (#include <>).
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
When generating spec file, @PY_VERSION@ is replaced with the
current version of libvirt-python. Well, it's not as obvious as
it could be: usually it's just @VERSION@. Worse, the PY_ prefix
may mislead readers into thinking it refers to python version.
Just drop the PY_ prefix.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
We have Python 3.6 as a minimum version. If we set Py_LIMITED_API
to 0x03060000, we'll get the stable python API associated with
versions >= 3.6. This lets users compile once and have the libvirt
binary module be loadable by any Python version >= 3.6, as described
in:
https://docs.python.org/3/c-api/stable.html
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Use a set to collect the authors from the git output with no duplicates,
then sort the resulting set, and apply the wanted indentation.
This method is more Pythonic, using a set to avoid duplicates; applying
the indentation after the sorting makes the sorting slightly faster.
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Adopt subprocess.check_output() as more modern and higher-level way to
invoke processes, checking that they succeed, and getting their output.
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Storing the git commands as single string, to split it by space later
on, works only in case there are no spaces in the arguments, which is
exactly what is in those commands.
Instead, specify them directly as lists, with the options & arguments
split in the right way. This fixes the generation of the AUTHORS and
ChangeLog files.
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Direct setup.py invocations are being discouraged in favour of
using Python's 'build' module. Therefore, we can't really make use of this command
anymore since only wheels and tarballs are built with the 'build' module
compared to the previous state of the art of dumping the freshly built
modules and libraries directly inside the build directory.
We'll have to encourage usage of tox which will install the package
inside a virtualenvironment for the tests. Future patch will update the
Makefile targets to make this easier for the end users.
Signed-off-by: Erik Skultety <eskultet@redhat.com>
This makes it possible to programatically query the version in any
stage of the build process, including Makefile etc.
Signed-off-by: Erik Skultety <eskultet@redhat.com>
So, why using setup.cfg if pyproject.toml is the new best thing
recommended everywhere? Well, quite a few of the fields we use with
setuptools are setuptools-specific and haven't been introduced as
keywords to pyproject.toml yet. There is a chance that these fields
could be added via a dedicated 'tool.setuptools' TOML section, but none
of it is officially documented and so it would be BETA at best anyway.
Let's not try our luck and use a declarative config file tailored
specifically to setuptools - setup.cfg. It's also unlikely we'd switch
from setuptools to something else in the near future given the nature
of building this project (i.e. building with C modules) and if so, it
would likely not be a PyPa recommended PEP-517 compliant build
system anyway, e.g. meson, so we're totally fine doing this.
Signed-off-by: Erik Skultety <eskultet@redhat.com>
Some of the operations, namely file operations and spawning processes
can utilize the power of context managers. Use them more, use them
together.
Signed-off-by: Erik Skultety <eskultet@redhat.com>
subprocess is the high-level Pythonic interface providing more
flexibility over the low-level os.popen stuff. It is recommended to
always use subprocess over the direct 'os' interface.
Signed-off-by: Erik Skultety <eskultet@redhat.com>
It hinders readability so much when the top-level code that gets
executed right away when setup.py is loaded is mixed in between type
definitions.
Signed-off-by: Erik Skultety <eskultet@redhat.com>
3.6 is already EOL, but many platforms still default to Python 3.6 when
it comes to the default platform Python package. Since we don't rely
on any 3.7+ features in the bindings at the moment, let's keep
everyone's life simpler and stay with 3.6 for now, we can bump it again
in the future.
Signed-off-by: Erik Skultety <eskultet@redhat.com>
We're not good at tracking all the released Python 3 versions (+ we
don't support Python 2 anymore).
Additionally, future patches will take care of reporting the minimum
required version of Python anyway through the 'python_requires' field
which shows up correctly in PyPI.
Signed-off-by: Erik Skultety <eskultet@redhat.com>
The libvirt git repo contains test data that represents the
layout of files in sysfs, which has two subdirs that mutually
reference each other with symlinks.
When pytest does test discovery it will traverse every
directory it finds underneath the libvirt-python checkout.
Since we checkout libvirt as a sub-dir, pytest traverses
everything in libvirt git and gets stuck in an infinite
loop following symlinks in the libvirt test data.
Telling pytest to only look at the 'tests' subdir avoids
this extra traversal.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
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 <class '__main__.my_clean'> 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' & '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 a965c91c6f
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
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é <berrange@redhat.com>
We want to move over to make sanitytest.py operate like a more normal
test script, which means making it self contained.
The setup.py already sets the PYTHONPATH thanks to changes introduced
in:
commit eaded7bdad
Author: Daniel P. Berrange <berrange@redhat.com>
Date: Tue Mar 18 11:11:48 2014 +0000
Add support for running unit tests with nose
so passing the python module path into sanitytest.py is redundant.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
We want to move over to make sanitytest.py operate like a more normal
test script, which means making it self contained.
The test already knows how to find the libvirt API XML path using
pkg-config and if an override location is required, this can be done
by pointing $PKG_CONFIG_PATH to a suitable place.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>