Commit Graph

69 Commits

Author SHA1 Message Date
Stephen Finucane 3f12bc6e33 tox: Trivial formatting changes
Change-Id: I8870cf849aec9d4bd1e59d911704ec2e4cabe09e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-06-27 18:03:29 +01:00
Stephen Finucane 626df3a5e9 Make tox.ini tox 4.0.0 compatible/fix gate
* 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>
2023-06-27 18:03:28 +01:00
Dave Wilde dc0b796495 Fix pep8 gate
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
2022-12-09 10:28:06 -06:00
Takashi Kajinami 0ed46ac125 Bump tox minversion to 3.18.0
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
2022-07-25 18:51:04 +00:00
Ghanshyam Mann d60ccd46b9 Drop lower-constraints.txt and its testing
As discussed in TC PTG[1] and TC resolution[2], we are
dropping the lower-constraints.txt file and its testing.
We will keep lower bounds in the requirements.txt file but
with a note that these are not tested lower bounds and we
try our best to keep them updated.

[1] https://etherpad.opendev.org/p/tc-zed-ptg#L326
[2] https://governance.openstack.org/tc/resolutions/20220414-drop-lower-constraints.html#proposal

Change-Id: Ifb9dc54424256d5cffe557894b2d26b2401ebf92
2022-04-30 20:20:34 -05:00
Andreas Jaeger f32fcc6623 Update hacking for Python3
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
2020-03-30 10:32:07 +00:00
Vishakha Agarwal bf39733017 [ussuri][goal] Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in ussuri cycle.

keystonemiddleware is ready with python 3 and ok to drop the
python 2.7 support.

Complete discussion & schedule can be found in
- http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Change-Id: Ia6f0e14efd19b0b98227258e7264b4850a197f4f
2020-01-07 09:31:56 -05:00
Zuul 46691c605b Merge "Update the constraints url" 2020-01-02 18:58:57 +00:00
Vishakha Agarwal 381e81cfb2 Generate pdf documentation
Change-Id: I4bc8c036ce91795129970ab4f8c2536401c2a135
2019-09-27 17:43:03 +00:00
pengyuesheng f1856a0394 Update the constraints url
For more detail, see http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: I89648da5b9e8579d3ef40b840fb81c76596a785a
2019-09-20 16:52:36 +08:00
Corey Bryant 2d3765ed56 Add Python 3 Train unit tests
This is a mechanically generated patch to ensure unit testing is in place
for all of the Tested Runtimes for Train.

See the Train python3-updates goal document for details:
https://governance.openstack.org/tc/goals/train/python3-updates.html

Change-Id: Iae72e055b0f407c1643b6c6161af28b535712a7d
Story: #2005924
Task: #34215
2019-06-26 18:44:50 -04:00
Vishakha Agarwal dd43941a7e Update the min version of tox
In Train, we will use python3.6 and 3.7 for
which the minimum tox version required is 2.5[1]

[1]https://tox.readthedocs.io/en/latest/changelog.html#v2-6-0-2017-02-04

Change-Id: I3110e024268ca989e5b09d3dc087087f2d1b1f6f
2019-04-09 14:56:23 +05:30
Zuul b22dd1cd82 Merge "Fix debug tox environment" 2019-03-06 19:05:57 +00:00
Vishakha Agarwal c706ceb014 Drop py35 jobs
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
2019-03-01 11:37:06 +01:00
Colleen Murphy a2f04771f6 Fix debug tox environment
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
2019-02-28 21:16:35 +01:00
Colleen Murphy d381514873 Add py36 tox environment
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
2018-11-06 12:56:44 +01:00
Lance Bragstad 9a6875d479 Remove tox_install.sh
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
2018-09-07 13:26:57 +10:00
Zuul d1b7a1f092 Merge "fix tox python3 overrides" 2018-06-07 00:00:12 +00:00
Zuul c5171adb2b Merge "Follow the new PTI for document build" 2018-06-06 22:13:59 +00:00
Doug Hellmann 29ef02a51d fix tox python3 overrides
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>
2018-06-06 16:55:25 -04:00
melissaml a451b28c43 Follow the new PTI for document build
For compliance with the Project Testing Interface as described in:
https://governance.openstack.org/tc/reference/project-testing-interface.html
http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html
http://lists.openstack.org/pipermail/openstack-dev/2018-March/128594.html

Co-Authored-By: Nguyen Hai <nguyentrihai93@gmail.com>
Change-Id: Ia0a27229f09467980ff4af014001febb017bb36d
2018-06-06 15:22:22 +00:00
Colleen Murphy e734468fdf Switch coverage tox env to stestr
We already switched the unit tests to follow the updated PTI
guidelines[1] but neglected to switch the coverage environment. Do that
now.

[1] https://governance.openstack.org/tc/reference/pti/python.html#python-test-running

Change-Id: Ie153516196f18c030ea58e76a0eac15c86169c6b
2018-05-31 08:02:35 -07:00
Doug Hellmann cc9a7e27d1 add lower-constraints job
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>
2018-04-09 10:18:34 -04:00
Colleen Murphy ba9c1a3bec Fix docs builds
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
2017-12-20 00:39:46 +01:00
Tin Lam 2fd802745d Updates for stestr
Per changes to os-testr [1], this patch set updates the code to leverage
stestr and exclude the newly generated .stestr directory

[1] http://lists.openstack.org/pipermail/openstack-dev/2017-September/122135.html

Change-Id: Ic4713af0ad888bd2ca669a5e9de5e9212255e970
2017-10-02 21:57:27 -05:00
liuxiaoyang 31be1c5ad3 Add doc8 rule and check doc/source files
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
2017-08-26 20:18:57 +00:00
iswarya_vakati 04052686af Pass located tests directory in oslo debug
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
2017-03-13 11:02:34 +00:00
Eric Brown 0c1dee4a9d Remove references to Python 3.4
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
2017-01-05 15:30:50 -08:00
Lucas Alvares Gomes 53adca6deb Switch tox unit test command to use ostestr
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
2017-01-03 17:13:13 +00:00
Tony Breeds abaf1b5bf7 Add Constraints support
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
2017-01-03 09:13:38 -05:00
Jamie Lennox 41083a5dda Remove oslo-incubator
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
2016-07-05 10:52:34 +10:00
Steve Martinelli ef29dfce89 Use extras for oslo.messaging dependency
Install the oslo.messaging optional dependency by doing:

  keystonemiddleware[audit_notifications]

pbr documentation:

  http://docs.openstack.org/developer/pbr/#environment-markers

Partial-Bug: 1540115

Change-Id: I59eea1f7eb0e770ac4fe30211eff49ae76fb2550
2016-06-28 23:56:47 +00:00
Dolph Mathews 2387f9b057 PEP257: Ignore D203 because it was deprecated
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
2016-06-03 08:50:23 -05:00
Dolph Mathews c801117ef4 Fix D105: Missing docstring in magic method (PEP257)
Change-Id: If4c48aa3f37093295d3d934343c4f28e40c21af0
2016-05-17 00:23:55 +00:00
Dolph Mathews a2afaa9434 Fix D200: One-line docstring should fit on one line with quotes (PEP257)
Change-Id: Icd658499de092e58fca1344c6ab3bc5aebcba7ff
2016-05-17 00:23:48 +00:00
Dolph Mathews ee73f702a3 Fix D202: No blank lines allowed after function docstring (PEP257)
Change-Id: I634dc4b1dd8fcbab05958d528888325451e2f930
2016-05-17 00:23:30 +00:00
Navid Pustchi ed931a00d8 Fix D204 PEP257 violation and enable D301 and D209
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
2016-05-06 16:36:15 +00:00
Navid Pustchi d7bf1a759d Fix D400 PEP257 violation
Currently tox ignores D400:
D400: First line should end with a period.

This change makes keystonemiddleware docstrings compliant with D400.

Change-Id: Icff2b744d72ae74492cfc6515b91f393fa2b50bf
2016-05-06 14:47:41 +00:00
Navid Pustchi 92983b1da8 Fix D401 PEP257 violation and enable H403
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
2016-05-05 15:52:26 +00:00
Dolph Mathews 45a0d08532 PEP257: add flake8-docstring testing
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
2016-04-13 01:14:44 +00:00
Brant Knudson 45136e0580 Remove bandit.yaml in favor of defaults
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
2016-03-09 09:45:47 -08:00
Eric Brown ead6061545 Add back a bandit tox job
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
2016-02-17 14:08:22 -08:00
Andreas Jaeger 4c0c5ce970 Make pep8 *the* linting interface
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
2016-02-10 21:16:10 +01:00
Andreas Jaeger 9ea26df343 Remove bandit tox environment
bandit is now part of linters environment, remove it from tox.ini.

Change-Id: Idf05e6c85c3f701319f84acc5e2414b2aa83e0e0
Depends-On: I849cab5461b7b6f483fc5967b50736e0ba30e705
2016-01-21 19:53:18 +01:00
Andreas Jaeger 63f0fc3e61 Merge pep8 and bandit into linters
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
2016-01-21 19:52:26 +01:00
Brant Knudson 1200d7a24d Bandit profile updates
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
2016-01-13 11:47:37 -06:00
Ondřej Nový 7585fec53c Deprecated tox -downloadcache option removed
Caching is enabled by default from pip version 6.0

More info:
https://testrun.org/tox/latest/config.html#confval-downloadcache=path
https://pip.pypa.io/en/stable/reference/pip_install/#caching

Change-Id: I3ed12906fe1732c1a8c6a70add15a1d54fb29080
2015-12-11 21:18:38 +01:00
Dave Chen ecc52be445 Put py34 first in the env order of tox
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
2015-12-03 11:57:36 +08:00
Steve Martinelli c04ca5b1af Add release notes for keystonemiddleware
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
2015-11-29 20:04:01 -05:00
Jenkins 86d8c8de34 Merge "Address hacking check H405." 2015-11-27 02:58:32 +00:00