Commit Graph

53 Commits

Author SHA1 Message Date
Stephen Finucane e103baa002 pre-commit: Resolve dependency conflicts
hacking 3.1.0 depended on 'flake8<3.8.0,>=3.6.0', while we were
specifying flake 3.8.3. This resulted in an error when using the
dependency resolver introduced in pip 20.3. Resolve this by bumping to
hacking 3.2.0.

We also remove bandit and pre-commit from test-requirements, since these
are linters which are not managed by upper-constraints and are not
necessary to run tests. oslo.context is also specified in both
requirements.txt and test-requirements.txt, so we remove it from the
latter.

Change-Id: I829870c327b73b583877b9b969ee38f0bcaa1495
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-01-18 15:48:28 +00:00
zhoulinhui 82a792f201 Fix hacking min version to 3.0.1
flake8 new release 3.8.0 added new checks and gate pep8
job start failing. hacking 3.0.1 fix the pinning of flake8 to
avoid bringing in a new version with new checks.

Though it is fixed in latest hacking but 2.0 and 3.0 has cap for
flake8 as <4.0.0 which mean flake8 new version 3.9.0 can also
break the pep8 job if new check are added.

To avoid similar gate break in future, we need to bump the hacking min
version.

- http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014828.html

Change-Id: I20e3db3b092462c85d784aad51d5e98f3499f3f1
2020-10-16 01:19:42 +00:00
Hervé Beraud 266ee36d33 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: Ia9f7040f9966f1492c590a005f55ef7f3b67f0c9
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-22 11:45:02 +02:00
Moisés Guimarães de Medeiros c9f7cd460c 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: I0570c916cffc08bcbaebb385a9cc4a4c7038b215
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-07-25 11:51:52 +02:00
Andreas Jaeger c483dee1f3 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Blacklist:
W503 line break before binary operator
W504 line break after binary operator

Fix:
E123 closing bracket does not match indentation of opening bracket's line
E126 continuation line over-indented for hanging indent

Change-Id: I39003496a3f4be5a4cb05cdbae53a9c097e34e14
2020-03-30 14:41:48 +02:00
caoyuan 530bbea2ee Move doc related modules to doc/requirements.txt
Change-Id: I2f12fb5058984c1fc6beda4d13f934dd9b218218
2019-07-06 18:38:54 +08:00
OpenStack Proposal Bot 2fe652067b Updated from global requirements
Change-Id: Iafa01298a49342ce8b0a1405d2d8ea2b61b3e198
2019-07-03 12:34:24 -07:00
Ben Nemec 1d7ca8a198 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: Idead9b4198c6b05d72bae60dee06e5aebc223822
Reference: https://github.com/PyCQA/bandit/pull/489
2019-05-13 19:52:07 +00:00
ZhijunWei c5764d71db Update hacking version
Change-Id: I7009b639743c22f885cebd532a3d6c1b0f9f1226
2019-02-13 14:33:45 +08:00
Lance Bragstad 7a2d79eafc Add domain scope support for scope types
This commit makes it easier for services to protect APIs meant for
domain-only operations. It does this by making "domain-scope" an
official scope type to check for during policy enforcement.

A good example of where this would be useful is protecting the user
API in keystone, since user's are technically owned by domains.

This commit bumps the version of oslo.context to 2.22.0, which also
has domain support.

Depends-On: https://review.openstack.org/#/c/613635/

Change-Id: Ifc83a5f261bc823060eca5c4d0a4bf07966794c4
2018-11-30 14:52:36 +00:00
Lance Bragstad 775641a5fc Teach Enforcer.enforce to deal with context objects
The ``creds`` dictionary passed into oslo.policy's enforce() method
assumes a lot of the same values already specified by oslo.context
RequestContext objects.

This commit teaches enforce() to handle being passed an instance of
a RequestContext object, and populate credential values accordingly.

Change-Id: Ia74bf6c40b1e05a1c958f4325e00f68be28d91b9
Closes-Bug: 1779172
2018-07-09 16:46:57 +00:00
Lance Bragstad 8f74e2ba28 Fix requirements and convert to stestr
This commit fixes two issues that are currently blocking the gate.

The first is that it bumps the Sphinx requirement to be within
acceptable constraints. The second is that it converts oslo.policy to
use stestr instead of testr. This is all being done in one patch
because proposing them individually causes deadlock (the patch to
bump the sphinx requirement fails because we're still using testr and
the patch to convert to stestr fails the requirements-check job).

The following explains the reasoning behind the stestr change.

With the upgrade to oslotest 3.6.0 [0], testr no longer works [1].
This is because oslotest no longer requires testr and we don't depend
on it directly in oslo.policy.

[0] d5a3c58f71
[1] 897823fbd6

Change-Id: I6dac4c8e7b39c9b80cc8f3728763e8d783c9e940
2018-07-02 17:30:07 +00:00
OpenStack Proposal Bot d759f90b9b Updated from global requirements
Change-Id: Iff836145c26a9e27410d78c9163086753c271cd6
2018-03-15 07:49:45 +00:00
OpenStack Proposal Bot c5e5f6ae39 Updated from global requirements
Change-Id: I54badf14549f0438bbe537be9aa96094f8e8c6d0
2018-01-24 01:25:51 +00:00
OpenStack Proposal Bot 214422c1ce Updated from global requirements
Change-Id: Ib71072486918f8b9f3027b9e49ab010c0b228fa8
2018-01-18 03:24:07 +00:00
OpenStack Proposal Bot dc5cf23a73 Updated from global requirements
Change-Id: I522a9788eb706cb8bea02fced8e949e1b1839579
2018-01-16 04:27:20 +00:00
ChangBo Guo(gcb) 839b34080b add bandit to pep8 job
Add the bandit security scanner to the pep8 job.

Change-Id: I3cf1630c8d69515700e98a9274f42aa3f3b05303
2017-11-30 11:30:17 +08:00
OpenStack Proposal Bot 7b1a6c16bd Updated from global requirements
Change-Id: I7ee98c62f34c1758fadabfed3e5884602249b204
2017-09-20 16:23:09 +00:00
OpenStack Proposal Bot 067250f74d Updated from global requirements
Change-Id: Ia721dd1e8016f1c9d51f3299575a570a3b65ba95
2017-08-18 11:40:12 +00:00
OpenStack Proposal Bot 540503294c Updated from global requirements
Change-Id: I5492440da5fad4a77ee3c6659a2897845208439b
2017-07-27 19:19:45 +00:00
Doug Hellmann 0401f57d49 switch from oslosphinx to openstackdocstheme
Change-Id: I3a35af82ff83946e30f00171bd50c2eac7b9d0a5
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-28 16:46:41 -04:00
OpenStack Proposal Bot ded939ba71 Updated from global requirements
Change-Id: I9badce163f0f2b7b01ea8d9436ef6db67fe561d5
2017-06-27 12:20:20 +00:00
OpenStack Proposal Bot e1549ff1ba Updated from global requirements
Change-Id: I649936d45e36b7e58d3e38f8936aa297d0d0524d
2017-06-02 22:05:26 +00:00
OpenStack Proposal Bot 1a34590efb Updated from global requirements
Change-Id: Icd75dfdbb6a67322eba158be4a495bdfafca0fb2
2017-05-17 03:56:44 +00:00
OpenStack Proposal Bot 6715695f01 Updated from global requirements
Change-Id: I4de956d302b387697ea79c14784e2a5df28efa9e
2017-05-15 00:53:01 +00:00
OpenStack Proposal Bot 3c3261c072 Updated from global requirements
Change-Id: I5ce59cfc43b51e5cc27f16844c5375a22825ad62
2017-03-03 03:07:08 +00:00
ricolin db43505285 [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: Ia07952992bd90213ed9ad9b0adaa7a47553708f7
2017-03-02 18:29:40 +08:00
OpenStack Proposal Bot 5aad32b5f3 Updated from global requirements
Change-Id: I0b7cf1597fc844d698d2711058ead291ac692769
2017-02-10 05:57:48 +00:00
OpenStack Proposal Bot e487d48ee6 Updated from global requirements
Change-Id: I8da9f6fa8ddb2b2cd4ddcc84351f1e4ef63f2aa4
2016-11-02 15:39:19 +00:00
OpenStack Proposal Bot 217488f62d Updated from global requirements
Change-Id: I7d8dd22af3a938f0b8a4823ffde01cab94578585
2016-10-22 01:26:06 +00:00
OpenStack Proposal Bot b6d3131f66 Updated from global requirements
Change-Id: I437a4b5edd2353fa0b1888c1730a3eef67b6fbef
2016-09-28 16:59:42 +00:00
OpenStack Proposal Bot 9c3236a213 Updated from global requirements
Change-Id: Ie990f8b2e9b562a2341bfe741e1f4fdedafc9ebb
2016-09-27 10:06:29 +00:00
OpenStack Proposal Bot 8f5f35e9ac Updated from global requirements
Change-Id: Ib05af2ba08af4783942a1f4599ed572bc11aa9a7
2016-09-26 04:26:10 +00:00
OpenStack Proposal Bot 7e114b68d0 Updated from global requirements
Change-Id: I5daf4add079c41a6bb98b53b687fb8ed53c508b0
2016-06-29 18:08:07 +00:00
OpenStack Proposal Bot db9711de55 Updated from global requirements
Change-Id: I9c467fc429143a81948988201940fcab69965008
2016-06-21 18:04:31 +00:00
Kirill Bespalov fd785d2bb6 Add reno for release notes management
An initial patch to add reno and create a base directory for
release notes

Change-Id: If7aeb47ca244cfe03a34b8b8a80f0075de5f4b02
2016-05-20 18:08:13 +03:00
OpenStack Proposal Bot d5b2dee8a2 Updated from global requirements
Change-Id: Ia8fce74c2caa158ac80a01ab68a15b85fbe4c085
2016-01-16 03:31:20 +00:00
OpenStack Proposal Bot 61637c4f87 Updated from global requirements
Change-Id: Ib877d6f5cdaa5aa0548e4f71701870354670b8fa
2015-12-01 06:09:18 +00:00
OpenStack Proposal Bot 1a5479d4d3 Updated from global requirements
Change-Id: I05f878645a8624470490eeefa311e6f7e4b796ff
2015-11-27 01:22:06 +00:00
Jamie Lennox ac024decee Use requests-mock instead of httpretty in tests
We're trying to remove httpretty from openstack requirements in favour
of requests-mock.

Replace httpretty in testing.

Change-Id: I3d02d2ccffc6535d519e49e4fbd9f0ab7490c3b5
2015-11-26 14:52:09 +11:00
OpenStack Proposal Bot 50585917ee Updated from global requirements
Change-Id: I83945e4206d63cecb2d0df8961c943735df8c864
2015-11-19 16:00:29 +00:00
Brant Knudson 6408ebdb32 Add cover test requirement
Running tox -e cover would fail since the `cover` tool wasn't
being installed in the venv.

Change-Id: Ie2f68b03751faedf4e973e1fdcb5546338bab41d
2015-10-13 10:21:49 -05:00
OpenStack Proposal Bot 5c8071bef0 Updated from global requirements
Change-Id: I01f6d068caaf030d7e76a3dc9078463a4bf7a697
2015-09-23 14:10:13 +00:00
Joshua Harlow 70675997e1 Use requests in http check instead of urllib
The requests interface is much nicer and easier to
use so we might as well use it instead of direct urllib
usage.

Change-Id: I364ddb5f86900a3e166f4480d9f4889a68de247f
2015-09-22 16:29:00 -07:00
OpenStack Proposal Bot d7d6301131 Updated from global requirements
Change-Id: I00e47063a5eaff9352a03cd3985981538ac9b0f5
2015-08-04 00:48:23 +00:00
OpenStack Proposal Bot 0cd6897592 Updated from global requirements
Change-Id: I2a9b613a0cafeee3d972eb017537f37fdd4c6e23
2015-07-29 03:50:03 +00:00
OpenStack Proposal Bot 92cc71dac1 Updated from global requirements
Change-Id: Ie699eaf8afc2d64a559b1b07e342436db8555713
2015-07-15 01:36:40 +00:00
OpenStack Proposal Bot 8ebc9d4356 Updated from global requirements
Change-Id: Ic58778ba5c28c3b5e139ef12bbfa37cb4c10da03
2015-06-22 08:27:11 +00:00
Doug Hellmann cf8b4452f7 Uncap library requirements for liberty
Change-Id: Ic40b70b488873bf3679b9187d315b3088737e5a3
Depends-On: Ib948b756b8e6ca47a4c9c44c48031e54b7386a06
2015-04-16 18:07:06 +00:00
OpenStack Proposal Bot b3fe254031 Updated from global requirements
Change-Id: Ia416f8945ecc9073fbf303be37c411b6f20bbb92
2015-03-21 00:17:05 +00:00