Commit Graph

46 Commits

Author SHA1 Message Date
Takashi Kajinami 4c15915051 Bump hacking
hacking 3.1.x is too old.

Change-Id: I40369a5eef87cb6a356e059e005eb417ec67bb84
2024-01-26 01:21:59 +09:00
Hervé Beraud f78601fd8e Bump bandit and make oslo.versionedobjects compatible with latest rules
Change-Id: I3da9745c8f9f4b5832f41933af6f177b0f876bb5
2023-07-12 10:32:07 +00:00
Hervé Beraud e8b3a90978 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: I60e74ffcc7a4cc5bb80b19c3aae1b317442d93bd
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-22 12:29:04 +02:00
Moisés Guimarães de Medeiros 90e0c5b045 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: I005962a63341bb8585141dfe5dcff3ea79560b87
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-07-25 13:43:49 +02:00
Hervé Beraud b63d47d4ca Cap jsonschema 3.2.0 as the minimal version
Previous versions of jsonschema (<3.2.0) doesn't support python 3.8 [1].
Python 3.8 is part of the victoria supported runtimes [2] so we now force
to use jsonschema version 3.2.0 to avoid issues, remove ambiguity and ensure
that everything works with python 3 in general.

[1] https://github.com/Julian/jsonschema/pull/627
[2] https://governance.openstack.org/tc/reference/runtimes/victoria.html#python-runtimes-for-victoria

Change-Id: Id4d35c0a4bece51e4b51198123c875d302629e99
2020-05-26 22:10:06 +02:00
Andreas Jaeger d459c3fe4b Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.1.0 which
supports Python 3.

Fix problems found.

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

Change-Id: I810e4c30513746bc46a3e65b398539929a7ac6b0
2020-05-16 19:29:41 +02:00
Sean McGinnis 4d2310b2a9
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: I26f2df6d4657133a5c7e6ed85298aa843c1bdd73
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-03-31 15:56:19 -05:00
Stephen Finucane 298c5107eb Bump to hacking 2.x
This allows us to use a new version of flake8 that supports Python
3-only syntax. Existing issues are resolved.

Change-Id: I5de7e5cde6a5260f4e7e57586952256b59d3756d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-02-07 10:35:08 -08:00
Ben Nemec e46976c02f Cap Bandit below 1.6.0, update sphinx requirement, uncap jsonschema
Bandit 1.6.0 accidentally changed how the exclusion list option is
handled and breaks our use of it. Since we generally cap linters
and only move them forward when we're ready to deal with the fallout,
cap Bandit to the previous version until we have a reason to move to
a newer version.

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

The jsonschema cap was removed in g-r so we need to remove it here too.

Change-Id: Ie8f45e4130297b50a8e98031f3f01244e646bec7
2019-05-24 17:18:26 +00:00
ZhijunWei e2f25b563e Update hacking version
Use latest release 1.1.0 and compatible changes w.r.t pep8

Change-Id: Ie245c376f126b885dcf8e9bb250355f98613a6a4
2019-02-17 11:24:12 +08:00
Vu Cong Tuan 538bc761ce 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: I5c4d37afdc438cc978bff37e4d0c56c7ad60fb19
2018-07-04 08:12:19 +07:00
OpenStack Proposal Bot c06b430031 Updated from global requirements
Change-Id: I5ddcf6a1557c167f295ba72d6319d75e62c0e5df
2018-01-16 12:48:00 +00:00
ChangBo Guo(gcb) 16a6db4e9e Add bandit to pep8 job
Add the bandit security scanner to the pep8 job.
* convert assert statement to raise AssertionError
* skip B303

Change-Id: I0eb83dd6de80090562dd43bca4e5eb4e88e27bf9
2017-12-26 18:56:35 +08:00
ChangBo Guo(gcb) bd7090a108 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: Ib02738563f5ae3712e1074a3b08c693ea7cdea79
2017-12-21 17:18:16 +08:00
Andreas Jaeger f999996ed1 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: Ie2bf2618c8e202653a45cde195bd395ab7058dc1
2017-12-19 12:58:40 +01:00
OpenStack Proposal Bot 7e2540318e Updated from global requirements
Change-Id: Id25105b3f8438cb8e700d9ba593d393e8cd1a755
2017-11-16 11:22:12 +00:00
OpenStack Proposal Bot 93bd87e876 Updated from global requirements
Change-Id: I96367c9f761145e676aa3a9c79675a101ab0825d
2017-09-20 16:23:29 +00:00
OpenStack Proposal Bot bd51487cac Updated from global requirements
Change-Id: I7cda44ee7354453315314f6ca744c34861024c20
2017-09-11 21:47:32 +00:00
OpenStack Proposal Bot 82be977de1 Updated from global requirements
Change-Id: If2e121d71f16a14bea4a3e888464965bf340b6e2
2017-08-18 11:40:30 +00:00
OpenStack Proposal Bot 3f70a0a397 Updated from global requirements
Change-Id: I707485dc77b5bb4e587c2df6b745a5d465625872
2017-07-27 19:20:03 +00:00
Akihiro Motoki 464c9b62b8 switch from oslosphinx to openstackdocstheme
Change-Id: Ieadb6ebd1b2714a07cc5c479a1c13da43c95fabc
2017-07-01 21:02:48 +09:00
OpenStack Proposal Bot ec05ef405d Updated from global requirements
Change-Id: Ia1292c7e5a7e93e411fb9293bbb76994c7c308d7
2017-06-27 12:20:40 +00:00
OpenStack Proposal Bot 9926c0f9fa Updated from global requirements
Change-Id: I5baf1afe94f75ad126be61c0271f830be88e10db
2017-06-03 13:13:54 +00:00
OpenStack Proposal Bot ba00a61739 Updated from global requirements
Change-Id: I786194ae5640b3f22cf19375d7917cc96fed5da7
2017-05-17 03:56:59 +00:00
OpenStack Proposal Bot 9f4da6b2b5 Updated from global requirements
Change-Id: I65cb89dbb0d4962dc3b18880f608f52754af4221
2017-05-15 00:53:17 +00:00
OpenStack Proposal Bot cd3573ea1f Updated from global requirements
Change-Id: I285fef08182902a7b42f9eff7754859198d1b46b
2017-03-03 00:03:27 +00:00
ricolin 40ecb9e20e [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: I1af28a757450789f0f523847831b42e016f785fd
2017-03-02 18:30:36 +08:00
OpenStack Proposal Bot a70f76cfd5 Updated from global requirements
Change-Id: Idab00464bc9b4fd1811dfd1238169250ec97041e
2017-02-10 09:48:44 +00:00
ChangBo Guo(gcb) 71de5fd023 Add reno for release notes management
The release management team have indicated this is their preferred way
to collect release notes in future.

Closes-Bug: #1634356

Change-Id: Iac926d87064af92ea7e2e8eb24c72effca2641bc
2016-11-03 14:43:46 +08:00
OpenStack Proposal Bot 04a1c4392a Updated from global requirements
Change-Id: Icdfb7391a047389cde84921b7c2e407f676915f8
2016-10-22 01:26:20 +00:00
Jenkins 31bf557198 Merge "JSON Schema get_schema implementation for last few fields" 2016-10-17 03:35:02 +00:00
OpenStack Proposal Bot 98b7be2c58 Updated from global requirements
Change-Id: Idf3aa9fd63f8b192ab105200040cabe1026eb238
2016-09-28 16:59:54 +00:00
Julian Sy 5b44fafe6a JSON Schema get_schema implementation for last few fields
This implements the get_schema() method of the following FieldType:
Object, IPV6Address, NonNegativeInteger, NonNegativeFloat,
IPV4AndV6Address, Dict(fixed from last patch)

implements bp json-schema-for-versioned-object

Change-Id: I6bce3ba7bb32ed2dd8ed6e7f313411bbfef5eff0
2016-09-26 19:23:07 +00:00
OpenStack Proposal Bot f5fdfc2f51 Updated from global requirements
Change-Id: Ic70fb3e311a009fbcd02cae076cbcf3b552c0a9b
2016-06-21 18:04:42 +00:00
OpenStack Proposal Bot b58f864315 Updated from global requirements
Change-Id: I8b56ce0767399dfccaddb48965a3b2b5a2a9df1b
2016-01-16 03:31:33 +00:00
OpenStack Proposal Bot 687db68879 Updated from global requirements
Change-Id: I038551f901e640924e576adc0cf02493081c0572
2015-11-19 16:00:42 +00:00
Ronald Bradford 9393cd451c Fix coverage configuration and execution
A number of configuration errors prevent the successful creation of code
coverage. This corrects the .coveragerc source/omit setup and the tox
package name generation.

Change-Id: Ie55159304b8633acd6b06ba94d0cb8507a337504
2015-10-01 19:54:59 +00:00
OpenStack Proposal Bot db095dd773 Updated from global requirements
Change-Id: I872d7430c322de77215471b494039a8adfd84fb5
2015-08-04 00:57:08 +00:00
OpenStack Proposal Bot 15a29107b7 Updated from global requirements
Change-Id: I21b5aaaf59b89c179118c648d9a1d274322b99d1
2015-07-29 03:50:12 +00:00
OpenStack Proposal Bot 0cb1af7d97 Updated from global requirements
Change-Id: I147bb8b7a5eea1bff9f68fb2484509a8194b4150
2015-07-15 01:36:50 +00:00
OpenStack Proposal Bot e7918611bb Updated from global requirements
Change-Id: Ib4c5594751b7fda4470cc3c13b865e6fef567a12
2015-06-22 08:27:22 +00:00
Doug Hellmann 23d15eb8fc Uncap library requirements for liberty
Change-Id: Ifa56f9f6d721b06e8e725e6ebaaca0310ce4d4c5
Depends-On: Ib948b756b8e6ca47a4c9c44c48031e54b7386a06
2015-04-16 18:10:19 +00:00
Doug Hellmann 29ac0fcaae Update to the latest version of hacking
Update the version of hacking to the one released for kilo, and fix
issues with code formatting that cause the new hacking checks to fail.

Change-Id: I4c9906df3e71f33b5a13e1f68584d445d79daceb
2015-04-03 14:08:13 +00:00
OpenStack Proposal Bot 2ccb13a3f1 Updated from global requirements
Change-Id: I9a217c16951d52eed2c326aec2ccd11af39240a4
2015-03-21 00:17:16 +00:00
Dan Smith 1ac8ac9f9f Rename checks to fixture and update requirements
This renamed the "checks" module to be in line with other oslo libraries,
and adds fixtures and mock to the list of requirements, since they are
required for actual library code.

Change-Id: I782762d5cd4166893593e172f49fda8ab35e478d
2015-02-19 07:24:07 -08:00
Doug Hellmann 2e6d52b475 apply oslo-cookiecutter template 2015-02-02 15:08:43 -05:00