Commit Graph

7 Commits

Author SHA1 Message Date
Takashi Kajinami 26a2dc96cc Bump hacking
hacking 3.0.x or 2.0.x is too old.

Change-Id: I2784d242ba320c2019ddc26f7653985a64e6f598
2024-01-28 15:54:38 +09:00
Hervé Beraud 89cb11c85c 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: I042162e9f303d2409491f71d3011db175930116d
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-15 15:19:35 +02:00
Andreas Jaeger dbf8dd6bcf [ussuri][goal] Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in ussuri cycle.

Complete discussion & schedule can be found in
- http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Switch to modern sphinx-build and using openstackdocstheme
(note that repo is not building and publishing docs, docs building works
locally with these changes).

Change-Id: I9542c1dba3f339c2acece83d7d2b5726c1c3e2bc
2020-02-03 17:12:24 +01:00
Chris Dent b5359fcd80 Add MicroversionMiddleware
This change imports (with slight modification) the
MicroversionMiddleware created for the placement service.

For the time being the middleware relies on WebOb as that is
what it originally relied on. If there are requirements to do
otherwise, later, we can make adjustments then.

The README is updated with limited usage instructions.

Gabbi tests are added, requiring adjustments to the test configuration,
so the opportunity was taken to switch to using stestr instead of testr.

Though arguably "functional" tests because they are not strictly unit
tests, no distinction is made in the tests directory, for now, as it
is all nice and fast and we'd like to keep it that way.

Change-Id: I9d27b6fad35f7aea0085f08c0353f8e8acdb8b73
2018-03-20 17:24:56 +00:00
Chris Dent b1f7162324 Fix folded header checks for WebOb
WebOb uses a Mapping class for headers which behaves like a dict
but does not inherit from dict, so the isinstance check in
fold_headers was not working as expected. This is now replaced
with a check for dict-like behaviors. It's a bit of a tossup
between doing a hasattr and simply trying to access a key. I chose
the former for readability and because we don't actually want to
do anything with the value we would retrieve were access by a key
legit.

Tests are added to specfically cover the use of a
webob.headers.EnvironHeaders object, which is what headers in
Nova and Nova derivations look like.

Change-Id: I31de49bcfd8822c53d3293b106de96138eaf4464
2016-03-31 14:03:13 +01:00
Chris Dent 33e0066354 Enable gerrit, gitreview and gate testing
Initial setup for git review.

Add basic docs handling so that docs tests will pass. No
actual docs in place yet.

Align with global requirements.

Change-Id: I8ae7c2c6ce410c04f4ce53ce5278b2b85c141c93
2016-03-31 12:31:20 +01:00
Chris Dent 49b44934b9 Initial proof of concept of microversion_parse
See README.rst for details.

The basic gist is that a get_version method is provided. It takes a
dict or list of headers and returned a version for a service_type if
it can find it.
2016-03-22 17:48:42 +00:00