We do perform linting via pep8 job which runs on modern python only.
This fixes an error that recently broke py27 job due to failure to
install hacking, where hacking is in fact not even needed by it.
We also need to add some extra conditions for mock to avoid possible
failure with older pip version.
Change-Id: I5007154caa7493652a424a4fad4918b7dbefcfb9
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: I730018e2bf788be5ac4e993af1746296206edfc1
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
This allows us to run tox -epep8 on newer python versions. Fix the
issues newer hacking calls out. They were complaints about indentation
and ambigious l value variable names.
Change-Id: I9552fba791bdf54649fbe25fc26bffdf8186ff0a
virtualenv is undergoing a rewrite and has changed how the programmatic
API works [1]. Switch to the "new way".
While we're here, we also need to get Python 2.7 tests passing again.
That requires dropping support for upper-constraints and using our own,
limited local constraints based on supported Python versions. We also
need to migrate integration tests since those run with Python 3 now.
Update the scenarios for pip/setuptools in integration testing
similarly. Finally clean up the installation of all devstack repos as
requirements are managed different now. Instead of worrying about
syncing them we use constraints.
[1] https://github.com/pypa/virtualenv/issues/1585#issuecomment-585228492
Change-Id: I493e88985d2c4d09612fea4d20d8ffa20043a0cb
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Depends-On: https://review.opendev.org/739014
Use openstack-tox-cover template, this runs the cover job
in the check queue only.
Use openstack-lower-constraints-jobs template.
Remove jobs that are part of the templates.
Sort list of templates.
Add coverage to test-requirements, otherwise tox -e cover will fail.
Change-Id: I0eff88e5736243291d4777f642bc48c32deafa39
Since the switch to stestr in commit 2222dbb47, the tests have taken to
spewing a load of noise. This seems to be because we dropped the
configuration for OS_STDOUT_CAPTURE and OS_STDERR_CAPTURE, which was
previously configured in '.testr.conf'. This is fixed. However, it seems
it's also necessary to explicitly pass the '--suppress-attachments'
option to 'stestr' to properly silence things. This seems to be
necessary because many pbr commands output to stdout by default, while
other projects (nova, etc.) use 'logging'. Use of this option requires
stestr 2.1.0 [1] so we bump the lower-constraint.
As an aside, finding out what caused this output was easier said than
done. I tried stestr, testr and fixtures, before finally finding it in
subunit.
[1] https://github.com/mtreinish/stestr/commit/1316ebd7
Change-Id: I1678bcd26b41fdf09f98c36fc095d6d4c1826deb
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Wheel 0.32.0 removed the 'wheel install' command [1] and, subsequently,
the 'wheel.install' module [2]. It also made 'WheelFile' a subclass of
'zipfile.ZipFile' rather than a wrapper [2] and deprecated the '[wheel]'
section of 'setup.cfg' in favour of '[bdist_wheel]'. Handle these
changes.
[1] https://github.com/pypa/wheel/commit/353217fb4
[2] https://github.com/pypa/wheel/commit/89492505b
Change-Id: I2903089a07bdd2dc96437b9f65f2d2bba2741707
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.
While we're at it, we also fix the docs requirements and removed the
unused 'pypy' and 'cover' tox targets.
[1] https://etherpad.openstack.org/p/YVR-python-pti
Change-Id: I424068adc9092be2cf40d117c9dc4e92bb51e804
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
The older hacking library has a cap on pbr <2.0, with the recent 2.0.0
release of PBR it's causing failures in the pep8 job. hacking isn't
kept in sync via the typical proposal-bot updates. Do it manually to
clear the gate issue.
Change-Id: I752f518611add90dd391982cb7dade9b599ff9d3
Related-Bug: #1668848
I noticed the current API documentation is unreadable [1]. Remove the
inbuilt theme and move to oslosphinx for module/api documentation.
[1] http://docs.openstack.org/developer/pbr/api/pbr.version.html
Change-Id: I8d92d849b8a2ab4baca960ae8c271214d3c2b8f4
Get current release of hacking both for new features/rules and to
address a problem where older hacking requires and older version of pbr
than the version of pbr under test. This will get the pep8 jobs working
again for pbr by removing the <1.0 pbr requirement in hacking.
Change-Id: I303db998e3aa64468a931f7e8985592b3446a1c8
This adds support for reading extras from setup.cfg.
It also adds support for handling environment markers, both in the
extras section and in install_requires and in requirements.txt.
Change-Id: I6fd8276012e65f82934df9c374613b1ce6856b5a