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>
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.
We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.
We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.
Change-Id: Ia908e642ad1a3f67710d48a71d097c13b7743a5a
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
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
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.