Order no longer matters starting with pip 20.3.
Change-Id: I743674eaf684be9d8b6255e90edc82de0cd80734
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Update version of tox to 3.9.0 to support inline comments in tox.ini
Import pep8 test requirements directly in tox.ini and do not import all
the test-requirements
Update version of hacking
Fix import orders in various modules
Leave filter for imports in tests/ for the time being
Change-Id: Ia625036d1f50ae97880ef70335804228320a9c6d
flake8 new release 3.8.0 added new checks and gate pep8
job start failing. hacking 3.0.1 fix the pinning of flake8 to
avoid bringing in a new version with new checks.
Though it is fixed in latest hacking but 2.0 and 3.0 has cap for
flake8 as <4.0.0 which mean flake8 new version 3.9.0 can also
break the pep8 job if new check are added.
To avoid similar gate break in future, we need to bump the hacking min
version.
- http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014828.html
Change-Id: I4bf93e866b35bd5c7f584539760ff159a94c532b
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.
Change-Id: I90d966a150d128e177f157e292035cfb71d89ad1
Introduce support of python 3.8 and move tox and jobs to py38.
jsonschema 3.2.0 [1] support python 3.8
[1] https://github.com/Julian/jsonschema/pull/627
Change-Id: Ibcfa044dd0f3b29fd290559795ea1d98e194e886
We don't need to depend directly on python-subunit.
In python3 we don't need safe_hasattr.
We don't use testrepository.
In lower constraints, os-client-config and mox3 are
transitive depends that we do not care about so don't
need to track lower pins for them.
futures and ipaddress were removed from requirements
but not from lc.
Finally, remove future from lc and from __future__
since we're python3 only.
Change-Id: Ic22079f78f77221e83986e5a835457dbefc3ded7
We have kept hacking capped below 1.2 for quite awhile. Newer versions
of hacking pull in updated linters that have some good checks.
We want to limit the maximum version of hacking installed since the
global upper constraints does not do this for linters. Otherwise when a
new release of hacking is available in the future, stable branches may
suddenly be broken.
Change-Id: I0e0ee8a169ae93f7efb2cda2b1d2458c1d49e46b
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Ironic uses reset_interfaces option when patching a node to
reset all the hardware interfaces of a node.
This patch adds that argument to the patch_node method in
the baremetal module and introduces a patch method under
the node module to be able to evaluate the reset_interfaces
parameter.
Also, it modifies the _prepare_request method in resource
to accept query parameters in urls and build the request
uri keeping those into account.
Increasing minimum version of mock to 3.0.0 to be able to use
testing features not supported before that version, e.g.
assert_called_once
Change-Id: I8bca403df7d38a7ac1d066c5f1d7e2bff1deb054
Previously, invoking a REST primitive (.get(), .put(), etc.) on a proxy
would ignore the raise_exc kwarg and always use raise_exc=False, causing
any error coming from the actual service [1] to return a Response object
even for responses with status >=400.
With this change, the raise_exc kwarg is honored: when True, REST
primitives with status >=400 will cause an appropriate ksa exception to
be raised.
[1] as opposed to lower level e.g. communication errors, which would
still raise
Change-Id: I463e9a63760a6e61827ba957dd9e5d23bd79f4e8
This commit enables SDK consumers using oslo.config for keystoneauth1
Adapter settings by introducing a method:
openstack.config.cloud_region.from_conf
This accepts:
- An oslo.config ConfigOpts containing Adapter options in sections named
according to project (e.g. [nova], not [compute]). Current behavior is
to use defaults if no such section exists, which may not be what we
want long term.
- A Session. This is currently required - if unspecified, a
ConfigException is raised - but in the future we probably want to
support creating one (and an auth) from the conf.
- Other kwargs to be passed to the CloudRegion constructor.
The method returns a CloudRegion that can be used to create a
Connection.
Needed-By: blueprint openstacksdk-in-nova
Co-Authored-By: Eric Fried <openstack@fried.cc>
Change-Id: I05fb4da39d2eefc91828ace02db2741b62a2cb0a
We have jsonschema capped at a fairly old version. Other than some
specific releases, it looks like keeping it below 3.0 was added in
I943fd68b9fab3bce1764305a5058df5339470757 without really any explanation
why.
In order to update to a 3.x release we need to:
1. Remove the cap from global-requirements.txt (see Depends-On), leaving
upper-constraints.txt at a 2.x release
2. Remove the cap from all consumers (this change)
3. Release a new version of consumers that are published to pypi
4. Update upper-constraints.txt with those new releases
5. Update jsonschema in upper-constraints.txt to a 3.X release
(See: https://review.openstack.org/649789)
6. Test consumers with the change from 5.
7. [Optional] fix issues in consumers that arise from 6.
8. Merge the change from 5.
Change-Id: I66ad793a52c657564ece35019430557a45edd3bf
Co-Authored-by: Sean McGinnis <sean.mcginnis@gmail.com>
Co-Authored-by: Tony Breeds <tony@bakeyournoodle.com>
This is a thing that nodepool has been doing for ages. With the upcoming
changes to remove the task manager, the mechanism it has been using to
put activity in the right place isn't going to be available anymore. But
also, people using openstacksdk from within a service might also want to
be able to do the same logging.
This improves upon the old method as well, as it uses the history in the
response object to get and report on all of the calls made as part of a
request. This will catch things that do auto retries.
While we're in there, add support for reporting to prometheus instead.
The prometheus support does not read from config, and does not run an
http service, since openstacksdk is a library. It is expected that
an application that uses openstacksdk and wants request stats collected
will pass a prometheus_client.CollectorRegistry to collector_registry.
Change-Id: I7218179dd5f0c068a52a4704b2ce1a0942fdc0d1
We had these in tox.ini before to streamline pep8 (it didn't need
to actually install openstacksdk) But now that we're doing local
hacking checks, we have to install the code, which means this
optimization is bong. Put things back in test-requirements like
sane people. While doing that, remove readme, which isn't in
openstack/requirements and just let doc8 check it.
Change-Id: Id1860a1df33610ad7072c13ef9ee61395b785b94
Make the docs tox environment use doc/requirements.
For pep8, just install the linters and skip installing the package.
Doing this but leaving in the constraints file keeps us in line with
upper-constraints on linters but lets our pep8 envs be tiny.
Finally, remove the doc8 line-length setting. It's not a big enough
difference to warrant changing it.
Change-Id: I3df81474fb52e2587d22c7789b6b553139eb37f2
os-client-config provided helper functions for constructing legacy
python-*client objects, as well as Connection and OpenStackCloud
objects.
openstacksdk isn't in the business of constructing python-*client
objects for people, so let's remove these. We also dont' need helper
functions in the openstack.config space for constructing Connection
since we already have openstack.connect for that (and we'll fold
OpenStackCloud in soon enough)
Change-Id: I09e4fe258ff58a8e8aec5919369ff856a5102b76
split docs requirements out into doc/requirements.txt and change the
helper tox docs env to be what the gate is going to be running.
As part of doing this, we can re-enable the enforcer code. However, it
doesn't seem to be working, so leave it as info rather than warn for
now.
Set the jobs and the tox env to use python3. The enforcer module wants
to use ifilterfalse/filterfalse which have different names in 2 vs. 3.
There's no reason to NOT run sphinx in python3.
Change-Id: I358db11b130b909084f7a9e8925477e931d87117
These aren't actually testing openstacksdk in any way at the moment,
and having them is making us have a test-requirements depend on shade
which will make adding openstacksdk as a shade requirement a circular
dependency.
Remove them for now. To re-add them, we want to:
- add openstacksdk as a shade requirement
- update ansible to import openstack instead of import shade
Once that's done, we can add the tests back, but without adding shade as
an sdk test-requirement. That way we can have shade test that the
ansible modules work if someone installs shade and doesn't explicitly
install sdk, and we can have sdk test that the modules work if someone
installs sdk and not shade.
Change-Id: Icb26f9c066bad6c2c045ac949ac1864e26b5b837
These are copies of the shade jobs, but they should work with this
stack.
The changes that are not the tests are changes needed to make the tests
work.
Change-Id: I9f223c4a9ac8dc2570b8698284512e1aa834970a
This sucks in the git history for both projects, then moves their files
in place. It should not introduce any behavior changes to any of the
existing openstacksdk code, nor to openstack.config and openstack.cloud
- other than the name change.
TODO(shade) comments have been left indicating places where further
integration work should be done.
It should not be assumed that these are the final places for either to
live. This is just about getting them in-tree so we can work with them.
The enforcer code for reasons surpassing understanding does not work
with python setup.py build_sphinx but it does work with sphinx-build
(what?) For now turn it off. We can turn it back on once the build
sphinx job is migrated to the new PTI.
Change-Id: I9523e4e281285360c61e9e0456a8e07b7ac1243c
python-subunit is not used directly anywhere
and it is dependency of both testrepository
and os-testr
(probably was used by some tox wrapper script before)
Change-Id: Ifd32c3add54e8cc752908be79242b8f3dcc145f2
doc8 is a linter for documents and used in openstack-manuals.
It is better to enforce document linters for simple checking.
This change is to add doc8 in tox file and fix line too long
in some files.
The current rules are as bellow:
- invalid rst format - D000
- lines should not be longer than 79 characters - D001
- RST exception: line with no whitespace except in the beginning
- RST exception: lines with http or https urls
- RST exception: literal blocks
- RST exception: rst target directives
- no trailing whitespace - D002
- no tabulation for indentation - D003
- no carriage returns (use unix newlines) - D004
- no newline at end of file - D005
Change-Id: I5b409fbfd95e05921310c6ecf4afea0220fb0bf0
This changes the hacking version requirement to conform with global
requirements. It is not synced from global requirements for some reasons
and it is causing pep8 errors - pbr version conflicts.
Change-Id: Ia8c6dce7562738628884596973df236be74aabd4
Per the approach on https://review.openstack.org/#/c/428276/, and in
general even outside of that change, we should have more strict
enforcement on the inclusion of our public proxy APIs in the
documentation. This tool runs as a part of our doc build, via `tox -e
docs`, and collects all of the public proxy methods and then compares
that list to the list of methods that were produced by Sphinx.
For right now this will only output warnings, but we should eventually
turn on enforcer_warnings_as_errors in doc/source/conf.py so that we can
truly enforce these things. If you don't document something, it'll kill
the doc build and then kill the docs gate job, so undocumented code
won't be accepted. We'll need to leave it off for the time
being as we transition into it.
Change-Id: I96743de7e0790da98d758415e084a26a92aa3c70