Commit Graph

72 Commits

Author SHA1 Message Date
Takashi Kajinami a892465f19 pre-commit: Integrate bandit
We also remove these unnecessary linter dependencies from
test-requirements.txt.

Co-Authored-By: Stephen Finucane <sfinucan@redhat.com>
Change-Id: Ie797e48fb9d04649fa70e3d5c2f4161d123ed8f5
2024-02-06 15:18:54 +09:00
Takashi Kajinami de07539a7b pre-commit: Bump versions
hacking now has a native hook.

Co-Authored-By: Stephen Finucane <sfinucan@redhat.com>
Change-Id: Ib7af2d4299853e9758cbf148908aa1ef5de1b235
2024-02-06 15:17:51 +09:00
Takashi Kajinami 631b2f62dc Bump hacking
hacking 2.0.x or 3.0.x is too old.

Change-Id: If6b2d64febbf00814503eccd59dd9dadd330e0ba
2024-02-06 15:16:17 +09:00
Hervé Beraud bf52b05995 Bump bandit
Change-Id: I113d97b3719cce3c4c19c16ea7b8b395cc3beaa0
2023-05-19 14:45:39 +02:00
Gorka Eguileor 94b9dc32ec Fix logging in eventlet native threads
There is a bug in eventlet where logging within a native thread can lead
to a deadlock situation: https://github.com/eventlet/eventlet/issues/432

When encountered with this issue some projects in OpenStack using
oslo.log, eg. Cinder, resolve them by removing any logging withing
native threads.

There is actually a better approach. The Swift team came up with a
solution a long time ago [1], and in this patch that fix is included as
part of the setup method, but will only be run if the eventlet library
has already been loaded.

This patch adds the eventlet library as a testing dependency for the
PipeMutext unit tests.

[1]: 69c715c505

Closes-Bug: #1983863
Change-Id: Iac1b0891ae584ce4b95964e6cdc0ff2483a4e57d
2022-08-08 17:09:50 +02:00
Hervé Beraud ad42c89f3b Adding pre-commit
Introduced changes:
- pre-commit config and rules.
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commit hooks.
- Applying fixes for pre-commit compliance in all code.

Also commit hash will be used instead of version tags in pre-commit to
prevend arbitrary code from running in developer's machines.

pre-commit will be used to:
- trailing whitespace;
- Replaces or checks mixed line ending (mixed-line-ending);
- Forbid files which have a UTF-8 byte-order marker
  (check-byte-order-marker);
- Checks that non-binary executables have a proper
  shebang (check-executables-have-shebangs);
- Check for files that contain merge conflict strings
  (check-merge-conflict);
- Check for debugger imports and py37+ breakpoint()
  calls in python source (debug-statements);
- Attempts to load all yaml files to verify syntax (check-yaml);
- Run flake8 checks (flake8) (local)

For further details about tests please refer to:
https://github.com/pre-commit/pre-commit-hooks

Change-Id: I6663d5e0866e03f8eb8c0543d3e3e0bbfb2399ac
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-08 14:21:18 +02:00
Moisés Guimarães de Medeiros 9524df6bf5 Bump bandit version
This patch bumps bandit allowed version to >=1.6.0,<1.7.0 in order to
avoid the errors detailed here https://github.com/PyCQA/bandit/pull/393

Change-Id: Idca2a092bdfe762d23632e44e55be9290d692de8
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-07-24 17:34:01 +02:00
Sean McGinnis 2aaf7b08a6
Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I5587ac8f603798aad27908d3bd6ed8ebb3a9c14e
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-03-31 14:41:14 -05:00
Cyril Roelandt 0a66500081 Switch to hacking 2.x
Change-Id: I2c34c98ba6c927a0b1048e998ff50e063e94b481
2020-02-07 15:53:21 +01:00
Stephen Finucane 8c5317152b Avoid tox_install.sh for constraints support
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: I67c50430ced6efcc2f29ec7d8adc871415922d6f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-05-14 18:47:48 +02:00
Natal Ngétal 1d4c0f42f9 Cap bandit below 1.6.0 version and update sphinx and limit monotonic.
Bandit 1.6.0 accidentally changed how to exclusion list option is
handled and breaks our use of it. Cap to the previous version until
bandit has has fixed the problem.

Sphinx 2.0 no longer works on python 2.7, so need to start capping it
there as well.

Limit monotonic to python < 3.3 and reflect the changes to
openstack/requirements introduced
in change Ib8c1bf08f5fa7463911602b0df19315907c81e04.

Co-Authored-By: Stephen Finucane <sfinucan@redhat.com>
Co-Authored-By: Hervé Beraud <hberaud@redhat.com>

Change-Id: I4c2a19fae55e8cfea2d5ae9603a1fb086b5db1bf
2019-05-14 18:42:13 +02:00
ZhongShengping fa12452bbd 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

For more detials information, please refer to:

http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Change-Id: I10537cf02d83f127b6932fa3f427043fb267d8b1
Co-Authored-By: Stephen Finucane <sfinucan@redhat.com>
2018-08-10 16:01:51 -04:00
Stephen Finucane f6069e9e42 Migrate to stestr
This should both keep mtreinish happy and get rid of annoying 'db type
could not be determined' messages in one fell swoop.

Change-Id: I0db004a8c8d75359e7d08c73b82f98c62a7e5f7d
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2018-08-10 15:57:52 -04:00
Stephen Finucane d0cd199ce8 Fix lower-constraints job
Resolve the following warning:

  Package 'systemd-python' is used in systemd but not in
  lower-constraints.txt

Also fix the lower bounds to match the lower-constraints.txt list.

Change-Id: I84bf8ec53cd80f19598d1139d21d18b4f0cadddc
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2018-08-10 15:56:56 -04:00
OpenStack Proposal Bot bed1d627ff Updated from global requirements
Change-Id: I03da89b9a75c0be8a985507d557c7ec926517225
2018-03-15 07:48:47 +00:00
OpenStack Proposal Bot cf3d2d74ad Updated from global requirements
Change-Id: I42d98aec92c458b4cfec835d6cc51bf2f3b3ddca
2018-01-24 01:25:26 +00:00
OpenStack Proposal Bot 0212fb37ac Updated from global requirements
Change-Id: I5b8d9953d49fd586deabd8322cb97301a306ed5b
2018-01-18 03:23:39 +00:00
OpenStack Proposal Bot 1ffa37a03b Updated from global requirements
Change-Id: I0fe912721b1cdef30f8d508bd1a0cf9f20ab6546
2018-01-16 04:26:57 +00:00
malei e84f0e361c Cleanup test-requirements
python-subunit is not used directly anywhere
and it is dependency of both testrepository
and os-testr
(probably was used by some tox wrapper script before)

Change-Id: Iab08c9aacce00ad7f3325016c548f88247efc15b
2017-12-19 17:21:44 +08:00
OpenStack Proposal Bot fc624441f4 Updated from global requirements
Change-Id: I728effe49669c04a465d84ac3b3f78308cc5c29f
2017-11-16 11:21:21 +00:00
OpenStack Proposal Bot 0efa7f3d05 Updated from global requirements
Change-Id: I073b8fc1f3c4389883547f9f75e3bdbf53a1169e
2017-09-20 16:23:00 +00:00
OpenStack Proposal Bot 333de3817f Updated from global requirements
Change-Id: Ieca80410fdbe68cea0830daa2966bb24c5ec12dc
2017-08-18 11:40:02 +00:00
OpenStack Proposal Bot f58270519a Updated from global requirements
Change-Id: I22ae5eb2632485d2a3e4b229815c174088eec7e4
2017-07-27 19:19:36 +00:00
OpenStack Proposal Bot 4e9d16d30b Updated from global requirements
Change-Id: I9944f280fcca7ff76cd5ebbb7f21516af6cc7c22
2017-07-05 13:19:42 +00:00
Doug Hellmann 6e7b87c776 switch from oslosphinx to openstackdocstheme
Depends-On: Ifc5512c0e2373cf3387e0e0498268eab092e52bb
Change-Id: I890bc443bf07a4570c907668288176ff2411e4ed
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-27 17:18:33 -04:00
OpenStack Proposal Bot 33d76a5d29 Updated from global requirements
Change-Id: I1fa74fa0f2188aa765210f1e455a7bfde0c84098
2017-06-27 12:20:11 +00:00
OpenStack Proposal Bot 2f3c93dc37 Updated from global requirements
Change-Id: I39a505e5947d243d3821676fa16adf6411313884
2017-06-02 22:05:17 +00:00
OpenStack Proposal Bot 39a974d476 Updated from global requirements
Change-Id: Ia49f626bb9ca16c4133519dd5c425a956ae4a447
2017-05-17 03:56:36 +00:00
OpenStack Proposal Bot 84341f6201 Updated from global requirements
Change-Id: Ib841b7da7458dd77eadda3228463fa9db98bb2ff
2017-05-15 00:52:53 +00:00
ChangBo Guo(gcb) d8b3e634cc Trivial: Remove testscenarios from test-requirements.txt
We don't use testscenarios anywhere, need remove it.

Change-Id: I3128cc030587d167f4e903cf1951d29ac5fb9d5f
2017-03-28 23:32:26 +08:00
OpenStack Proposal Bot 7bbd4b530a Updated from global requirements
Change-Id: I831ed1b4d9b314eb0db6516d21cda8d504f1beb3
2017-03-03 00:03:04 +00:00
ricolin 901ab051aa [Fix gate]Update test requirement
Since pbr already landed and the old version of hacking seems not
work very well with pbr>=2, we should update it to match global
requirement.
Partial-Bug: #1668848

Change-Id: Id518983a40aba2ea7a11bfea0ac403073e6069bf
2017-03-02 18:27:05 +08:00
OpenStack Proposal Bot 2b2324e3a7 Updated from global requirements
Change-Id: If2b23abb43851282e25b3cfe71024ff0a6512556
2017-02-10 09:48:22 +00:00
OpenStack Proposal Bot 3de3f4927b Updated from global requirements
Change-Id: I4e69a36dc53e7664b60d4d4b54d6a387169ff5ca
2016-11-02 15:39:11 +00:00
OpenStack Proposal Bot adce78ce29 Updated from global requirements
Change-Id: I559ff96cb26cc30185c57b4d88edcf9b59b2c3af
2016-09-28 16:59:36 +00:00
OpenStack Proposal Bot 0b9d54c3d0 Updated from global requirements
Change-Id: I1562085b85a021be3c98879923e872fdc76e7af8
2016-09-27 10:06:23 +00:00
OpenStack Proposal Bot 573e049edd Updated from global requirements
Change-Id: I8e38b3cf9b69c1e01bf15d8147f3d26508371017
2016-08-18 05:55:50 +00:00
Thomas Bechtold 8cb90f4b16 Remove discover from test-requirements
It's only needed for python < 2.7 which is not supported

Change-Id: I2ef4e129417754af2ab6248fb583d8766b0db97d
2016-07-14 08:11:42 +02:00
OpenStack Proposal Bot 1bea3a5711 Updated from global requirements
Change-Id: Idaf7e02e723ddcbd7ea37eeac3c81700f37af470
2016-06-24 03:16:33 +00:00
OpenStack Proposal Bot 68bde95980 Updated from global requirements
Change-Id: Iacfb572244bc45256cc423f688b3b9e3f4764221
2016-06-21 18:04:24 +00:00
OpenStack Proposal Bot ea4b9d0105 Updated from global requirements
Change-Id: I66cdd51bbb8d3751275e616b681ad79913cb2f1a
2016-05-26 17:03:52 +00:00
OpenStack Proposal Bot 12f03d4cf6 Updated from global requirements
Change-Id: I337a1d80948419230721a63df4c279304ef6e074
2016-04-28 16:16:08 +00:00
OpenStack Proposal Bot 225828f690 Updated from global requirements
Change-Id: Id28e6727483257ec8ff5b536efa13a9892f1a958
2016-04-08 00:32:05 +00:00
OpenStack Proposal Bot d7d60c12dd Updated from global requirements
Change-Id: Ibecdbce63590935faebe56ec97190ff8447a03a5
2016-02-19 02:36:03 +00:00
Jenkins 8f6747911d Merge "Add reno for release notes management" 2016-02-18 20:49:12 +00:00
Ronald Bradford ad9f8fcddc Add reno for release notes management
Release notes now required to report removal of deprecated configuration
options from oslo.log.

Change-Id: I3649049a571490c5ec44a14a0c8640a4b747ad64
2016-02-11 18:26:08 +00:00
OpenStack Proposal Bot 7bf82600cc Updated from global requirements
Change-Id: Ic3926c7373a599ca00062c1b11bdee130e72c045
2016-02-04 18:58:59 +00:00
OpenStack Proposal Bot bb46ae8d48 Updated from global requirements
Change-Id: I1a6663c02e8efc7c3d32a9336684a78dd5e8d628
2016-01-16 03:31:13 +00:00
Cyril Roelandt b8be549a4a Add a 'bandit' target to tox.ini
All checkers are enabled, and we only need to silence one silence false
positive.

Change-Id: I829f2b2ef7e94b76b348c1e6ec6e4249009724c8
2015-11-20 19:53:21 +01:00
OpenStack Proposal Bot 06a770e2ee Updated from global requirements
Change-Id: Ia16ae491afe3b4564b158c1008e393d408041b91
2015-11-19 16:00:23 +00:00