Commit Graph

58 Commits

Author SHA1 Message Date
likui 0415e4bc88 Drop openstack-lower-constraints-jobs
As discussed in TC PTG[1] and TC resolution[2], dropping
the lower-constraints.txt file and its testing.
We will keep lower bounds in the requirements.txt file but
with a note that these are not tested lower bounds and we
try our best to keep them updated.

[1] https://etherpad.opendev.org/p/tc-zed-ptg#L326
[2] https://governance.openstack.org/tc/resolutions/20220414-drop-lower-constraints.html#proposal

Change-Id: I0a19802c82c9ea9138a870559748063dca5507e1
2023-06-26 18:03:58 +08:00
wu.chunyang c715b66b53 Fixing tests with tox 4.2.6
Remove basepython from testenv

Change-Id: Idb2a9d9dcc5a73e15e5cbab165b2b629a8b26afe
2023-01-28 15:53:59 +08:00
wu.chunyang 00a54650d5 Add python3.9 support
This ps adds py39 support and replaces dashes with underscores

Change-Id: I5245be419244c8bd93c7099b61ce0a382f7a5065
2022-04-28 22:14:03 +08:00
likui 5ce2e998b9 Changed minversion in tox to 3.18.0
The patch bumps min version of tox to 3.18.0 in order to
replace tox's whitelist_externals by allowlist_externals option:
https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23

Change-Id: Ia9928d8fe69a6a3c593ff9b5846ef3123e7dda26
2021-06-03 17:01:07 +08:00
Lingxian Kong e41d08d243 Support project name in quota CLI
Change-Id: I9886792f346bbe8d4887539ca69588b4957547e1
2021-04-29 14:17:48 +12:00
likui a4beff11a2 Update TOX_CONSTRAINTS_FILE
UPPER_CONSTRAINTS_FILE is old name and deprecated
-https://zuul-ci.org/docs/zuul-jobs/python-roles.html#rolevar-tox.tox_constraints_file
This allows to use lower-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.

[1] https://review.opendev.org/#/c/722814/

Change-Id: Ieb7bf715f4d28814afe6b791fde90ab114d9793a
2020-10-30 13:47:38 +08:00
Zuul 7ed34b9c64 Merge "bump py37 to py38 in tox.ini" 2020-10-22 21:31:06 +00:00
zhangboye bf20c93428 Remove install unnecessary packages
The docs requirements migrated to doc/requirements.txt
we need not install things from requirements.txt.

Change-Id: I0b3b6acac49846a8c9e8efb4de31b0be22283180
2020-09-23 15:24:14 +08:00
wu.chunyang 3287d43b9a bump py37 to py38 in tox.ini
in 'victoria' cycle, we should test py38 by default.
also remove unused env pypy
Trivial change

Change-Id: Iafaa88482bf5e972e1c0eb9766254d3973685368
2020-09-19 22:39:25 +08:00
likui 36aecf6e23 Remove install unnecessary packages when run tox -edocs
the requirements.txt is unnecessary when run tox -e docs
docs relative stuffs is in doc/requirements.txt, this ps to remove
the requirements.txt from tox.ini

Change-Id: I4da4d4e862be137e919e4e94a239cc5461b208da
2020-09-11 10:13:19 +08:00
Andreas Jaeger e96e99f1ec Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Change-Id: I5da442bb2f1e634e6b3fe37a6ea3820cea1db96f
2020-03-31 13:33:41 +02:00
Ghanshyam Mann 1680ef7af7 Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in ussuri cycle.

python-troveclient is ready with python 3 and ok to drop the
python 2.7 support.

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://review.opendev.org/#/c/691178/

Change-Id: I425cb0d2f1487819fde9ebae46fe3570b72cbe88
2019-12-13 23:49:33 +00:00
yangyong 855ca07481 replace git.openstack with releases.openstack.org
Change-Id: Ib69c3524c0afa8c7f7827e4feb70c7aed2e06c9a
2019-08-26 17:44:11 +08:00
Corey Bryant 8e56d90af2 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

Also fix the CI failure due to:
https://docs.python.org/3/whatsnew/3.5.html#pep-479-change-stopiteration-handling-inside-generators

Change-Id: Ica582f99730c5019a1212d4f58d7d854ad2996fd
Story: #2005924
Task: #34254
2019-08-23 20:47:13 +12:00
Ghanshyam Mann 489321ad86 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: Ib2b1297f75a245dbd2209f958a89a510bc62965c
2019-04-15 02:03:35 +00:00
Vieri fcec6cae9f add python 3.6 unit test job
This is a mechanically generated patch to add a unit test job running
under Python 3.6 as part of the python3-first goal.

See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html

Change-Id: I72d4101d9edb049b58f5ce662160f9629dbf1665
Story: #2002586
2018-11-28 08:09:18 +00:00
huang.zhiping 494c332f62 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: I8a8766706f60a75c546fa338943630a28f3670f2
2018-10-21 02:56:25 +00:00
Vieri 8afd48b696 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: Ieeaa82bc6fb472490d1806c41cbffac130c0d23a
2018-10-09 14:07:09 +00:00
Vu Cong Tuan 1fd406d533 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: I9bfb80f2556ca7c801dde69d1685751169e25307
2018-07-30 09:08:15 +07:00
Doug Hellmann cd7b215bb3 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: I3868de365369664b3689582cc9d25f3228e5dbb7
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-07-12 02:20:12 +00:00
Nguyen Hai 3c70f8f69e Follow the new PTI for document build
- Follow new PTI for docs build
- Add sphinxcontrib.apidoc to replace pbr autodoc

REF:
https://governance.openstack.org/tc/reference/project-testing-interface.html
http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html
http://lists.openstack.org/pipermail/openstack-dev/2018-March/128594.html

Change-Id: I078e2ed32da04303203d6c2a3e498f82b9a15939
2018-04-21 11:37:53 +00:00
Zuul 8a1a017ea6 Merge "Change testenv from py34 to py35" 2018-04-17 23:22:20 +00:00
Nguyen Hai 86d9f66642 Change testenv from py34 to py35
- The Zuul gate currently only support py35.
- In setup.cfg, the project said that it support
Programming Language :: Python :: 3.5.

Therefor, this patch changes py34 to py35.

Change-Id: Iaad9bf41e3c8a8915c06ff039e570a2cc41ca2a1
2018-04-16 13:35:29 +00:00
Doug Hellmann 1dd0c2e26f 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.

About PrettyTable requirement:
The minimum version of PrettyTable is not correct in requirements.txt,
which should be 0.7.2 according to the unittests(before 0.7.2, if the
table is empty, i.e. no rows in the table, PrettyTable won't print the
headers and borders, this is changed during 0.7.2)

Co-Authored-By: Zhao Chao <zhaochao1984@gmail.com>
Change-Id: Ia9cadcbc2bc9aa2864fe47040dfe7be8ae286b98
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-16 20:02:01 +08:00
Andreas Jaeger ac65fa735c Avoid tox_install.sh for constraints support
We do not need tox_install.sh, pip can handle constraints itself
and install the project correctly. Thus update tox.ini and remove
the now obsolete tools/tox_install.sh file.

This follows https://review.openstack.org/#/c/508061 to remove
tools/tox_install.sh.

Change-Id: I65e1e4d40fbd56c7e2f7e4a59c0438d7176c36b4
2017-12-02 16:54:12 +00:00
Gábor Antal ccceffa7f5 Handle log message interpolation by the logger
According to OpenStack Guideline[1], logged string message should be
interpolated by the logger.

Also, upgraded hacking requirement, to enable H904 check.

[1]: http://docs.openstack.org/developer/oslo.i18n/guidelines.html#adding-variables-to-log-messages

Co-Authored-By: jiansong <jian.song@easystack.cn>
Change-Id: I3f020b6bcb1b9bf6d18a3b4f738c13cccd1bbff8
Closes-Bug: #1596829
2017-03-08 10:00:34 -08:00
Amrith Kumar 1ae94d4107 Get python-troveclient to use upper-constraints.txt
In review[1] which passed just fine in check some days ago failed in
gate today. This is because the current tox environment uses requests
v2.12.1 which appears to not work and is beyond the value in
upper-constraints.txt. As observed in [2] we need
upper-constraints.txt in python-troveclient.

But since python-troveclient is itself listed in upper-constraints.txt
you can't just stick it in tox.ini and expect good things to happen.

I'm adding a co-author to this change based on [2].

[1] https://review.openstack.org/#/c/382493/
[2] https://review.openstack.org/#/c/398339/

Co-Authored-By: jiansong <jian.song@easystack.cn>
Change-Id: I386efb2d5c147417af7ea25704405977c9b6bbcd
2016-11-16 22:38:20 -05:00
Jenkins ce9aee2481 Merge "Remove times.dbm file for each tox run" 2016-04-14 17:00:27 +00:00
Peter Stachowski 553e3041e8 Add reno for release notes management
Add reno to generate release notes for the Trove client.

Change-Id: I8e475e1148ec32f9beb3398ecbb5effccd7ea4fb
2016-04-08 00:45:49 +00:00
Peter Stachowski ff70d10903 Remove times.dbm file for each tox run
If you run the py27 tox tests then attempt to run the py34 tests,
the following error will occur:

    running testr
    running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
    OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
    OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
    ${PYTHON:-python} -m subunit.run discover -t ./ ./ --list
    db type could not be determined
    error: testr failed (3)

This happens because the apparently the times.dbm file generated
by py27 is not compatible with py34. The converse is not true though -
if you run py34 first, py27 will work.

Both these bugs have been filed against it, but I see no resolution
https://bugs.launchpad.net/testrepository/+bug/1212909
https://bugs.launchpad.net/testrepository/+bug/1229445

The work-around is to delete the file, which is what is now done
before running every tox test. Once the bug has been fixed, the
work-around can be removed.

Change-Id: Icf5d9efc65ffda8acdcc6f43b37ef03c84b3fd43
Closes-Bug: #1565928
2016-04-04 18:12:44 +00:00
ting.wang e9e4c142b4 use oslotest to break into the debugger when running test cases
Once we add debug testenv, we can use "tox -e debug" to debug test cases
when tox is running. Then tox will use oslotest which really debug our
test cases.

Only we should do is insert pdb into code.It's easy to use.

The same in trove:
https://review.openstack.org/#/c/265524/

usage link:
http://docs.openstack.org/developer/oslotest/features.html

Change-Id: I93709451af9a14fc9c71e1c3306a1a025aee8b44
2016-01-21 12:57:03 +00:00
Janonymous c5cc8be33e Put py34 first in the env order of tox
To solve the problem of "db type could
not be determined" on py34 we have to run first the py34 env to, then,
run py27. This patch puts py34 first on the tox.ini list of envs to
avoid this problem to happen.

Change-Id: I90be329de961a0a63607d04b5c7cc88d033f05ec
Closes-bug: #1489059
2016-01-07 02:53:03 +00:00
shu-mutou 5ff8979c48 Drop py33 support
"Python 3.3 support is being dropped since OpenStack Liberty."
written in following URL.
https://wiki.openstack.org/wiki/Python3

And already the infra team and the oslo team are dropping py33
support from their projects.

Since we rely on oslo for a lot of our work, and depend on infra
for our CI, we should drop py33 support too.

Change-Id: I37a08fc005ec78031e582721a5e472348ee5324c
Closes-Bug: #1526170
2016-01-05 16:10:03 +09:00
ricolin bcb2b8123f Remove py26 support
As of Mitaka, the infra team won't have the resources available to
reasonably test py26, also the oslo team is dropping py26 support
from their libraries. since we rely on oslo for a lot of our work,
and depend on infra for our CI, we should drop py26 support too.
Closes-Bug: 1519510

Change-Id: Ifc92fdb0823a032d9b9f744494276a702a16e8b7
2016-01-03 10:11:13 +00:00
OTSUKA, Yuanying bf06ebff63 Delete python bytecode before every test run
Because python creates pyc files during tox runs, certain
changes in the tree, like deletes of files, or switching
branches, can create spurious errors.

Change-Id: I948892fb820f3d0583731627068ae3aa254121e7
Closes-Bug: #1368661
2015-11-17 10:09:25 +09:00
Sushil Kumar 025191af50 Fixes new hacking rules
Updated the hacking version as per global-requirements.

Fixed some of new appearing hacking rules, as listed follows:
- E128 continuation line under-indented for visual indent
- E265 block comment should start with '# '
- E713 test for membership should be 'not in'
- H238  old style class declaration, use new style (inherit from `object`)

Rules which are not yet fixed have been incorporated to ignorelist
- H405 Multi line docstrings should start with a one line summary
       followed by an empty line
- H501 Do not use locals() or self.__dict__ for formatting strings

Change-Id: I885c6fa8ad0e6a98f7a8479f3441ed08ed2cbaa6
2015-05-26 08:58:51 +00:00
Sushil Kumar d688936da7 Updated coverage related options to project
- Added .coveragerc file to project, this file is utilized
  to provide variuos various options like while running coverage.
- Used the .coveragerc file available in trove project.
- Updated tox.ini to show the calculated coverage results.

Change-Id: I9cc72766ab5a3ca48c60089062f37123dafc2850
Closes-Bug: #1453100
Closes-Bug: #1453101
2015-05-08 11:26:55 +00:00
Jeremy Stanley 94513614a1 Work toward Python 3.4 support and testing
Change-Id: I4a9c0444af0abf408ffd3899106f4cacf3c93aa1
2014-09-03 19:05:59 +00:00
Sushil Kumar 8bc695bd70 Enabled F821, H306, H402, and H404 flake8 rule
Reasons:
- F821 is disabled.
- H306 is disabled.
- H402 is disabled.
- H404 is disabled.

Changes:
- Updates tox.ini to enable F821, H306, H402 and H404 rules.
- Updates code for F821, H306, H402 and H404 violation.

Change-Id: I772270bb833ac774e080fc63e330d6b333f23de2
2014-05-09 08:54:39 +00:00
Andreas Jaeger 21a22403ca Fix building of documentation
Now both the standard command "python setup.py build_sphinx" and
"tox -e docs" will build the documentation.

The changes:
* tox.ini: Fix docs section: Remove unneeded deps line, the general
  deps line is just fine. Enable the command, clean up before running
  sphinx and use the normal command for execution.
* pydocs.rst: This throw an error while building since
  troveclient.client.Dbaas does not exist, replace it.
* index.rst: Generate table of content. No need to include the files.

Change-Id: I2095ef73a76b0212e33776af925f5eaf1810be7a
Partial-Bug: #1315101
2014-05-01 20:48:27 +02:00
Dirk Mueller d4a62491e1 Tighten flake8 checks in Gating
There are a few checks that already pass:
 - F401 - unused imports of modules
 - F403 - ‘from module import *’ used; unable to detect undefined names

And there are two (H401 and H403) that can be made
passing easily. Enable gating on all of them.

Change-Id: I9d3c49ecea1b2171d194ab6cc751316c252081e8
2013-12-18 14:08:37 +01:00
James E. Blair 8c0e1fb23a Add -U to pip install command in tox.ini
Ask pip to upgrade packages in the virtualenv so that a long-lived
virtualenv is still kept up to date as external dependencies change.

Change-Id: Id1e83aa5dd7c39d4827baeb39827b0ddeb8b6d4a
2013-12-11 09:26:56 -08:00
Denis Makogon 69c865695f Ignore fewer PEP8/flake8 rules
Reasons:
- code should be pythonicaly clean,
  that is why number of ignored rules should reduced

Changes:
- E125, F811, H102, H103, F201, H23,
  H302, F841, H301, H702, H703 rules are now enabled

Change-Id: Ibf4025162244d3c2f1278b49a76ec1527a729042
2013-12-10 18:49:20 +02:00
Sushil Kumar bbc9f049d7 Updates tox.ini to use new features
Reasons:
 - tox update v1.6

Changes:
 - tox 1.6 allows us to skip the sdist step, which is slow.
 - It also allows us to override the install line. In this case, it's
   important as it allows us to stop getting pre-release software we
   weren't asking for.

Original patch by Monty Taylor, talked about here:
http://lists.openstack.org/pipermail/openstack-dev/2013-September/015495.html

Change-Id: I3d857f8ef19b49e0a09b50a9eda7121b28329532
2013-12-09 13:41:03 +00:00
Debasish Chowdhury 9c7120959e Removes unused import statements
Change-Id: If229aa3f6e1009e1abfba13aba3970bdf2dd3761
closes-bug: #1255885
2013-11-30 18:52:19 +05:30
Michael Basnight 6431cc8258 Adding py33 gating to the client
Change-Id: I47e493bae8a00b5182608e31fcea82c3cacb152e
2013-10-23 16:13:40 +00:00
Monty Taylor 42db0cf585 Tweak pbr conf
Mainly, remove the pin in setup.py and remove the hook entry in
setup.cfg. Update from requirements while we're at it.

Change-Id: I34a05229b9ea0bdfd99dc16d09713c9494c1cb78
2013-10-09 22:47:23 -04:00
Alex Gaynor 9310edb33d Added support for running the tests under PyPy with tox
This is a precursor to having them run under check and gate.

Change-Id: I98692ac2591d488f0c5c6e64b1c176b21254289c
2013-09-05 10:02:27 -07:00
Denis M 812755e8a0 PEP8 with tox -epep8 check fails
Change-Id: Ife06919f321ab4ad73bece2e6080fbd7d947eeef
Fixes: bug #1219014
2013-08-30 20:32:17 +03:00
Dirk Mueller 4ddb58ce9e Start using pyflakes
Instead of globally disabling pyflakes warnings,
disable only those that occur frequently and
fix the rest. Enable gating on those.

Change-Id: I774d809ebcda2339b30c104b031211a3b2c491bd
2013-06-26 13:48:18 +02:00