Commit Graph

87 Commits

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

The independent bandit target was removed because it's integrated to
the pep8 target.

Co-Authored-By: Stephen Finucane <sfinucan@redhat.com>
Change-Id: I0c9ca1f9310820c83667bffa2d1287d3daffccbc
2024-02-01 02:37:23 +09:00
Takashi Kajinami e159cfd424 Bump hacking
hacking 3.0.x is too old.

Change-Id: I665eb5f8aa70863ac5750d2162ddc7a053444b56
2024-01-26 01:17:39 +09:00
Hervé Beraud 7281cb96c1 Bump bandit
Change-Id: I3d594ef953b9d7bea0bad2b1459e1a30d58c20e6
2023-05-19 15:57:59 +02:00
Hervé Beraud 71122a0cca Adding pre-commit
Introduced changes:
- pre-commit config and rules
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commithooks.
- 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: Iba1e2ce707051ea393ac559fc51b1f07da1f6ee8
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-09 13:38:50 +02:00
Moisés Guimarães de Medeiros 2aaaf38611 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: I7b3144bd417f29cd57c16575ba47b45a4132aae7
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-07-24 17:37:03 +02:00
zhangboye 64cbef8da6 Fix hacking min version to 3.0.1
Change-Id: I95fd7fa65018dd3a887889ef11a88c63eaee74cf
2020-05-22 10:42:58 +08:00
Zuul af89f7053f Merge "Use unittest.mock instead of third party mock" 2020-04-06 15:12:09 +00:00
Andreas Jaeger d90726a1eb Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Remove hacking and friends from lower-constraints, they are not needed
for installation.

Change-Id: I3f23bf09ef24fe34e128102c34382da98e10f5c1
2020-04-02 15:10:56 +02:00
Sean McGinnis 2163443d8a
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: I4c5451afece8dfff30aa1ec4c7e0d5eb277043fd
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-03-31 14:39:24 -05:00
Ben Nemec 3ed4676f93 Cap Bandit below 1.6.0 and update Sphinx requirement
Bandit 1.6.0 accidentally changed how the exclusion list option is
handled and breaks our use of it. Cap to the previous version until
Bandit has fixed the problem.

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

Change-Id: I719a8cff50dcc0dea62db14edf7b9ab35b72facd
Reference: https://github.com/PyCQA/bandit/pull/489
2019-05-15 15:56:42 +00:00
ZhijunWei 1803b63823 Update hacking version
Use latest release 1.1.0 and compatible changes w.r.t pep8

Change-Id: Ide3a556918f341de6eafecb36ca431da40a0aed0
Closes-Bug: #1815715
2019-02-13 14:28:34 +08:00
Zane Bitter cc8b51e1e1 Fix race condition in eventletutils Event
The threading-compatible eventlet Event class has a race condition on
the wait method. If greenthread A is blocked on the wait, but another
greenthread B calls clear() and then set(), B calls self._event.send(),
but A is waiting on a different eventlet Event which is no longer used
by the oslo.service Event...

To resolve this, when clearing an Event trigger the underlying eventlet
Event immediately, then have the wait() method resume waiting on the new
eventlet Event.

Change-Id: I81579e2977bb965a5398a2cb4e3e24f5671e856a
Co-Authored-By: Victor Stinner <vstinner@redhat.com>
Co-Authored-By: Hervé Beraud <hberaud@redhat.com>
Closes-Bug: #1805706
2018-12-05 20:06:39 +13:00
Vu Cong Tuan 0812f94a23 Switch to stestr
According to Openstack summit session [1],
stestr is maintained project to which all Openstack projects should migrate.
Let's switch to stestr as other projects have already moved to it.

[1] https://etherpad.openstack.org/p/YVR-python-pti

Change-Id: Ica0262653e8c18681d049acca6d5920ac38f97e6
2018-07-04 08:28:15 +07:00
OpenStack Proposal Bot 36afeffc7e Updated from global requirements
Change-Id: I68a6de52dc412e026f8611052208afdc293f4069
2018-03-15 07:51:35 +00:00
OpenStack Proposal Bot 1efa197e5d Updated from global requirements
Change-Id: I73293123611d79ed3dad7ff6475c07b97f742cc9
2018-01-16 04:28:00 +00:00
Zuul e3e0bd0e7d Merge "Follow the new PTI for document build" 2018-01-03 15:35:27 +00:00
malei 717e5dd3f7 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: If17dfc040d87981ed0a46abbe25e3d09f6e38e46
2018-01-03 00:25:29 +08:00
ChangBo Guo(gcb) 2ba0aa94a0 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: I3d86f1897dc900ba815c0c3975e95e27bb29b532
2017-12-20 17:34:50 +08:00
Zuul 58fb709f58 Merge "Add method validate_integer" 2017-12-05 19:38:06 +00:00
OpenStack Proposal Bot 9359017e0c Updated from global requirements
Change-Id: Ic6136f13d0eda06c3cf98f3aa0c148a13d3cbe75
2017-11-29 09:16:01 +00:00
OpenStack Proposal Bot 805f4a7c9e Updated from global requirements
Change-Id: Iec6b77a93b4651695affbe570b2c50f19798c225
2017-11-16 11:22:07 +00:00
bhagyashris ccbeeea5da Add method validate_integer
Method validate_integer() is used in Cinder[1], Nova[2] and
Masakari[3].
So it's a good candidate to add this method in Oslo.utils.

[1] https://github.com/openstack/cinder/blob/master/cinder/utils.py#L1032
[2] https://github.com/openstack/nova/blob/master/nova/utils.py#L846
[3] https://github.com/openstack/masakari/blob/master/masakari/utils.py#L244

Change-Id: I9086b9057e24aa4747a81507ab14aad60e39ab40
2017-09-29 09:23:34 +05:30
OpenStack Proposal Bot 473013f7f1 Updated from global requirements
Change-Id: I6ec98117a03224efe0a7a9fbed6293cea0cd9982
2017-09-20 16:23:26 +00:00
OpenStack Proposal Bot 08e52a1101 Updated from global requirements
Change-Id: I6a497f6c3038717eea89f2c9e997f142f7a9657b
2017-09-11 21:47:29 +00:00
OpenStack Proposal Bot 8e16e6083c Updated from global requirements
Change-Id: I02e5e76f8596e21cb229038276b14dd10b2ef0c4
2017-08-18 11:40:27 +00:00
OpenStack Proposal Bot 0004e256e2 Updated from global requirements
Change-Id: Ic1b1d2706b92ac7f20fc76576762b4da553dd435
2017-07-27 19:20:00 +00:00
Akihiro Motoki d14dfdf5c4 switch from oslosphinx to openstackdocstheme
Change-Id: Ief1b96ec6d08552f285540a68994c70cc9af3098
2017-07-01 21:05:48 +09:00
OpenStack Proposal Bot 98ae7d5c2d Updated from global requirements
Change-Id: Ia3a3874dbd3c76716a97899967ef15c04d7fae2e
2017-06-27 12:20:36 +00:00
OpenStack Proposal Bot 6c565f2295 Updated from global requirements
Change-Id: If29cd52629b0c2d1df84fcb52fa3dfe4a4680606
2017-06-15 16:33:18 +00:00
OpenStack Proposal Bot 15e014063c Updated from global requirements
Change-Id: Ib6a72c4dd0803ac0578e5b136cf84267de2fdf5e
2017-06-02 22:05:43 +00:00
OpenStack Proposal Bot 4ef372b7a4 Updated from global requirements
Change-Id: Idcf31dff3714eaf5134ac58d17a1d5885c7d7ecc
2017-06-02 02:35:23 +00:00
OpenStack Proposal Bot e4912e1ec6 Updated from global requirements
Change-Id: I5e4241f321a43ffb69e7da83d030cb09c6252ad8
2017-05-17 03:56:57 +00:00
OpenStack Proposal Bot 9e913db6ad Updated from global requirements
Change-Id: I3a8470b683b6e856b906d525fc6a085d0e6ee442
2017-05-15 00:53:14 +00:00
OpenStack Proposal Bot bd99002339 Updated from global requirements
Change-Id: Ib03ae9bfbc080421a4eb7bbba4edbae04cb00eca
2017-03-13 19:40:22 +00:00
OpenStack Proposal Bot 0d7f387574 Updated from global requirements
Change-Id: I16ce7840503273a0a1c545123930e2c65ab04276
2017-03-03 00:03:24 +00:00
ricolin da7899ffba [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: Iae0d1394c2596a9c188531015c950de6108c7acb
2017-03-02 18:23:32 +08:00
OpenStack Proposal Bot d74b933801 Updated from global requirements
Change-Id: I7ba38fff9ff21765b7fac1618005dd003f797594
2017-02-10 05:58:02 +00:00
OpenStack Proposal Bot a6585b5ef1 Updated from global requirements
Change-Id: Iac0d856b42f6289fd7d4aa9d332a54e865270e3b
2016-11-02 15:39:30 +00:00
Jenkins 042374d741 Merge "Add reno for release notes management" 2016-11-02 03:50:22 +00:00
OpenStack Proposal Bot 8bbf09e6da Updated from global requirements
Change-Id: I456f3e45481415d95261b18cd5a20a1aaa7de389
2016-11-01 13:34:23 +00:00
ChangBo Guo(gcb) a5a40aca7d Add reno for release notes management
Closes-Bug: #1634356

Change-Id: I6462e42df2a28cd63d6059ef5320cec3ca1473d9
2016-11-01 15:43:10 +08:00
OpenStack Proposal Bot dfefb46a79 Updated from global requirements
Change-Id: Ia5261e6fcd08649f0b3e4a85082d59847f0d828b
2016-10-22 01:26:17 +00:00
OpenStack Proposal Bot c28347d9d1 Updated from global requirements
Change-Id: I88aa3788933e496031c4a772daa5ad8b6e9b8093
2016-09-28 16:59:52 +00:00
OpenStack Proposal Bot c95229cc2b Updated from global requirements
Change-Id: I154ae5bf00ae6f7b965e67d98bd0dd23ca4352bc
2016-09-27 10:06:39 +00:00
OpenStack Proposal Bot 402a6e6186 Updated from global requirements
Change-Id: Icfaff6feda793bfd4b495e3898a214ba79bf2981
2016-08-18 05:56:03 +00:00
OpenStack Proposal Bot 06ff3e367b Updated from global requirements
Change-Id: I02a0ce99c358cc92e33bb5a419f33fb9f9470443
2016-08-04 02:40:58 +00:00
Swapnil Kulkarni (coolsvap) c5918adcea Remove discover from test-requirements
It's only needed for python < 2.7 which is not supported

Change-Id: Iea5e3c9c64672eeef59e9cb6cefdf161b55721d8
2016-07-22 06:41:00 +00:00
OpenStack Proposal Bot b9e9f17c4b Updated from global requirements
Change-Id: I455892333110709485d568ea30049a3c6d29941b
2016-07-09 03:16:26 +00:00
OpenStack Proposal Bot 5b8de1c41d Updated from global requirements
Change-Id: I4863ef81ab4ed9b6c57a3fe965f06e342451c9ac
2016-06-22 05:47:10 +00:00
OpenStack Proposal Bot dfdaaa2e31 Updated from global requirements
Change-Id: I8526da9d6aa4b6b40a688f8c06c541eda2d4b203
2016-06-03 18:18:16 +00:00