* removed skipsdist=True to make sure placement available in the virtual
env
* passenv fixed as space separated list is not allowed any more
* improved the doc generation command line to print all the errors
instead of stopping at the first one
* added functional-py310 for convenience
* removed basepython = python3 as we assume all developer switched to
python3 in their env already
* removed ignore_basepython_conflict = True as without the basepython
definition generative targets now work without conflict
* updated the install_command to mimic better what tox uses by default
Depends-On: https://review.opendev.org/c/zuul/zuul-jobs/+/866943
Change-Id: I1de24b7a98f149fce33d4e5eca82460eea72140b
In Zed cycle, we have dropped the python 3.6/3.7[1] testing
and its support. Add release notes and update the python
classifier for the same.
[1] https://governance.openstack.org/tc/reference/runtimes/zed.html
Co-Authored-By: Ghanshyam Mann <gmann@ghanshyammann.com>
Change-Id: I998b34f884a2869d46ff05a179708a7f775e1615
As described in [1]. Unfortunately it doesn't seem to be possible to
silence these for other modules (cough...oslo.db...cough), presumably
due to how SQLAlchemy has configured warnings. We'll have to ignore
these for now.
[1] https://docs.sqlalchemy.org/en/14/changelog/migration_20.html
Change-Id: I28bc91d515440553828976dd1d3a3aef36a6d6a9
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Our minimum constraint for this dependency is now at the correct
version, meaning we no longer need this filter. Remove it.
Change-Id: I94485a3f16b0cd47ae1e2331efc6b19eb4f6278b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
There are few failure in l-c jobs due to
- The conflict is caused by:
The user requested pyflakes>=2.1.1
hacking 0.12.0 depends on pyflakes==0.8.1
- The conflict is caused by:
The user requested requests>=2.14.2
keystonemiddleware 4.18.0 depends on requests>=2.14.2
oslo-config 6.7.0 depends on requests>=2.18.0
Remove the flake8 and pyflake from lower constraints as they are
maintained in hacking side[1]. Maintaining in hacking aas well as
in project side can lead to version conflict. Also few more deps
from l-c as they are not used in placement directly.
Update requests version to 2.25 to fix the http connection failure with
2.18
- https://storage.bhs.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/zuul_opendev_logs_dff/766994/6/check/openstack-tox-lower-constraints/dff1943/testr_results.html
This commits also moves the code to latest hacking 4.0.0 with W504 in
ignore list and fix W503 and other checks.
[1] 4069b0c4f5/lower-constraints.txt (L9)
Change-Id: Id2761300060597c1744e76ea77740ed380d98943
Python 3.8 is now our highest level supported python runtime,
but there are no functional tests run in the gate.
This patch adds the tests to the gate.
Change-Id: Ia81b3983ea3636beadf0e58c1b584d607bd567b4
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: If9931b519f7bba4faa0529f0a5403c935e36dacb
This is modelled on the similar change in nova [1] but is
simpler because Placement was already using python3 for
"integration" style tests.
The 'train' python3 template is replaced with corresponding 'ussuri'.
The python template is removed (it is 2.7) and the pep8 job that was
included in that template is now listed in check and gate jobs.
.zuul.yaml is updated to not do a generic 'funtional' test,
instead versioned tests only.
setup.cfg removes indications of support for python 2.
A reno is added.
tox.ini is changed to make the functional environment a
base environment for specific functional jobs.
[1] Ie1a0cbd82a617dbcc15729647218ac3e9cd0e5a9
Change-Id: Ifce3b0c0ff11553f32b2d02df07fde81efc34100
This follows the instructions [1] in an attempt to build pdf docs.
Several doc/source/conf.py changes are required to get this to work.
The most important one is
'maxlistdepth': '10',
which prevents the build process from stalling out and dropping the
caller into an interactive session.
[1] https://etherpad.openstack.org/p/train-pdf-support-goal
Change-Id: Icf7c22bf9d1de6fb2a74a756c370930d4c00b0b9
Story: 2006110
Task: 35398
The api documentation is now published on docs.openstack.org instead
of developer.openstack.org. Update all links that are changed to the
new location.
Note that redirects will be set up as well but let's point now to the
new location.
For details, see:
http://lists.openstack.org/pipermail/openstack-discuss/2019-July/007828.html
Change-Id: Iccddd4356b5d7c28977ad954654d0875972dae97
We have an 'api-ref' docs target - use that instead.
Change-Id: Ie94add90b507d631a74f4617de7feba56fb0c646
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Use whereto to test that the redirect rules do what we expect.
Change-Id: Id3a8f3b9f372ebe9176f1df917f7a6aac30a8e92
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Getting allocation candidates for one request group, placement
internally calls provider_ids_matching_aggregates() several times with
the same arguments. This is redundant and can degrade performance.
This patch changes to call it on initialization of
`RequestGroupSearchContext` object and cache the results so that we can
refer the results later on demand.
Change-Id: I93e1fa81a7345b651ea2d58dfa0d5508e726f43f
Story: 2005712
Task: 31038
Nothing is being translated in placement so, for the sake of being clean
and tidy, this patch removes the framework for translation and the
import of oslo.i18n.
Originally the hope was we could remove the dependency on oslo.i18n and
Babel entirely to save some disk space but many other oslo-related libs
depend on oslo.i18n so they are present anyway. [1]
[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-March/004220.html
Change-Id: Ia965d028b6f7c9f04d1f29beb12f4862585631d5
We had carried over the full list of pep8 whitespace ignores from nova.
Trying to address them all in the entire nova repository would have been
too big a task; but it's tenable here in placement.
Do it now rather than letting these whitespace issues compound.
This change removes the E* whitespace ignores and fixes the pep8 issues
they were masking.
Change-Id: Icbabdb9b56fd5a3e9fd14ab537abf3d0d6456fee
In tox versions after 3.0.0rc1 [1], setting the environment variable
PYTHONDONTWRITEBYTECODE will cause tox not to write .pyc files, which
means you don't have to delete them, which makes things faster.
In older tox versions, the env var is ignored.
If we bump the minimum tox version to something later than 3.0.0rc1, we
can remove the commands that find and remove .pyc files.
[1] 336f4f6bd8
Change-Id: Id9a97af032a2dbefdc50057270368ad087e6bb5f
While exploring removing unused packages from lower-constraints.txt it
became clear that the lower-constraints job was not working as expected:
Because our tox config has usedevelop=True 'setup.py develop' is called
to install the placement package after the install command is called.
This means that the lower-constraints are clobbered.
I had mistakenly assumed that turning off 'usedevelop', which causes
'setup.py install' would not make any difference, because it usually
installs dependencies too. It turns out however, that when using pbr
and within a git working dir, it does not. That took some time to
figure out. Oh well.
This change makes it so that we create the tox environment using
usedevelop=False and with our own install_command, to avoid upper
constraints conflicting with lower constraints.
This flagged up a few changes, the main one being that we did not have
a new enough version of keystonemiddleware in order to require use of
www_authenticate_uri. requirements.txt is updated for this as well.
And PasteDeploy needed to be updated to work with Python 3's notion
of namespace packages.
psycopg2 need a newer version to work with Postgresql 10.
oslotest needs to be raised to 3.4.0 because the tests in
cmd.test_manage use features to control what is capture by the Output
fixture from oslotest. Note that the lower-constraints job found
this problem and also demonstrates why we must run the lower-constraints
job without upper-constraints being involved. upper-constraints will
"win" and we don't want that. The point of the job is find packages
where lower-constraints are wrong, so it must "win".
The end result here is a lower-constraints.txt file that starts from
the lower-constraints.txt defined by nova, and then is adapted to
update the versions of packages that were not up to date, remove
those packages which are no longer present, and add some that are
now required.
Change-Id: Id66a28f7ace6fc2adf0e1201d9de5f901234d870
While looking into making py36 available when running tox without '-e'
and making py37 more available for both unit testing and functional
testing, it became clear that our tox.ini was a bit messy. This change
cleans it up to:
* Removes all py* jobs and lets tox define those automatically. Their
commands come from the base [testenv].
Non-unit tests need to define their commands specifically.
* move pep-related tox below both unit and functional
* remove some out of date comments
* set the default when using tox without -e to unit and functional
in 2.7 and 3.6, and pep8
* removes the 'stestr slowest' from the unit and functional test env's.
It's not used consistently and the output is far from consistent so
it doesn't seem to have any particular value (for this project)
This is one of several ways to do this cleanup. This way assumes some
knowledge of the fact that tox defines a lot default jobs with default
python versions (via factors[1]).
Note that the releasenotes job does not currently work and did
not work before these changes, a conf.py is missing.
[1] https://tox.readthedocs.io/en/latest/config.html#factors-and-factor-conditional-settings
Change-Id: I9a877439e13eb753c7f98dc02e41db891ce33690
In tox.ini file, the doctrees directory is specified
as an argument of sphinx-build command in api-ref,
releasenotes targets.
But it is missing in docs. So add it.
TrivialFix
Change-Id: I767b675b503cd627e80c7c1ff434d4a8ad53203a
The dependencies knock down the four most complex methods in the
project, bringing our most complex method to 14 (and hence our
max-complexity limit to 15).
Ife303d018a26ddcf8ea41d5950dc774c5e898a56
placement/util.py: 'parse_qs_request_groups' (17)
I9f3aa66b4806cf2c34f5271a5f4426839cb872ce
placement/objects/resource_provider.py:
'ResourceProviderList._get_all_by_filters_from_db' (16)
placement/objects/resource_provider.py:
'_get_provider_ids_matching' (16)
I80f8b1a74b8afdabbb85afc6caef1abef8ac3751
placement/objects/resource_provider.py:
'AllocationCandidates._get_by_requests' (16)
Change-Id: I11d3e3c0e1baf729f2acceafbe2f115212a08385
Before this patch, the project's max-complexity of 17 was perpetrated by
RequestGroup.dict_from_request, the request querystring parsing method
used for GET /allocation_candidates. This refactor-only patch splits
that method into smaller chunks, the most complex of which now comes in
at 8.
There is no functional change, hence no deltas to tests.
Change-Id: Ife303d018a26ddcf8ea41d5950dc774c5e898a56
This dries up tox.ini a bit while preserving the explanatory
comment. Having the grouping expression on test jobs that don't
require it has only minor impact: the regex is applied to the
list of tests and no groups are found.
Change-Id: I89330cf5b0ace25db6a7575cfa4f93d9575b08ac
Placement has always relied heavily on functional testing for both API
and database testing, so not including those tests in 'coverage' leads
to misleading results.
This change adjusts the cover job in tox to use a test path of
placement/tests, resulting in all the tests running.
In the process .coveragerc is updated to be placement oriented
and make sure we do not ignore branches.
This is in preparation for turning on a check job for coverage.
See this email for more on that:
http://lists.openstack.org/pipermail/openstack-dev/2018-September/134385.html
A followup patch will turn on a check job for it.
Change-Id: I6c122facc9c9f6e0b2a1d69c6aaf5faeee7cf253
Change [1] added support for tox -e genconfig via a configuration file
called placement-config-generator.conf. Since we're in the placement
project and only have one config generator, the placement- part is
redundant. In keeping with similar pieces (e.g. policy-generator.conf)
this patch renames the file and fixes references.
[1] https://review.openstack.org/#/c/601838/
Change-Id: I8ea9c00d26539feab141ada493bc825987046b3d
The current max-complexity in placement code is 17, so set the
upper bound in the pep8 tests to max of 18 so we get an error
when we're going to make it worse. The current high complexity
(but still under 18) functions are:
./placement/util.py:415:1: C901 'parse_qs_request_groups' is too complex (17)
./placement/objects/resource_provider.py:1341:1: C901 'ResourceProviderList._get_all_by_filters_from_db' is too complex (16)
./placement/objects/resource_provider.py:2848:1: C901 '_get_provider_ids_matching' is too complex (16)
./placement/objects/resource_provider.py:4076:1: C901 'AllocationCandidates._get_by_requests' is too complex (16)
Change-Id: I58dc5acb9bb13dcdb5623d13515820591ec5f974
When part of Nova, many files were named in such a way as to indicate
that they were separate from the nova files that did the same thing. Now
that that distinction is no longer needed, we can rename them to sound
more natural.
Additionally, references to these file names in other parts of the code
have been updated.
Change-Id: Id4439b4af827b64bbac213085ac74d1283c96db0
This patch does pretty much the minimum possible to get `tox -e docs`
building and gating. Much, much more needs to be done to make the
content good.
Also corrects a link in the api-ref which, once these are publishing,
would have pointed to the wrong place.
Change-Id: I5cbc3a3cceeaeaa7be5593658b6a03fa25fb69d0
The pip-missing-reqs job does not exist but because of the way
we have tox configured, running 'tox' by itself will run what
amount to a null job, consuming time but testing nothing.
See also: I8355372da93b93cc1c7f7a1501af0fbd01eee615
Change-Id: I0969908ca7f5acbcde4a3d561366295bf2403c83