Commit Graph

105 Commits

Author SHA1 Message Date
Takashi Kajinami 311a6011fb Remove old excludes
These are detected as errors since the clean up was done[1] in
the requirements repository.

[1] 314734e938f107cbd5ebcc7af4d9167c11347406

Change-Id: Ib2e0865ebad1a74f702517956a6d25d8bf371fbf
2024-05-01 13:57:14 +09:00
Takashi Kajinami d85300476f Bump hacking
hacking 3.0.x is too old.

Change-Id: Iebcae312b2776a17ca6164c2c879f7ba8a683808
2024-01-16 22:24:36 +09:00
Hervé Beraud 3dff974eea Bump bandit and make oslo.config compatible with latest rules
Apply a timeout to requests calls to avoid uncontrolled
resource consumption (CWE400) [1].

[1] https://cwe.mitre.org/data/definitions/400.html

Change-Id: I9e3c1e5f98e2ecfb5564d8dbd608d19d4a66cfce
2023-05-17 11:19:22 +02:00
Hervé Beraud 5e1011a630 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: I65a40bbff17d92b959764846801d5e0ddd3b97ce
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-22 12:25:01 +02:00
Moisés Guimarães de Medeiros fcb88941e3 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: Iec3897279cf81f951225f463450c6a1efd028b0b
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-07-24 17:32:21 +02:00
Zuul ad1eb1be0a Merge "Raise hacking minimum to 3.0.1" 2020-05-25 13:20:17 +00:00
Sean McGinnis 8242416801
Raise hacking minimum to 3.0.1
This raises hacking to a newer version, fixes a few issues the newer
version uncovered, and removes the cap for flake8 to allow that version
to be controlled by the hacking constraints.

Change-Id: Ie550119322bca3c217e4a74eca789f156cfa7e2c
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-05-19 15:15:53 -05:00
Zuul 23c6a81689 Merge "Cap flake8 to be < 3.8.0" 2020-05-14 21:15:45 +00:00
Sean McGinnis b1836ad4d2
Cap flake8 to be < 3.8.0
The 3.8.0 version introduces some checks that cause failures with the
current code. To avoid that, this caps flake8 to a version that had been
tested withouth errors so hacking does not pull in a newer version.

We will likely want to raise hacking to 3.x and drop this cap, but to
make it easy to backport to stable branches, taking this approach first.

Change-Id: I2a539263e8cfc7d15243d78e20b70b8ed763b8fd
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-05-12 11:22:03 -05:00
Sean McGinnis 66b3da9689
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: I2f8067eeb2aec62f098bfbb3770a67f1876ce7a2
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-03-31 14:40:09 -05:00
Stephen Finucane 5a5cf72c64 mypy: Add boilerplate configuration
Add the requirement, tox job, and basic configuration.

Change-Id: I3a865255ee731a27a00e7653557099fb99096486
2020-02-12 09:56:58 +00:00
Stephen Finucane 81589565ba Switch to hacking 2.x
This bumps the version of flake8 and pycodestyle to something much
newer, which resolves a long-standing warning about nested sets and
allows us to use new fangled features like f-strings if we so choose.

Note that this requires some minor modifications to keep the 'pep8' task
passing.

Change-Id: I3af8eb490345a6152372730ca3e0a6702bf482ea
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-02-12 09:56:58 +00:00
Stephen Finucane 20a7cee3e3 Remove six
We don't need this in a Python 3-only world. We can't remove mock yet
since there's an issue with the stdlib variant in python3.6, but that is
called out.

Change-Id: I9657b1fd4409be90d645175a6e177d7e1d2ebac2
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-02-12 09:56:55 +00:00
caoyuan 8955b48620 Clean up the unnecessary sphinx from test-requirements.txt
1. Clean up the unnecessary sphinx from test-requirements.txt
2. when run `tox -e docs` in localhost, some files will be
created, it not belong to the code, shoule be ignore by the git

Change-Id: I2bae30fedfdc64fbbafbe0e96794597b564c2d54
2019-07-07 11:59:49 +08:00
Ben Nemec dc9b711a3f Add unit tests for validator
We need to bump our minimum version for mock to 3.0.0 in order for
mocking of 'open' to work correctly with the ConfigParser. From the
mock changelog: "Issue #32933: unittest.mock.mock_open() now supports
iteration over the file contents."

Change-Id: I9522083b7b0f785fe0e9cbdf8a9042112820bed4
2019-06-03 20:55:31 +00:00
Ben Nemec a6313baf65 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: Ib8da5b64084d5c9b7b7d896d6b7bb7844c0b9e90
Reference: https://github.com/PyCQA/bandit/pull/489
2019-05-13 19:58:03 +00:00
Stephen Finucane 0950403744 tox: Suppress output
As noted in I1678bcd26b41fdf09f98c36fc095d6d4c1826deb (for pbr), we need
to pass some flags [1] to stestr to ensure stdout is captured in
additional to any logs.

We also make it easier to override this capturing and remove some errant
whitespace.

[1] https://github.com/mtreinish/stestr/commit/1316ebd7

Change-Id: I5d98c2b8e31b4eb4741dfa5055a5628140b1add5
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2019-04-08 16:45:12 +02:00
Zuul 7e20214802 Merge "Cleaning testrepository occurrences." 2019-01-23 18:57:24 +00:00
Zuul f68723c702 Merge "Update hacking version" 2019-01-22 20:40:41 +00:00
Hervé Beraud 915cec3784 Cleaning testrepository occurrences.
Since we have migrate test to stestr we can remove testrepository
from imports and stop to ignore him.

Change-Id: I74a24f19268d39dbce42963c95a9f06ca9b3f014
2019-01-15 17:13:04 +01:00
Rui Yuan Dou 819534b20b Migrating oslo.config to use stestr
os-testr has moved over to use stestr instead of testr. While this
is usually compaible with existing settings, there is a warning
that is emitted when .stestr.conf is not present. It is usually
able to fall back to parsing the .testr.conf file, but to be more
correct and to prevent future problems we should update the config.

Change-Id: I929f75d069f20b8cfa8af4e0712883e91a54dc4f
2019-01-15 16:15:34 +08:00
ZhijunWei bdeb19d079 Update hacking version
Use latest release 1.1.0 and compatible changes w.r.t pep8

Change-Id: I2e0c41656384ddef603717224e9e146bc31be59b
2019-01-06 19:17:24 +08:00
Zuul 084ac31f4c Merge "Add config_source option" 2018-07-13 16:08:32 +00:00
Doug Hellmann e233fc58da Add config_source option
Define a config_source option that can be used to specify the
alternative sources that require drivers to load configuration
settings.

Co-Authored-By: Moises Guimaraes de Medeiros <moguimar@redhat.com>
Change-Id: Ibd5a6d306bb98d30d973dfe3604dcc0691d2e369
Blueprint: oslo-config-drivers
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-25 10:17:12 +02:00
Ben Nemec 5f8b0e0185 Optionally use oslo.log for deprecated opt logging
While we can't add a hard dependency on oslo.log because it uses
oslo.config, in most cases oslo.log will be installed anyway.  In
the interest of being able to make use of features like
fatal_deprecations in oslo.log, let's use it if it's available.

Change-Id: If9499aa6fc28a6b92447b3825d3ca1957cb2255a
2018-06-21 14:50:47 +00:00
Sean McGinnis 7d250abe04 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: I46a861f88166b3b2de0a532cc88beef1ef91ab89
2018-03-21 15:59:01 -05:00
OpenStack Proposal Bot 6e3c3828f4 Updated from global requirements
Change-Id: I7d6132e63e46a0bf9876efe29617f04941288cbc
2018-03-15 07:47:33 +00:00
OpenStack Proposal Bot 68e730e308 Updated from global requirements
Change-Id: I5b8b38df3ccd29437b07118f9dc128be3d8444cc
2018-01-24 01:24:58 +00:00
OpenStack Proposal Bot c18ac34f5b Updated from global requirements
Change-Id: I462d3e858b277ebc81d189c38b7c324593a9a541
2018-01-18 03:23:05 +00:00
OpenStack Proposal Bot 2ca79ed2ed Updated from global requirements
Change-Id: I51e5c89e3f6922af82636e30193863d8ca21f5a0
2018-01-16 04:26:36 +00:00
OpenStack Proposal Bot 32b073cc98 Updated from global requirements
Change-Id: Idc5253c597b9ad5f445df0bc73a2779409ab3f6a
2017-11-16 11:21:02 +00:00
melissaml 9fa6bc6252 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: Ica73d034bae8235927efe3d5176b58ab95755f0a
2017-09-25 20:48:18 +08:00
OpenStack Proposal Bot e6749d3208 Updated from global requirements
Change-Id: I5e24fa93d46149c2219b92ce6ada28c1392ea85b
2017-09-21 21:43:34 +00:00
OpenStack Proposal Bot 393275fadb Updated from global requirements
Change-Id: I0ec640ea8651d684e71229098581c948b1857508
2017-08-18 11:39:52 +00:00
OpenStack Proposal Bot add9464232 Updated from global requirements
Change-Id: I625d06c221ca2d5fa3466cdc2cacc2828a115723
2017-07-27 19:19:25 +00:00
OpenStack Proposal Bot 4b19d71cc9 Updated from global requirements
Change-Id: I7a7db4faa77394ef8180bc79cc039cdbc0338737
2017-07-06 14:02:31 +00:00
Doug Hellmann 675d62220c switch from oslosphinx to openstackdocstheme
Change-Id: I13211d11ae96a8bbc5f8bbb958473dbcf6e4c844
Depends-On: Ifc5512c0e2373cf3387e0e0498268eab092e52bb
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-29 14:35:34 -04:00
OpenStack Proposal Bot 4d0b52c475 Updated from global requirements
Change-Id: I16e4d425919b851ff3b7239bfe57b76fcacec862
2017-06-27 12:20:00 +00:00
OpenStack Proposal Bot d32af197a7 Updated from global requirements
Change-Id: Ibc157e9f292013703b0309b9e51f8c3df27c5658
2017-06-02 22:05:05 +00:00
ChangBo Guo(gcb) f0a915f596 Remove dependency oslo.i18n from test-requirements.txt
oslo.i18n is one of runtime requirements.

Change-Id: I77c7cb5e2d5a3c0f0c417db14de0fca2c69629ec
2017-05-24 17:54:36 +08:00
OpenStack Proposal Bot 741abca48e Updated from global requirements
Change-Id: I0c5efb33749823775358c2a5ea26c432615f4f62
2017-05-23 11:57:49 +00:00
OpenStack Proposal Bot ab3b8b69c3 Updated from global requirements
Change-Id: Id837615df6a245bdfe97633d7753e8d2560a9677
2017-05-17 03:56:27 +00:00
OpenStack Proposal Bot a8046b48a7 Updated from global requirements
Change-Id: I2a473829436ebb156937733f8533cd6b1827fb47
2017-05-15 00:52:42 +00:00
OpenStack Proposal Bot dcdce8f44e Updated from global requirements
Change-Id: I08b39bbde8378d75dce026e03bb708f661195069
2017-03-03 00:02:50 +00:00
ricolin 851e305c63 [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: I841d5073f8f84e2c0060fcdd4252d7c111c002e9
2017-03-02 18:13:10 +08:00
OpenStack Proposal Bot 572003b836 Updated from global requirements
Change-Id: Ifb013d09adb7a1fa045380e7bed71428a67790e3
2017-02-10 05:57:31 +00:00
OpenStack Proposal Bot a684d7b7fc Updated from global requirements
Change-Id: I844fd8d94cc5a77d2eb0c70ff23ef1ac959bcc36
2016-11-02 15:39:03 +00:00
OpenStack Proposal Bot 2096e72f72 Updated from global requirements
Change-Id: I1dfd0fd5415b7fabb90755bf8ca17f4b5c8da762
2016-10-22 01:25:52 +00:00
OpenStack Proposal Bot f578e99be8 Updated from global requirements
Change-Id: I0935962222cfa5c74c60b11fe4336c255e6b983c
2016-09-28 16:59:29 +00:00
OpenStack Proposal Bot 236defa3c3 Updated from global requirements
Change-Id: I27d8e927b1ba52130c23f23549675580a7eab914
2016-09-27 10:06:16 +00:00