The tox deps option grants installation of single dependencies and
requirements, optionally pinned using constraints, before installing
a package, therefore not granting installation of the correct
constraint during the package installation.
To fix that tox 4.4.0 has introduced the constrain_package_deps
option [1]
[1] https://tox.wiki/en/4.12.1/faq.html#using-constraint-files
Change-Id: I14a93e67735df0f1b82dd687873ec77d8bfaac78
Continuing the work of @JayF in other repos.
Adds a tox target for codespell, `tox -e codespell`. Can optionally
be run as `tox -e codespell -- -w` to get automatic spelling fixes
applied where appropriate. Adds small amounts of configuration to
setup.cfg, including an ignore list of words.
Related Bug: https://bugs.launchpad.net/ironic-python-agent/+bug/2047654
Change-Id: I284045ee9dfb51eee59a0442abda657c74abed05
Some tests tool and IDE may create a .local directory inside the repo
with virtualenvs for dependencies, other tools may create . directories
or files for temporary reports.
While they can be removed in a second time, or configured differently,
it's advisable to just exclude all file starting with . from the
flake8 tests to avoid confusion and possible unexpected errors.
Change-Id: Iea00e194fbe9c89754fb0a65cdaaabdaad31e4cc
Per ClarkB on the list, overriding install_command makes it more
difficult to troubleshoot behavior differences and failures.
Change-Id: I3fb6760bf4754bd1688db173037e55c238a0601e
UPPER_CONSTRAINTS_FILE is old name and deprecated
This allows to use upper-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.
Change-Id: I7b79d0bc10c4c5c48e167e7042d383921feb1486
This code is used by both ironic and ironic-inspector with barely
any difference and will be required to import the JSON RPC code.
To prevent IPA from depending on keystoneauth, the new requirement
is added as a new extra feature "keystone".
Change-Id: I8bc08ec9e081a67d1687033413fee63698e14e69
Remove pep8 dependencies from test-requirements, they're not
needed there and are hard to constraint properly.
Change lower-constraints to make pip resolver happy.
Add bindep.txt to provide dev libraries to build python modules.
Change-Id: I4edc2ebc7b29849901964279b5cc551944d830a9
As recommended, since version 3.2.0 tox switches pip invocations
to use the module -m pip instead of direct invocation.
We set min version to 3.2.1 [1] to also fix the behavior of
--parallel--safe-build
[1] https://tox.readthedocs.io/en/latest/changelog.html#v3-2-1-2018-08-10
Change-Id: Idc0c845dc499768d8f6ea2859596bc6e391c9f60
* Remove testscenarios, it's an ancient artefact
* Replace the only usage of testtools with a simple check
* Split out doc/requirements.txt
* Clean tox.ini of unnecessary (and probably cargo-culted) stuff
* Added Pygments for syntax highlighting check
Change-Id: I9f6b03606973e1e8123165c46bef53c4ce8e2b92
Make a few cleanups:
- Remove python 2.7 stanza from setup.py
- Add requires on python >= 3.6 to setup.cfg so that pypi and pip
know about the requirement
- Remove obsolete sections from setup.cfg
- Update classifiers
- Update requirements, no need for python_version anymore
- Switch to apidoc instead of autodoc for API docs, use sphinx-build.
Change-Id: Ie6107bc80961a7306957b17ac2eda44417b53d3e
The new version enables a lot of standard flake8 checks, so a few
fixes are required. W503 is disabled as it conflicts with W504
and the latter seems to be preferred nowadays.
Change-Id: I929ff36eaa47a42bc551f5c37bd40f64bc4f14d0
Since removing support for Python 2, we changed the basepython
value to 3.
This means that all the tox tests run with the default python
version available in the system.
This is not quite correct when running on environment such as
py36, py37 or py38, since they imply running with different
Python versions based on the environment.
To enforce the correct version we need to add the option
ignore_basepython_conflict available since tox 3.1.0 [0].
[0] https://tox.readthedocs.io/en/latest/config.html#conf-ignore_basepython_conflict
Change-Id: I63127c91c708af3a215fc653e43e2017c46dd7ad
According to Openstack summit session [1] stestr is maintained project
to which all Openstack projects should migrate.
Let's switch it then.
[1] https://etherpad.openstack.org/p/YVR-python-pti
Change-Id: Ibb1e23aceeb9a864306c52b410bda77736454ef0
Signed-off-by: Chuck Short <chucks@redhat.com>
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: Ic86d838e3e0093d41d1230f96c5bd85fcc0e8016
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
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: I7b1a6743bea281fc8c75fd8ad062973c51539670
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Curly quotes usually input from Chinese input method.
When read from english context, it makes some confusion.
Change-Id: I126b1f475614b7368ce76426ab1d7f61c8fbf4af
When running the tox tests, use the default version of Python 3. Instead
of having to update the Python 3 version as we move from
py34 -> py35 -> py36 -> py37 -> py38
Just use the default version of Python 3 on the system.
This will not affect what gets run in the gate, as the version is
explicitly specified when it runs there. This is for developers who run
the tests locally.
Change-Id: I775712a592bcdc01a6d0373d42971a8a53616112
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: Ic2615a261e433ce7ec8c0ef1d9c2061286a05739
Recent update brought os-testr 1.0.0 that already uses stestr test
runner instead of testrepository. This patch migrates those places
using testrepository to using stestr.
Inspired by the patch of the same name in openstack/ironic
Change-Id: I49bd08a402663bfabe1fea14957435ee071145e7
Enable the following off-by-default checks:
* [H106] Don't put vim configuration in source files.
* [H203] Use assertIs(Not)None to check for None.
* [H204] Use assert(Not)Equal to check for equality.
* [H205] Use assert(Greater|Less)(Equal) for comparison.
* [H210] Require ‘autospec’, ‘spec’, or ‘spec_set’ in
mock.patch/mock.patch.object calls
* [H904] Delay string interpolations at logging calls.
Fix code that failed [H904]. Nothing else failed the new added checks.
Change-Id: I727c944aad04298de07bcdd1d0008dcb9ffe32e9
Specify 'ironic_lib' as the name of the application for the flake8-import-order
plugin. That way it knows that imports of ironic_lib should come after external
libraries.
Change-Id: I6c88a6a8142634c1194832896f40f9bc9c122367
Added python 3.5 to setup.cfg so it contains all supported python
versions. Removed python 3.4 in tox.ini because the gating on
python 3.4 is restricted to <= Mitaka. This is due to the change
from Ubuntu Trusty to Xenial, where only python3.5 is available.
There is no need to continue to keep these settings.
Change-Id: I5051826fdc867caea9f6a17c39a86e1799365527
Use the flake8 plugin flake8-import-order to check import ordering. It
can do it automatically and don't need reviewers to check it.
Change-Id: Ib3fde54d8baa2c6e3567ff3f1a902de4b25f9f70
Since we're running python 3.5 tests now, we should also be
running thme when running all tests with just `tox`.
Change-Id: Ic5d1c64d4cfccbc517f753bfe48aec13a16736e8
This patch fixes all sphinx warnings generated by malformed docstrings.
Additionally, it contains formatting and accuracy fixes for the metrics
docstrings, to ensure blockquotes are properly rendered, and to indicate
the get_metrics_logger() method is actually in metrics_utils.
Finally, this adds doc8 to the pep8 job, ensuring we don't reintroduce
some of these errors. As a note, there are items that can cause warnings
in doc builds that aren't enforced by doc8, and can't be enforced until
a doc build job is added to project-config.
Change-Id: I622812bfe8af576ab215c098dd211c6faf697a0c
Partial-bug: #1614272
Partial-bug: #1611559
This adds a doc build for ironic-lib. Currently the only documentation
is that generated from docstrings.
Change-Id: I6ee00ad863bc7ce72958db4e8d5b6871a5b96eb0
Partial-bug: #1614272
--coverage-package-name option was no longer supported by 'testr'[1].
This commit replaces from 'testr' to 'test' as coverage option.
[1] https://review.openstack.org/#/c/217847/
Change-Id: I0e3e5e837ee2f7275c489502700e91c15c7d44aa
To solve the problem of "db type could not be determined" on py34 we
have to run first the py34 env to, then, run py27. This patch puts py34
first on the tox.ini list of envs to avoid this problem to happen.
Change-Id: I80b755d0aa18db7c55ccaecd1c4f64d4fe09b4c5
Closes-Bug: #1489059
This allows a post job to generate coverage data for ironic-lib. The
package name needs to be overridden, as the default is taken to be
ironic-lib, not ironic_lib.
Omit openstack.common as we aren't responsible for testing that.
Change-Id: I30a810effd918b8cb88485a527ecbfbc01dfb2e1
This syncs a few changes from ironic's tox.ini:
* Specify minimum tox version as 1.8
* Skips sdist generation
* Don't write bytecode (pyc) when running tests
* Run tests in English so that log messages are consistent
Change-Id: If0b8afb1102d8ee2ba31ea88f1259fbb42143605
This moves the tests directory under ironic_lib, which is kind of the
standard around here. Updates tox.ini to point at this directory.
Also updates tox.ini to use ostestr, to be more standard with other
OpenStack things.
Change-Id: I91e6ba38c44a475602175b66c10757ec11b173f9
* No need to explicitly mention requirements.txt
* Added py34 environment
* Leave only required flake8 excludes
* Run with hash randomization
Also fixes tests on Python 3.
Change-Id: I03f2a474a66fba7a7e30bd326acb394f0b196f57