Usage of usedevelop=True results in all requirements.txt dependencies
always installed (without constraints) even when requirements.txt
is not explicitly added. Override usedevelop for these environments.
Add requirements.txt to the 'docs' environment since it imports
the whole ironic in the process.
Create a separate doc/requirements.txt.
Change-Id: I352f21772ccd68b35806f46851f254edb7c24c60
Remove pep8 dependencies from test-requirements, they're not
needed there and are hard to constraint properly.
Change lower-constraints to make pip happy and not require infinite
time to calculate dependencies.
Change-Id: Id524ad2bd2994fefadd6a3ad728123a0a1a49dc8
Tox trying to install latest versions for building docs,
which may not be supported by stable and lower branches,
so should be restricted by respective version's upper-constraints.txt
Change-Id: Ic2a8a264e95ecd70902329fc5de3839625845129
On some locales and some versions of python these quotes might not
decode properly, causing tox to fail to run pep8 environment, so
let's change them to the usual ASCII ones.
Change-Id: Ib60844aa222c65c7862adf817c5cb73e1d1cf5f4
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: I64afec683ca3ac0e750ce30d689441d3517671b5
Using autospec ensures that mocked functions are called with correct
arguments, so it's highly desired to have it.
Change-Id: I9c8395adf852495d2ef6db732d727990e8abd5d7
This repo is now testing only with Python 3, so let's 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 using sphinx-build with apidoc extension
- Use newer openstackdocstheme version
- Remove Babel requirement, this is not needed.
Change-Id: I4176d8002d45449171aa5f7a7caef196ab7900d0
76cbd2dbbb131224e73a4b7c4019c378d2bbaf20 added the docs
build requirement on sphinxcontrib-svg2pdfconverter which
needs the native rsvg-convert command. This change adds
the native package that provides that command to bindep.txt.
Also adds bindep env in tox.ini.
Change-Id: I72aa8695c058989b4a1aa62cbb5d5fda2ce348ad
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: Ia14bc6397a88f200277abc5485cab02eb3724e1b
Fix testenv which only installs test-requirement, also updated
upper constraint url.
mock minimum version is bumped to 3.0.0,
keystonemiddleware minimum version is bumped to 4.18.0.
Change-Id: I162bcf372598c2268c9c5e30947e49eedb0147e3
Adds bandit configuration template and exclude some of
tests that we don't want to fix for the moment.
Keeping job unvoted so that we can keep an eye on possible
issues while not breaking gate.
Change-Id: Icc055980c13696b29c512edf8c48abba924aa244
Story: 2005791
Task: 33563
Add initial API reference, which covers all inspector endpoits.
The conf.py and the tox environment are stolen from ironic.
Co-Authored-By: Kaifeng Wang <kaifeng.w@gmail.com>
Change-Id: I5009e8708dcad8ab25380f7bf574125d6e758ef5
Minor project file structure adjustment, to move config-generator.conf
and policy-generator.conf into tools/ subdirectory.
Also exclude tools/ from dsvm jobs.
Change-Id: I3242401511b88bd9b677d9875481808783f890b8
During pycodestyle fix [0], the max code complexity is temporarily
increased to 18.
This patch is a follow up to restore previous complexity (value 15),
and refactor code causing C901.
[0] https://review.openstack.org/#/c/567066
Story: #2001985
Task: #19604
Change-Id: Id64c31c449761024504284dcadd2b6c9f4a97f00
According to Openstack summit session [1] stestr is maintained project
to which all Openstack projects should migrate.
Let's switch it then.
Also adjust requirements to pass the gate.
[1] https://etherpad.openstack.org/p/YVR-python-pti
Change-Id: I79b2220c20a04e2e33360bc330b5b4b4124caf71
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: Ic87686868f784f0e1b514d6b899cc16240d88d61
This fixes the warning/errors except for the C901 Function is
too complex in the ironic_inspector/rules.py's create method.
Bump's max-complexity to 18 in tox.ini to workaround the C901.
Story: 2001985
Task: 19604
Change-Id: I6c76a43353b1beb572dbde78dba4b4a839d45ea7
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: I8a5c47cb8e4d623776cd4335754184f6f7f0d398
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
different distros already come with different minor versions of Python3,
so let's use general 'py3' tox env when invoking tox without specific
env.
This is just a convenience for developers and will not affect gates,
as they use specific tox envs, all of them pre-generated by tox by
default.
Change-Id: Ife1d1b66e5ebf698f16a5b830604117a6e111107
Instead of a legacy tox job, use the already defined functional jobs
that do the same. Note that those jobs are named "functional", so update
tox.ini as well.
Remove unused playbooks.
Change-Id: Icdb1b94b0e69ffb55007e166705871010e8943c5
Enable the following off-by-default checks:
* [H204] Use assert(Not)Equal to check for equality.
* [H205] Use assert(Greater|Less)(Equal) for comparison.
Increase the version of hacking in test-requirements so that can use new
off-by-default checks.
No changes to code were required.
Change-Id: I7fe394d99eee980e90768902b9fc264a8be3fe15
The Zuul v3 job is looking for the log files from the release notes
in: .tox/releasenotes/log/ but we had then in .tox/venv/log/
Fix it to where they Zuul v3 job expects it to be.
Change-Id: Ic0810a681efefe2be4656bc66e2477710a8b15dd
this patch introduces an oslo.policy-based API access policy
enforcement engine to ironic-inspector.
As part of implementation, a proper oslo.context-based request
context is also generated and assigned to each request.
Short overview of changes:
- added custom RequestContext class
- extends oslo.context to handle of "is_public_api" flag
(False by default)
- added context to request in each API route
- '/continue' api sets the "is_public_api" flag to True
- added documented definitions for API access policies and their
defaults
- added enforcement of these policies on API requests
- added oslo.policy-specific entry points to setup.cfg
- added autogenerated policy sample file with defaults
- added documentation with autogenerated policies
Change-Id: Iff6f98fa9950d78608f0a7c325d132c11a1383b3
Closes-Bug: #1719812
This patch moves ironic-inspector to use 'stestr' test runner
via 'ostestr' wrapper.
Effective changes:
- unit tests are now being run in parallel by default
- 'py*' jobs are not running code coverage measurements,
which is left for 'cover' job only
- 'cover' job now also produces html reports consumable by upstream CI,
and fails under 90% of code coverage
- users can leverage all the ostestr/stestr features
Change-Id: I75f539457dbb1d811fdee69de52d1bcee4c6ebe6
Depends-On: Ica838db23b5714c2da1e4313e1a7ece0ca241d44
Closes-Bug: #1666232
pydot2 is incompatible with python3[1]. Bumping the pydot release (through
the test-requirements.txt) rather than pinning basepython to fix this.
Also updating the states.svg with the tox -egenstates result of running
pydot3
[1] https://github.com/erocarrera/pydot/issues/107
Change-Id: I9aa0e701af3915b39e1a5681c2105a6afb687dd2
Depends-On: I82e3651eefd3186c9e131b0db29a328967fb3161
When the timezone of an ironic-inspector develop environment is CST,
tox test will fail. So we should set TZ to UTC by default.
Change-Id: Icebef00efe029d793e04e1aec81132805009bde0
Closes-Bug: #1669699