This repo is now testing only with Python 3, so let's make
a few cleanups:
- Remove python 2.7 stanza from setup.py
- Remove obsolete sections from setup.cfg
- Update classifiers
- Update requirements, no need for python_version anymore
- Cleanup doc/source/conf.py to remove now obsolete content,
use sphinxcontrib.apidoc to build module index again (this
seems to have been broken when switching to sphinx-build).
- Remove install_command from tox.ini, the default is fine
- Use TOX_CONSTRAINTS_FILE instead of obsolete UPPER_CONSTRAINTS_FILE.
- Update tox.ini for python3 only support.
Change-Id: Id8738ecfb0f578d2a7953c63ffe10779f835bcaf
python2 is EOL. OpenStack and Zuul both are python3 only.
Drop the Python-2 CentOS 7 build host testing, including the tripleo
centos-7 train job.
Drop the old openstack-python-jobs template and move to specific
version templates for what we support.
Drop upper-constraints from the py35 environment, as master of
requirements is now using python 3.6-only libraries.
Drop the Xenial tests for similar reasons (rather than making some
sort of forced install); we are keeping Python 3.5 support just for
Zuul compatability at this point so a tox run is enough.
Depends-On: https://review.opendev.org/729787
Depends-On: https://review.opendev.org/729508
Change-Id: I6d90754cb4b7217b10ae777d414c03466b751761
Pin func test requirements to stable/train; the last stable release
with Python 2 support. Switch to the python-jobs-no-constraints
template to avoid using master constraints file.
Only build focal on bionic, other debootstraps are too old.
Remove pip-and-virtualenv testing as we are moving to plain images.
The tripleo-buildimage-jobs are unstable; see linked bug.
Add a note that this is the last Python 2 release.
Change-Id: Ibde7a564dd41cc2d6e80e2dffe5a95a57bbf8ada
This causes problems for other projects incorporating dib; we don't
have a specific need for a cap.
Fix a few issues, mostly spacing or regex matches. No functional
changes.
W503 and W504 relate to leaving artithmetic operators at the start or
end of lines, and are mutually exclusive and, due to "ignore"
overriding the defaults both get enabled. It seems everyone gets this
wrong (https://gitlab.com/pycqa/flake8/issues/466). Don't take a
position on this and ignore both.
Use double # around comments including YAML snippets using "# type: "
which now gets detected as PEP484/mypy type hints.
Change-Id: I8b7ce6dee02dcce31c82427a2441c931d136ef57
We only need doc requirements for the doc jobs, so only install them
there.
Also, update docs job to not publish dirtrees.
Change-Id: I928f4e24970a680bf340ce15a08a4e72432fb0e4
Change order of default tox envlist in order of likeliness to fail on a
new change and add py37 and py36.
Change-Id: I9d21561991c1d956a62de72c906cf91305ce5328
Move several parts of the "install_test_deps.sh" script into the more
standard bindep.txt. This list is intentionally restricted as a first
step.
Developer documentation is updated to use bindep and clarified
slightly.
Change-Id: I7520902dc324d920a0c7c44a2d35fe49f9b05614
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.
We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.
We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.
Change-Id: I64d454d251712281911a1aa6e4ecd6139ad1bd8b
Create a tox environment for running the unit tests against the lower
bounds of the dependencies.
Create a lower-constraints.txt to be used to enforce the lower bounds
in those tests.
Add openstack-tox-lower-constraints job to the zuul configuration.
See http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html
for more details.
Change-Id: I911c66b2e9971a3e134c482a4b4ffa529d358a76
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
We do not need tox_install.sh, pip can handle constraints itself
and install the project correctly. Thus update tox.ini and remove
the now obsolete tools/tox_install.sh file.
This follows https://review.openstack.org/#/c/508061 to remove
tools/tox_install.sh.
Change-Id: Ieec1e7c7a4ae9a89fb413e4aa5288396690ed538
Adding constraints support to libraries is slightly more complex than
services as the libraries themselves are listed in upper-constraints.txt
which leads to errors that you can't install a specific version and a
constrained version.
This change adds constraints support by also adding a helper script to
edit the constraints to remove diskimage-builder.
Change-Id: I795800589ea1491efd0e489a38b60e6adf33e7f3
Add some missing test requirements. I noticed these because pylint
was unhappy about the imports if you look closely.
Also, pylint shouldn't be in deps as it comes from the parent's
"test-requirements.txt" install. We don't need the VIRTUAL_ENV
setting either.
Change-Id: Ie082a058a9d3d51164448410a00d0719b0b37c4a
As described in pep282 [1], the variable part of a log message
should be passed in via parameter. In this case the parameters
are evaluated only when they need to be.
This patch fixes (unifies) this for DIB.
A check using pylint was added that this kind of passing parameters to
the logging subsystem is enforced in future. As a blueprint a similar
(stripped-down) approach from cinder [2] was used.
[1] https://www.python.org/dev/peps/pep-0282/
[2] https://github.com/openstack/cinder/blob/master/tox.ini
Change-Id: I2d7bcc863e4e9583d82d204438b3c781ac99824e
Signed-off-by: Andreas Florath <andreas@florath.net>
This is an initial creation of pylint with a basic indent checker.
Small issues corrected. Job added to gate with
Ib554a284e92583cc1d6a5c2219b3922852ca4c73
Change-Id: I7e24d8348db3aef79e1395d12692199a1f80161a
Co-Authored-By: Andreas Florath <andreas@florath.net>
Currently there is no description of dependencies in the generated
documentation of the elements: therefore a user of an element does not
know which other elements are automatically included and e.g. which
configuration options are available. In addition there are some
copy&pastes of parts of the README.rst scattered thought different
Ubuntu and Debian specific elements.
This patch adds a semi-automatic generation of dependency information
of all elements. Nevertheless these are not automatically included.
The author of the element's README.rst can decide if and where the
dependency information should appear and can use the descriptor
.. element_deps::
for this.
This patch adds the dependency information for some Debian and
Ubuntu patches - and creates the base for later removing the
duplicated parts.
A call is added to element_dependencies._find_all_elements() to
populate reverse dependencies for Element objects.
(This is a reworking of I31d2b6050b6c46fefe37378698e9a330025db430 for
the feature/v2 branch)
Change-Id: Iebb83916fed71565071246baa550849eef40560b
Change ec7f56c1b2 add added unit tests
in diskimage_builder/tests/functional (this is probably misnamed).
These are found and run by testr just as part of the normal "setup.py
test" run. Don't run them as part of the functional tests (this
breaks "-h"/"-l" because it installs a virtualenv and runs tests, and
also is incorrect in the gate where it's creating a nested virtualenv
underneath the testing virtualenv).
Change-Id: I9908e080042d3026a198ba89eb653c6eff376d22
During the creation of a disk image (e.g. for a VM), there is the need
to create, setup, configure and afterwards detach some kind of storage
where the newly installed OS can be copied to or directly installed
in.
This patch implements partitioning handling.
Change-Id: I0ca6a4ae3a2684d473b44e5f332ee4225ee30f8c
Signed-off-by: Andreas Florath <andreas@florath.net>
There's a few things going on here
Firstly, we need to install coverage tool in test-requirements
Secondly, .testr.conf has to use PYTHON because the coverage report
works by resetting PYTHON='coverage run ...'
Thirdly, because we call ourselves diskimage-builder but the python
module is diskimage_builder that seems to confuse things. We need to
use "setup.py test" (note, that is different to "setup.py testr"!) to
use the PBR testr wrapper. That exposes a --coverage-package-name
argument that calls the coverage tool with the right argument.
With this I got a coverage report for our unit tests
Change-Id: I9012e18eb7d01bee035140e70afa76c47c27eb01
expand_dependencies() was a public interface so we should try and
preserve backwards compat. However, since the interface is really
broken, add a new exported function "get_elements" that instack can
switch to. This returns the canonical list of elements without
duplicates, and gives the path to each element too.
This highlighted that the unit tests were really a bit wrong. They're
testing inner functions when we have an "API" in the get_elements()
function. Convert all unit-tests to use this function instead. Since
this is a library call, convert the sys.exit() calls to raised
exceptions.
Refactor the variable output into a separate function so we can do a
sanity check on it.
The added flake8 ignores are for the "over-indented for ... indent"
which happens a lot with these new longer lines. Most other projects
ignore them.
This is an alternative proposal to
I15609389c18adf3017220fc94552514d195b323a
Change-Id: If97bcd21e45de1b5ed91023fdc441a4617051a6b
The directory openstack/common was used to keep codes from
oslo-incubator, we have retired oslo-incubator, so don't use
this directory any more
Change-Id: Icd13d32674b117626fbecdfdec2881463a87ad5d
Block device handling can be somewhat complex - especially
when taking things like md, lvm or encryption into account.
This patch factors out the creation and deletion of the local
loop image device handling into a python library.
The main propose of this patch is to implement the needed
infrastructure. Based on this, more advanced functions can be added.
Example: (advanced) partitioning, LVM, handling different boot
scenarios (BIOS, UEFI, ...), possibility of handling multiple images
(local loop image, iSCSI, physical hard disk, ...), handling of
different filesystems for different partitions / LVs.
Change-Id: Ib626b36a00f8a5dc3dbde8df3e2619a2438eaaf1
Signed-off-by: Andreas Florath <andreas@florath.net>
Python 2.6 support would be dropped by
Infra team from mitaka,CI would no longer be testing it,
so projects should drop it too.
Change-Id: I916150ec5508a095fd850c9cb85dbeb464cdb826
Now 'tox -efunc' can be invoked to run all functional tests in
the 'venv' tox environment. Also `tox -efunc element-name` can be
used to run function tests for one element (e.g. ironic-agent).
Change-Id: Ia685d1b2a7deef2f8b98876ac09792134dd30f2f
Remove the specification in tox.ini that _ is a builtin so that
it will no longer assume that _ does not need to be imported.
This helps ensure that the _ from i18n is used.
Activating this check did not flag any violations.
Change-Id: Iac73937b60a6f8e7520123fbf59e748d296d4c7d
If py34 is run after py2x, it results in a "db type could not be
determined" error. The only current way to avoid that is to run
py34 first.
Change-Id: Id81e127e71ecd04a2ed16ab899d6fbf0d15bfee3
This is much easier to remember than the full commandline - and keeps
this project in line with others
Change-Id: I2f631c25d8839272941b7c8d4bb571a853422083
We currently support package-installs definitions which has some
limitations and oddities. This new format requires only one definition
which does not reside in our run-parts directories and follows a
consistent naming scheme (package-installs.yaml).
Change-Id: Ie51a7c4fdc15634ae8e069728e5e07cc1dc36095
This will provide a place to put checks that catch common errors
in elements. To start, this just checks that files starting with
a shebang are chmod +x so they can actually be run.
Change-Id: I4116a8f38f7bdfc5866764354c459fad8ca18e92
* tox.ini: The LANG, LANGUAGE and LC_ALL environment overrides were
introduced originally during the testr migration in an attempt to be
conservative about the possibility that locale settings in the
calling environment could cause consistency problems for test runs.
In actuality, this should be unnecessary and any place where it does
cause issues ought to be considered an actual bug. Also, having
these in the configuration actively causes older pip to have
problems with non-ASCII content in some package metadata files under
Python 3, so drop it now.
Change-Id: I840f950d2e9f6e1e40af578900e92cedf8f14295
Closes-Bug: #1277495
Ask pip to upgrade packages in the virtualenv so that a long-lived
virtualenv is still kept up to date as external dependencies change.
Change-Id: I5a57debd5c4bc03e6d00d3801be614d9b895c508
Reasons:
- tox update v1.6
Changes:
- tox 1.6 allows us to skip the sdist step, which is slow.
- It also allows us to override the install line. In this case, it's
important as it allows us to stop getting pre-release software we
weren't asking for.
Original patch by Monty Taylor, talked about here:
http://lists.openstack.org/pipermail/openstack-dev/2013-September/015495.html
Change-Id: I7ea029bc75547ccd43566d3329037757d0388112