* Removed skipsdist=True to make sure placement available in the virtual
env. Without this, our entrypoints are not available.
* Removed basepython = python3 as we assume all developer switched to
python3 in their env already
* Removed ignore_basepython_conflict = True as without the basepython
definition generative targets now work without conflict
See [1] for a similar change made to placement.
It is also necessary to fix issues with the gate. For reasons that I
have yet to grok, a mock of 'requests.request' used in some test is no
longer functioning as expected. My guess is that something is now
importing requests before us and interfering with the mock but never
mind - we can easily bypass the issue by mocking 'requests.post'
instead.
[1] https://review.opendev.org/c/openstack/placement/+/868418/
Change-Id: I3b8263afbf0ccee88ceaac2040d5ad274f22d74a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This updates the test-requirements to more recent flake8-docstrings
and pep8 versions. I also added some more ignores that would take
significant work to update and fixed some minor linting issues.
Change-Id: Ia416658b8a4bfb8f43f8df170053abb3ae958d44
Since tox 3.18.0, the whitelist_externals option has been deprecated in
favor of the new allow_list_externals option[1].
This change bumps the minversion of tox so that we can replace
the deprecated option.
[1] https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23
Change-Id: Ib19bf79da06d656831cdb117e390d4583262f862
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Blacklist:
W504 line break after binary operator
W503 line break before binary operator
Fix other problems found
Change-Id: I2fb257a4f42b499df3702f3e8f3c99ecb28557d6
Python 3.5 was the target runtime for the Rocky release.
The current target py3 runtime for Stein is Python 3.6,
so there is no reason to keep testing against the older version. Also
correct setup.cfg and tox.ini to reflect the current supported Python
versions.
https://governance.openstack.org/tc/reference/runtimes/stein.html#python-runtime-for-stein
Change-Id: I7304a04870bd5a41ae593d543291a25d73cabe60
Without this patch, inserting a breakpoint causes the debug tox
environment to hang for a long time until the testenv timeout is
reached. This patch modifies the testenv to use similar stdout/stderr
settings that we use in keystoneclient and keystoneauth, which seems to
fix the issue, and removes other unnecessary settings.
Change-Id: I2f2f8f4738f43648a6bda067efe605db5807eaff
We already run python3.6 unit tests in CI. Add the py36 environment to
the tox file so that developers with python3.6 available locally can opt
into running that version too.
Change-Id: Ic7aad3d4adfafba226d3b1d1b2106d55135ce6ff
As part of removing reliance on the old and deprecated zuul-cloner, we
need to shift constraints declaration to the deps line. This means we
unfortunately have to duplicate the extras declarations into
test-requirements - because otherwise the contraints for
keystonemiddleware conflicts with the installation of itself.
Change-Id: I8dbb31d1c1fda6df386f456dcf1d8bbed6d168ce
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: I21491f302cbc6ca7a9b5ac12c487cf214bf4866e
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: Ief8bbf14effa1266c62c4600f889a18f1fdbde32
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
With the new way of generating docs in the gate[1] our autodoc builds
are slightly broken. Put the required dependencies for doc building and
autodoc generation into doc/requirements.txt. We can also now remove
docs-related requirements from test-requirements.txt.
[1] http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html
Change-Id: Ifbd16fe364bb216821125c70bb7d3ab0ac1f10a3
doc8 is a linter for documents and used in openstack-manuals.
It is better to enforce document linters for simple checking.
This change is to add doc8 in tox file and fix line too long
in some files.
The current rules are as bellow:
- invalid rst format - D000
- lines should not be longer than 79 characters - D001
- RST exception: line with no whitespace except in the beginning
- RST exception: lines with http or https urls
- RST exception: literal blocks
- RST exception: rst target directives
- no trailing whitespace - D002
- no tabulation for indentation - D003
- no carriage returns (use unix newlines) - D004
- no newline at end of file - D005
Change-Id: I01b11619b42eebf13cb17e1b4a2e8464a8ccc797
According to [1], we can passing a "-t" argument to
oslo_debug_helper to indicate the directory where tests
are located. This will solves ImportError exception.
[1] https://docs.openstack.org/developer/oslotest/features.html
Closes-Bug: #1666560
Change-Id: I18ea63e9303b2a69f69de3e42b52c8a9f25bf7a5
Now that there exists only a gate job for Python 3.5 and not 3.4,
we should remove those references to the 3.4 that is untested.
Change-Id: I77626618b9c8a61017df3e28c10a779a54422080
This commit switches the tox command to use ostestr instead of calling
testr through setup.py. The primary advantage here is that it uses the
subunit-trace output filter. ostestr primarily exists as a replacement for
pretty_tox.sh bash scripts which spread like a plague through OpenStack
projects after Nova copied it from Tempest.
Note that this dramatically increases output while running tests.
However, test failures are still at the bottom of the output, so it
shouldn't cause much pain, if any.
Change-Id: Id1ad26bc9670efa94c3c91142a177c75a12ce7d6
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 keystonemiddleware.
Change-Id: Ic181afad5bf3dd89a2edfdf9fb3026f85cdc37a6
Oslo-incubator has been deprecated. The only thing that we use from it
is the memorycache which is hopefully going away soon. Copy this
memorycache code into the _cache module so that we can refactor it as
necessary without worrying about oslo-incubator.
Involves some minor cleanups for pep8 fixes and making functions
private.
Change-Id: I7a19d4ded8b538b6ea02e4a08068c863705194a3
PEP257's D203 check ensures that you have a blank line before class
docstrings. This rule directly conflicts with D211 (no blank lines
before class docstrings), which is intended to supersede D203.
The original language in PEP257 which D203 was based on was actually
removed from PEP257 by Guido here:
https://hg.python.org/peps/rev/9b715d8246db
Change-Id: Icc048b947acea8f655d00540c221123b906e7545
Currently tox ignores D204, D209 and D301:
D204: 1 blank line required after class docstring.
D209: Multi-line docstring closing quotes should be on a separate line.
D301: Use r""" if any backslashes in a docstring.
This change makes keystonemiddleware docstrings compliant with D204.
D209 and D301 is already passing, so this commit also enables them.
Change-Id: I11e02ef5af7fc793f1a2438e091bbfb18618a7f5
Currently tox ignores D400:
D400: First line should end with a period.
This change makes keystonemiddleware docstrings compliant with D400.
Change-Id: Icff2b744d72ae74492cfc6515b91f393fa2b50bf
Currently tox ignores D401 and H403:
401: First line should be in imperative mood.
403: multi line docstrings should end on a new line
This change makes keystonemiddleware docstrings compliant with D401.
H403 is already passing, so this commit also enables it.
Change-Id: I9471721220c99f9c4ed055840ed626bb7750eb3f
PEP257 (https://www.python.org/dev/peps/pep-0257/) aims to "standardize
the high-level structure of docstrings: what they should contain, and
how to say it (without touching on any markup syntax within docstrings).
The PEP contains conventions, not laws or syntax."
By having this flake8 extension installed as we do in other keystone
repositories, keystonemiddleware will be automatically gated against
PEP257 docstring conventions. Of course, we're also violating several
conventions here, all of which must be ignored to get the pep8 tox job
passing.
By fixing violations one at a time, we can then remove the ignore lines
in subsequent patches.
Change-Id: Icb329b7fb42172245a635d7c089858d66a6a19da
This patch removes the bandit.yaml and just uses the defaults. As
such there are a few flagged issues that needed correcting.
The hits are now marked with "# nosec" so that they'll be ignored
since the hits were not security-related.
Co-Authored-By: Brant Knudson <bknudson@us.ibm.com>
Co-Authored-By: Eric Brown <browne@vmware.com>
Change-Id: Ib253a4a21156b6606c356ade46c72c6ace01a1af
The bandit project uses an integration test to ensure it doesn't
break other projects by introducing new changes. To run this
integration, it is necessary to have a common tox target of
'bandit'.
Change-Id: I9b80043bde45cfec472402ddab1747d5b2f87da1
According to the PTI (=Python Test Interface,
http://governance.openstack.org/reference/cti/python_cti.html), pep8
is the interface for codestyle checks. Move all tests from linters to
pep8 and remove linters environment.
Change-Id: I9ed8a0504c05681f96a9ad8b81c4dbaeba56c62f
Depends-On: I9346e4bf8c3a50de088c6a157f0d871c0a9333a1
bandit is now part of linters environment, remove it from tox.ini.
Change-Id: Idf05e6c85c3f701319f84acc5e2414b2aa83e0e0
Depends-On: I849cab5461b7b6f483fc5967b50736e0ba30e705
Create new linters environment consisting of pep8 and bandit.
Keep pep8 as an alias for linters and add a message when invoked.
Once this change is in, the infra job can be changed to only run
linters job, this allows to run one less job for each change.
Change-Id: Idff7d7134c50aa4740ed87eeeda83f7cca32f3db
We'd like to use the same "gate" profile for all OpenStack gate jobs,
so the "keystone_conservative" job which we were running as part of
the gate is change to "gate.
The other profiles that aren't used as part of the gate are removed.
Change-Id: I3dac68804bfa4930ac0dc6b4edeedd888577f3e5
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: I6616835bc5e13b07f79be584c4306e2573a002d8
Closes-Bug: #1489059
as mentioned in the mailing list, we need to include release notes
for libraries, note that we do not include changes for liberty.
Change-Id: I02f413a2ac410ce4c3dc7d46c7edb3c87d0d13b3