Commit Graph

41 Commits

Author SHA1 Message Date
Stephen Finucane fa830926b5 tox: Add functional-py38, functional-py39 envs
While here, we also clean up some style issues in this file.

Fix CI issue to generated changelog with tox v4

Co-Authored-By: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
Change-Id: If6de005dd8229fe6f21dc103f50db083a415d7e4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-02-06 14:13:57 +01:00
Michael Johnson b9206a5349 Fix api index and module index
This patch fixes the index and module index for the osprofiler documentation
home page.
It also updates the documents tox environments to use a docs requirements.txt

Change-Id: I880f1c28232a299f50ea9ccc2178f1444efb9a41
2022-02-17 22:35:09 +00:00
Zuul a2e5a66696 Merge "Use TOX_CONSTRAINTS_FILE" 2021-10-04 18:32:29 +00:00
Hervé Beraud 1c28012fbc Use TOX_CONSTRAINTS_FILE
UPPER_CONSTRAINTS_FILE is old name and deprecated
This allows to use upper-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.

[1] https://review.opendev.org/#/c/722814/
[2] https://zuul-ci.org/docs/zuul-jobs/python-roles.html#rolevar-tox.tox_constraints_file

Change-Id: I4ceb0afbdc65dceac9625540d393d6f8fea7d134
2021-01-14 10:50:22 +01:00
Hervé Beraud 42d5819ca6 Use py3 as the default runtime for tox
Moving on py3 as the default runtime for tox to avoid to update this at
each new cycle.

Wallaby support officially the following runtimes [1]:
- Python 3.6
- Python 3.8

During Victoria Python 3.7 was used as the default runtime [2] however this
version isn't longer officially supported.

[1] https://governance.openstack.org/tc/reference/runtimes/wallaby.html#python-runtimes-for-wallaby
[2] https://governance.openstack.org/tc/reference/runtimes/victoria.html#python-runtimes-for-victoria

Change-Id: Ic2411eef55b26345fb8bb0d3d7c83cf6b366af94
2020-11-04 10:06:29 +01:00
Hervé Beraud 2794b9828c 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: If4bd505d6bf73d06ce2f6080cedb3b5576c881d9
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-10-09 11:07:15 +02:00
Andreas Jaeger 1d77244f18 Fix pep8 failures
With an updated flake8, we get some new warnings. Update hacking
directly to version 3.1.0 and fix the problems found.

Note that before this change, flake8 used the default "ignore" list,
this now adds a new ignore list.

Change-Id: Iccbf4f30eb4e542d3824b7782f43eacda29c5a90
2020-06-02 17:07:50 +02:00
Sean McGinnis 99332da670
Bump default tox env from py37 to py38
Python 3.8 is now our highest level supported python runtime.
This updates the default tox target environments to swap out
py37 for py38 to make sure local development testing is
covering this version.

This does not impact zuul jobs in any way, nor prevent local
tests against py37. It just changes the default if none is
explicitly provided.

Change-Id: I3727e107748db800149aef2ab5696b4bd48df425
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-24 10:25:53 -05:00
Ilya Shakhat 3fc760ad24 Enforce order of import statements
This patch adds flake8-import-order plugin and fixes
all found issues.

Change-Id: Ibbeae4afeb737401de48fb2e7e225eb0a969908b
2020-04-20 12:43:51 +02:00
Andreas Jaeger 6e6d76aafe Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Update local hacking checks for new flake8.

Change-Id: I8ba89483c8e6b76011833cfc5080eab3fd269c8b
2020-04-01 11:18:56 +02:00
Andreas Jaeger 7eaa8648cd [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 using modern sphinx-build.
Remove cruft from setup.cfg

Drop non-voting jobs from gate queue.

Change-Id: I2cc764bd3de8130aa25868b57b2e89341c71617e
2020-02-04 11:24:14 +01:00
Corey Bryant d431c7a551 Add Python 3 Train unit tests
This is a mechanically generated patch to ensure unit testing is in place
for all of the Tested Runtimes for Train.

See the Train python3-updates goal document for details:
https://governance.openstack.org/tc/goals/train/python3-updates.html

Change-Id: I18d35d120bed22f5bbb4b8e15942d3e48063615d
Story: #2005924
Task: #34234
2019-07-05 15:12:53 -04:00
caoyuan b0189254b1 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: Id2b126d0b66a24a099fb7f52aa819b4b0ac0f7c7
2019-04-29 06:48:18 +00:00
Ghanshyam Mann b830f7921c Dropping the py35 testing
All the integration testing has been moved to
Bionic now[1] and py3.5 is not tested runtime for
Train or stable/stein[2].

As per below ML thread, we are good to drop the py35
testing now:
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/005097.html

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004647.html
[2]
https://governance.openstack.org/tc/reference/runtimes/stein.html
https://governance.openstack.org/tc/reference/runtimes/train.html

Change-Id: Idb246e18956ae67795b06d2968c0d5ee19940e47
2019-04-16 04:21:39 +00:00
Vieri 48a3de18f8 Update min tox version to 2.0
The commands used by constraints need at least tox 2.0.  Update to
reflect reality, which should help with local running of constraints
targets.

Change-Id: I871c0eff718af5196bb0f208686398dc42760309
2018-11-02 07:04:55 +00:00
Nguyen Van Trung 0984e088a3 Don't quote {posargs} in tox.ini
Quotes around {posargs} cause the entire string to be combined into one
arg that gets passed to stestr. This prevents passing multiple args
(e.g. '--concurrency=16 some-regex')

Change-Id: I97019542009784ff81b565b6936be6774f2557f1
2018-10-09 10:19:55 +07:00
Vu Cong Tuan 337e3c2d93 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.

[1] https://etherpad.openstack.org/p/YVR-python-pti

Change-Id: I75bea8174b9473b0648e1fc524dd8ea25dfb666d
2018-07-11 07:50:25 +07:00
Tovin Seven 4a2f002005 Add minimum version and fix dulwich issue
Main changes:
- Add minimum version for requirements [1]
- Fix dulwich issue that broke py35 gate [2]

Trivial changes:
- Re-format multi-line deps in tox.ini
- Verify and change constraints of pymongo, prettytable
  to match global requirements

---
requirements without minimum version definitaions may cause CI failure

Merge https://review.openstack.org/#/c/574367/ made requirements job
check for minimum version definitions, requirements without minimum version
may cause CI failure.

This patch sync the requirements with lower-constraints

---
Start using upper-constraints in tox venvs

Without this we are exposed to any breakages in dependencies, which
is currently blocking the repo because of a broken dulwich release.

Note that this required the removal of the explicit .[oslo_config]
requirement.  I'm not sure why that was there since it will be
pulled in by oslo.concurrency anyway and it broke the venv creation
when constraints were added.  Since I'm not sure why it was split
out as a separate thing I'm leaving the setup.cfg target but
removing it from tox.ini.

We also need to pin dulwich in lower-constraints, even though it's a
transitive dependency.  Otherwise the lower-constraints job installs
the broken latest version.

Transitive dependency that we need to pin due to
https://bugs.launchpad.net/tripleo/+bug/1778004
---

[1] https://review.openstack.org/#/c/575691
[2] https://review.openstack.org/#/c/577462

Co-Authored-By: Kevin_Zheng <zhengzhenyu@huawei.com>
Co-Authored-By: Ben Nemec <bnemec@redhat.com>

Change-Id: Ibfe5f460139849ba39b369321360f6f5a0e9e2a0
Closes-Bug: #1777083
Closes-Bug: #1778004
2018-06-25 19:00:16 +07:00
Doug Hellmann e2319c939b fix tox python3 overrides
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: I61dcae5c3f3f1baec315855604a7c887ebf9c5a5
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 14:53:49 -04:00
Tovin Seven e30bbfba51 Add lower-constraints job
Create a tox environment for running the unit tests against the lower
bounds of the dependencies.

Create a lower-constraints.txt to be used to enforce the lower bounds
in those tests.

Add openstack-tox-lower-constraints job to the zuul configuration.

See http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html
for more details.

Change-Id: I4ec215baac733ef07a619c03c28406c994d493f5
2018-04-19 09:21:21 +07:00
Doug Hellmann 674ced35dc set default python to python3
Set the default python to python3 except for the py27 environment. We
have to set that explicitly to override the new default.

Change-Id: I1b90426757130f9e8f32eb4882746bb44b3cf1e3
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-13 16:13:58 -04:00
Ilya Shakhat 71589dd64f Add Zuul job for functional testing
The job prepares VM with RabbitMQ installed, then it executes tests
located under osprofiler/tests/functional.

To run the job manually use `tox -e functional` or
`tox -e functional-py35`.

Change-Id: I1f2b99737d1f17bb09662dc24c4858a1a7a1ad44
2017-11-08 08:56:17 +01:00
kavithahr 1f06cf66d5 Python 3.4 support is removed
Change-Id: Ic638d49b1ebb4df74fb0baeaa4e61754c2e6405f
2017-03-08 12:37:37 +05:30
Jenkins 9ddcab56a3 Merge "Add functional test for notifier backend" 2016-12-22 05:45:10 +00:00
Vipin Balachandran c1d53d925e Add py35 tox virtualenv
Adding py35 tox virtualenv in preparation for the move from 3.4
to 3.5.

Change-Id: Ia5ec95b7fdf1a8edc8d501d13221e598408d02a5
2016-12-15 19:39:54 +05:30
Vipin Balachandran 899f4138c7 Add functional test for notifier backend
We have several notifier backends now. It is important to verify
that they are not broken when changes are made. Adding a test for
notifier backend verification. We can use this test to verify the
backends against each osprofiler patch.

Note: the support for messaging/ceilometer backend will be added
in a subsequent patch.

Change-Id: Icb0f453de30dbfa1a7a990e73391cf17a246e9bb
2016-12-15 19:36:35 +05:30
Vipin Balachandran 458f1d7d60 Move hacking checks outside tests
Moving hacking checks outside the tests folder since they are
not really tests.

Change-Id: Ia0bc87050049d6198ceb13da942771a0158bc34a
2016-11-23 13:00:30 +05:30
ChangBo Guo(gcb) 9407108fee Add reno for release notes management
The release management team have indicated this is their preferred way
to collect release notes in future.

Closes-Bug: #1634356

Change-Id: I40ebe47509ba5cabd57ed8c4987ae6ec1e2b5d5f
2016-11-03 18:38:01 +08:00
lvdongbing 9f2747952c Fix the issue that ChangeLog not found when building docs
Build docs by 'make html' would not generate AUTHORS and ChangeLog,
but they are needed in osprofiler's doc. This patch uses 'python
setup.py build_sphinx' to replace 'make html'.

Change-Id: Ic31b69b5500a2568adeb8c4a885596e96d16572a
2016-10-11 04:30:33 -04:00
ChangBo Guo(gcb) f776ba2757 Enable bandit in gate
Bandit is a tool designed to find common security issues in Python code.
and pep8 is the usual linter target. So enable it in pep8 target.
Change-Id: Ie5e4350cde906c206fd5041e88983678eb37999e
2016-03-03 11:30:00 +08:00
ChangBo Guo(gcb) 54d58a7758 Remove flake8 ignore list in tox.ini
H703 doesn't exist in hacking>=0.10.2, so remove it.
Fix E126 violations and remove E126.

Change-Id: I727282e4e7f276318f3cdd50d885941ab8b4ff49
2016-02-19 19:03:06 +08:00
Doug Hellmann 2ab53dfdae run py34 tests before py27 to work around testr bug
testr uses anydbm to create a database, but python 3 dropped support for
the database format that is the default in python 2. The default for
python 3 is available under python 2, so if we run the python 3 tests
before the python 2 tests everything works fine. Change the order in the
default environment list so that if someone checks out the repo and runs
'tox' all of the tests work.

Change-Id: I44b23add5acc297ca00d2d3c7747f0cfff85cc2f
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2016-02-10 15:34:14 -05:00
Joshua Harlow f9a2c8121e Move osprofiler tests into osprofiler
To follow the pattern that nearly all oslo tests follow
move the tests out of the osprofiler root directory and into
the osprofiler module itself.

This makes it easier for new people to get involved and follows
the more common directory structure that people should already
be used to.

Change-Id: I384cdb5466d852dd4493e4fce2f0078545724416
2016-01-25 12:12:45 -08:00
Davanum Srinivas bf7219a1ee Consolidate osprofiler options
Right now every project has its own copy of the profiler options,
This situation will make it very hard to keep up when we want to
change things in osprofiler. So we should consolidate the code
just like all other oslo libraries in osprofiler itself. However
one twist here is that we should avoid needing oslo.config as a
hard requirement for project that do not want to use it, so we
should add this as an extra in setup.cfg and adjust the testenv
as well.

Change-Id: I4343136be501551bb2c87d4b66d839c4e63a67fc
2016-01-20 14:22:49 -05:00
Boris Pavlovic 5bfca7bc05 Add py34 to tox env list
OSprofiler supports py34, and it should be add to env list

Change-Id: Id0aebc0d871a4ecf6dde4144199190a381a0642f
2016-01-19 15:02:04 -08:00
reedip 4c65ccdfd9 Remove support for py26
Python 2.6 is not supported from Mitaka, as per Infra.
The following patch removes the support for the same.

Change-Id: Ieae4ca2695f5e0f73efece34c631204b51004b00
2016-01-07 14:54:47 +09:00
Ondřej Nový 739117459f Deprecated tox -downloadcache option removed
Caching is enabled by default from pip version 6.0

More info:
https://testrun.org/tox/latest/config.html#confval-downloadcache=path
https://pip.pypa.io/en/stable/reference/pip_install/#caching

Change-Id: I2f917ca797bcdad8d854440183867a09f7563cdc
2015-12-11 21:23:34 +01:00
Boris Pavlovic 435e6a6fc3 Add hacking rules & fix hacking issues
Change-Id: Id335bfdf49ed88edd14e896a48c22b11113600c8
2015-11-23 01:42:00 -08:00
Monty Taylor 9720b7620c Rename doc environment to docs
As per the governance resolution https://review.openstack.org/119875,
projects should have a docs environment in their tox.ini testing
interface. Rename the doc environment to docs.

Change-Id: I32a8138934cd7b027dcbad0c3627b3554013494e
2014-09-08 13:51:34 -07:00
Boris Pavlovic b2c9b86ad7 Add OSprofiler docs
This is required by python-docs job + it's good to have documentation
on read the docs.

As we don't won't to duplicate work, index.rst is just symlink to README.rst

Change-Id: I1b42fc7c135367ca77949998c5e0db5fc5dd7434
2014-08-01 12:27:42 +04:00
Boris Pavlovic 903ca86952 Init Strucutre of lib 2014-01-09 11:25:23 +04:00