Commit Graph

65 Commits

Author SHA1 Message Date
Ben Greiner 397b6fcdf9 remove explicit mock
The explicit mock package is not required if you can use unittest.mock
from python >= 3.3

Change-Id: I1e3a764b38be66b994d790768bc5eb9be4237444
2022-01-21 10:44:41 +01:00
Sorin Sbarnea e0e2b8422a Update dependencies to avoid failure with old pip
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
2021-04-06 17:43:14 +01:00
Hervé Beraud f5e4c6577a 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: I730018e2bf788be5ac4e993af1746296206edfc1
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-10-21 16:48:08 +00:00
Clark Boylan 206b795517 Update hacking
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
2020-08-05 15:01:21 -07:00
Stephen Finucane 73c11c6267 Add support for virtualenv 20.x
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
2020-08-05 15:01:15 -07:00
Stephen Finucane 57d7c53739 Update to latest hacking
Change-Id: If73238a39d0934c6f577fc52132fcbc63e8eb25f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-08-27 16:57:23 +01:00
Hervé Beraud 30926f6dbe Update Sphinx requirement
Sphinx 2.0 no longer works on python 2.7, so we need to start capping it
there.

Change-Id: Ia13b8a75f11ee997e00e817464829ce8b86d2e16
2019-05-16 15:33:37 +02:00
Zuul 4788f49ec0 Merge "tox: Suppress output" 2018-10-15 18:04:07 +00:00
Andreas Jaeger 58cccf098b Use templates for cover and lower-constraints
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
2018-10-05 13:26:23 +00:00
Stephen Finucane ed77ce858d tox: Suppress output
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>
2018-10-04 16:34:58 +01:00
Stephen Finucane f14a3b2b73 Support wheel 0.32.0+
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
2018-10-04 10:52:05 +01:00
Stephen Finucane 2222dbb47e 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.

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>
2018-07-18 10:12:17 +01:00
OpenStack Proposal Bot 56c27c21d1 Updated from global requirements
Change-Id: I7d0c896273f4de46e7d9dd494902adf5c1e19b30
2018-03-15 06:43:31 +00:00
OpenStack Proposal Bot 7db60850a2 Updated from global requirements
Change-Id: I0f72806130503a47a3caf737e2cea082d42fed55
2018-01-24 00:48:19 +00:00
OpenStack Proposal Bot 090e1c1844 Updated from global requirements
Change-Id: I7eb765dc83e6983b5b52e518db5039a71efb036c
2018-01-17 20:26:54 +00:00
OpenStack Proposal Bot 37ebe11cc2 Updated from global requirements
Change-Id: I4ac147dac42058983ab10387c3b3338500a7334c
2017-11-16 11:02:49 +00:00
Stephen Finucane f450cd26a2 Add reno for release notes management
Change-Id: I36b8193b22123a409b729c7b9f4309507379f1ad
2017-10-10 09:36:59 +01:00
OpenStack Proposal Bot be33d10077 Updated from global requirements
Change-Id: Icc5bbd374739afcca65d13b2600d8d70b6db291a
2017-09-20 16:11:58 +00:00
OpenStack Proposal Bot 1a3b558117 Updated from global requirements
Change-Id: I578f41da03c234025cd7634f7b62d1e97fbac1c9
2017-09-11 21:34:21 +00:00
OpenStack Proposal Bot c3d64a3e13 Updated from global requirements
Change-Id: I519542cd5ac8771833d38feeb921dd3104f962fd
2017-08-18 04:38:16 +00:00
OpenStack Proposal Bot 2c58276911 Updated from global requirements
Change-Id: I228c73b03f0eeab9a9b66ab4af764c02b1356e4d
2017-07-27 19:07:15 +00:00
OpenStack Proposal Bot 68e64e8ea5 Updated from global requirements
Change-Id: I3b07be5b8ae0246de43adcba4e6d3e48fcee406e
2017-07-05 13:09:07 +00:00
Doug Hellmann bdc26f1303 switch from oslosphinx to openstackdocstheme
Depends-On: Ifc5512c0e2373cf3387e0e0498268eab092e52bb
Change-Id: I58acb2cc35d33af586201a4667d82388a51987d5
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-26 16:51:31 -04:00
OpenStack Proposal Bot f62ebcb4b2 Updated from global requirements
Change-Id: Ibb7825bdfb03449f834498a88445dabb8bd71251
2017-05-21 22:13:47 +00:00
OpenStack Proposal Bot 12a1c1dc3c Updated from global requirements
Change-Id: Ie230090ff923e84a8b4b3eca75bdc0b5a1405b15
2017-05-15 00:41:39 +00:00
OpenStack Proposal Bot 013e9dd40a Updated from global requirements
Change-Id: I43344959288151b35983ed769898c149e64fff10
2017-03-02 23:52:51 +00:00
Ian Wienand 629d14dbcb Update to a newer hacking library
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
2017-03-02 15:42:51 +11:00
OpenStack Proposal Bot 714990806a Updated from global requirements
Change-Id: I83151b7afaae9f86c70db817f4a707eb7f14df52
2017-02-10 05:46:57 +00:00
Dirk Mueller f0703f7ce3 Remove discover from test-requirements
It's only needed for python < 2.7 which is not supported

Change-Id: I5b43ff5b07a2e205c59f9758b13a450897baa129
2017-01-03 19:28:44 +01:00
OpenStack Proposal Bot adb301fe2c Updated from global requirements
Change-Id: Icf44de0c986a0d94a8625d913895898ca447656b
2016-11-24 22:49:49 +00:00
OpenStack Proposal Bot 6975d22a56 Updated from global requirements
Change-Id: Ia99f7e783b9b5b354a8ffec6491505e724c2fcde
2016-11-16 21:52:11 +00:00
OpenStack Proposal Bot 0a007e9091 Updated from global requirements
Change-Id: Ifbcd360f139accc7588e665ede1d89a7689ab359
2016-09-28 16:51:07 +00:00
OpenStack Proposal Bot 3b559e389a Updated from global requirements
Change-Id: Ifb4aa77ac3746f73d60fe2c2eae19c8991e41064
2016-07-20 16:16:55 +00:00
Ian Wienand 87288ccfd8 Move to oslosphinx
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
2016-06-22 13:18:59 +10:00
OpenStack Proposal Bot 847065e9d1 Updated from global requirements
Change-Id: I5ea42decb2d8d9277b2df98efb4afc2dd13b3d0d
2016-06-21 17:57:32 +00:00
OpenStack Proposal Bot 49ae0ca637 Updated from global requirements
Change-Id: I51a5ab4baadb8f851296fd241a3b2d25ca9d3759
2016-06-02 21:03:43 +00:00
OpenStack Proposal Bot d40ae6f5fe Updated from global requirements
Change-Id: Icf7b585e2a721b139a08006922cf45387b84efee
2016-05-30 20:38:44 +00:00
OpenStack Proposal Bot c12aec3712 Updated from global requirements
Change-Id: Ibbd4c9602d83fd68172a7469f66972df44ca7d7d
2016-05-30 00:31:57 +00:00
OpenStack Proposal Bot d4e29cb5d2 Updated from global requirements
Change-Id: Ieef4e9de580dd3874b09f462e58efecdd0005de8
2016-04-08 00:25:10 +00:00
OpenStack Proposal Bot 8992a9ab90 Updated from global requirements
Change-Id: I044a5ab14677f0052970932422cc799ff7ef94d2
2016-01-16 03:24:59 +00:00
OpenStack Proposal Bot 1f102e60d7 Updated from global requirements
Change-Id: Ic0a09e0ba27e60eecfdcb9eaa589738f97ee8379
2015-07-22 04:54:17 +00:00
OpenStack Proposal Bot 12ad5b9857 Updated from global requirements
Change-Id: I735058e846783cd0ac361645dc2c0f760d15614e
2015-07-17 16:11:20 +00:00
OpenStack Proposal Bot 7d974fb7ea Updated from global requirements
Change-Id: I126133f8fb2e5824188ad4362f18af45734d3f42
2015-07-12 15:16:50 +00:00
OpenStack Proposal Bot 827bc98de5 Updated from global requirements
Change-Id: If12be720c7057f7014dfb11d4c2a83576cdddfc3
2015-07-10 20:13:58 +00:00
OpenStack Proposal Bot 276603835d Updated from global requirements
Change-Id: I465ea84f82dfed96c27aeea9337cd28c64c73adf
2015-06-30 19:54:38 +00:00
OpenStack Proposal Bot 6669999071 Updated from global requirements
Change-Id: Iaa3699f8db386a39d55e8c2e0605a8edd146546e
2015-06-22 08:19:08 +00:00
OpenStack Proposal Bot bb838190ee Updated from global requirements
Change-Id: Idd9c01966a5b0f6d6950e9a094b9aeabfc127b44
2015-05-29 16:44:00 +00:00
Clark Boylan 8e87679d0d Update hacking to 0.10.x series
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
2015-05-19 09:41:49 -07:00
James Polley 2b29c4fc2b Teach pbr to read extras and env markers
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
2015-05-15 21:31:21 +10:00
Robert Collins cfd8ab2dec Parallelise integration tests.
This involves moving the inner loop to python because
existing-tooling.

Change-Id: Iaad811a0248a3f700e655bd8be656d183deead93
2015-05-02 09:05:54 +12:00