Commit Graph

103 Commits

Author SHA1 Message Date
Stephen Finucane 01b9a49c95 requirements: Sort alphabetically
Order no longer matters starting with pip 20.3.

Change-Id: I743674eaf684be9d8b6255e90edc82de0cd80734
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-06 10:47:47 +00:00
Riccardo Pittau a714e096f3 Apply pep8 import order style
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
2021-03-08 16:50:54 +01:00
wu.shiming 767660b0a0 Fix hacking min version to 3.0.1
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
2020-09-30 11:21:24 +08:00
Hervé Beraud 6f9cd3f7a7 Use unittest.mock instead of mock
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
2020-07-17 09:55:29 +02:00
Hervé Beraud 632db25246 Refresh python versions
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
2020-05-26 10:36:06 +02:00
Zuul 6b18264878 Merge "Remove some unneeded things from test-requirements" 2020-05-13 04:23:57 +00:00
Monty Taylor 9b253307a7 Remove some unneeded things from test-requirements
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
2020-05-10 08:23:38 -05:00
Andreas Jaeger 0a6be630a7 Update to hacking 3.0
Hacking 3.0 was just released with minor changes, update to the new
version.

Change-Id: I9f242b5dace1714ea35f8c3ba39b42520fed3973
2020-03-31 13:43:39 +02:00
Sean McGinnis 8ca613e43f Raise hacking to 2.x
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>
2020-03-29 11:07:34 -05:00
Riccardo Pittau 13c6bc2bd9 Add reset_interfaces argument to patch_node
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
2020-01-06 11:21:21 +01:00
Eric Fried b54d03a4c0 Make proxy honor raise_exc in REST primitives
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
2019-09-24 17:25:05 -05:00
Monty Taylor 86ad9debd1 Make factory for a CloudRegion from CONF objects
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
2019-06-04 08:36:23 -05:00
Eric Fried 83cd4f9d8c Uncap jsonschema
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>
2019-04-25 09:50:21 -05:00
Monty Taylor c8b96cddd3 Collect request stats
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
2019-03-11 19:45:04 +00:00
Monty Taylor 8748f4a4f8 Move pep8 requirements in to test-requirements
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
2019-03-10 16:32:03 +00:00
OpenStack Proposal Bot 20442a9f63 Updated from global requirements
Change-Id: I5a73cf3edd601deba87e2bdc84ff88a8b9541197
2018-03-23 01:51:33 +00:00
OpenStack Proposal Bot ad73e46483 Updated from global requirements
Change-Id: Id1418b66d055d3efaa71825a8e1becc608e54b73
2018-01-27 18:35:23 +00:00
Monty Taylor d26bc12f71
Update docs and pep8 tox environments
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
2018-01-24 05:43:19 -06:00
Monty Taylor cd9bd1ef39
Remove legacy client factory functions
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
2018-01-09 16:35:46 -06:00
Monty Taylor da99fae94d
Update for new docs PTI
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
2018-01-05 12:44:02 -06:00
Monty Taylor 688fc5a609
Remove ansible functional tests for now
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
2017-11-16 16:12:40 -06:00
OpenStack Proposal Bot 2dfe498df2 Updated from global requirements
Change-Id: I3142490cf4b7660ccb59ba7f06f87d3ddd620459
2017-11-16 11:26:05 +00:00
Monty Taylor d25b80eaf3
Add jobs for Zuul v3
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
2017-11-15 09:03:59 -06:00
Monty Taylor 535f2f48ff
Merge shade and os-client-config into the tree
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
2017-11-15 09:03:23 -06:00
Monty Taylor a4ee1a3f09
Merge tox, tests and other support files
Change-Id: I5a4759e36089f1f4fab0c75412c94d051d8b16a7
2017-10-04 14:51:08 -05:00
zhangyangyang aae4528eeb Cleanup test-requirements
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
2017-09-21 23:28:03 +08:00
OpenStack Proposal Bot 521d967139 Updated from global requirements
Change-Id: I7af6ff374f2b6df62892d2e2938f97c091128113
2017-09-16 23:23:58 +00:00
OpenStack Proposal Bot 8396fd548f Updated from global requirements
Change-Id: Ie6497aa5d9d3bea2ed7db264787462aae6831c83
2017-09-13 13:03:04 +00:00
OpenStack Proposal Bot 9de98c4d6f Updated from global requirements
Change-Id: I6aa99cd8ff4394461a056110aa1b9d1310e79a53
2017-09-13 00:15:34 +00:00
OpenStack Proposal Bot 1e5dbb59ce Updated from global requirements
Change-Id: I4567ef7ac70b85d5542cd2e4ad1fd5c375c03e5a
2017-09-11 21:49:24 +00:00
liuxiaoyang f18dc29eb0 Add doc8 rule and check doc/source files
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
2017-08-23 08:27:31 -04:00
OpenStack Proposal Bot d6ce9b719b Updated from global requirements
Change-Id: Ic16abb7dbc290d7ae0da1f185c7375a7471d67dc
2017-08-18 04:52:15 +00:00
OpenStack Proposal Bot 1c98ea5e2d Updated from global requirements
Change-Id: Ifff5f947c99ef3e8d41dc4982a5b864fd4bf4684
2017-07-27 20:33:19 +00:00
OpenStack Proposal Bot dadce7b740 Updated from global requirements
Change-Id: I6358a54b79de12f9b37aff759d7587b2c8d014bb
2017-07-14 05:08:29 +00:00
OpenStack Proposal Bot d922253958 Updated from global requirements
Change-Id: Ie558b341237a1e095d14dc275fe0569e4b6a6e78
2017-06-27 12:22:24 +00:00
OpenStack Proposal Bot 54334fd6f0 Updated from global requirements
Change-Id: I89f967e740452ac30bbab6abbb37987b7f936ffe
2017-06-10 21:48:52 +00:00
OpenStack Proposal Bot 07384cb8d4 Updated from global requirements
Change-Id: Ic7bb0f4928f225f47fec07385871fadc3d5f368b
2017-06-06 12:25:13 +00:00
tengqm 45dc2525e8 Change version of hacking in test-requirements
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
2017-03-01 09:54:39 -05:00
OpenStack Proposal Bot bf6deba174 Updated from global requirements
Change-Id: If0958bd90449c12785e8ff451cf334a7e6fd8ff7
2017-02-11 17:52:03 +00:00
Jenkins d4485de8f0 Merge "Enforce inclusion of pulic proxy methods in docs" 2017-02-11 12:22:27 +00:00
Brian Curtin ad3a0fcf44 Enforce inclusion of pulic proxy methods in docs
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
2017-02-10 09:24:39 -05:00
OpenStack Proposal Bot 52eeaa554d Updated from global requirements
Change-Id: I9ca1636b5b294de7163c52a7f35bb4f4417f320b
2017-02-10 05:59:27 +00:00
Tony Breeds 94af4ac99a Remove discover from test-requirements
It's only needed for python < 2.7 which is not supported

Change-Id: I1225bc24f61ed5f0f2537099d6f79ec94070dc5a
2017-01-03 14:02:45 +11:00
OpenStack Proposal Bot 9cd28a114d Updated from global requirements
Change-Id: Ie4bfb4355c9c9d0240af76d50ed6115ddb271bb4
2016-12-02 05:13:54 +00:00
OpenStack Proposal Bot d481870f2f Updated from global requirements
Change-Id: Ia6685e9d1da299ff3107c64e412b9578d982729a
2016-10-22 01:27:29 +00:00
OpenStack Proposal Bot adba0fe7c8 Updated from global requirements
Change-Id: Ia5da723aa3e21bb58bfbd76da08ebea09466cbba
2016-09-30 20:06:12 +00:00
OpenStack Proposal Bot 809f2fac73 Updated from global requirements
Change-Id: I750c0ef1d0ad619e5518e71d08866d7149d23445
2016-09-28 17:00:57 +00:00
OpenStack Proposal Bot 52eeb57a83 Updated from global requirements
Change-Id: I96ea1eafca9e9eb5c41e1fc50b02796b653f9a57
2016-09-26 04:27:13 +00:00
OpenStack Proposal Bot 38d4d1f2d8 Updated from global requirements
Change-Id: Ibc31600646fb185c5bc6f17e26c22582ef637a55
2016-08-26 05:14:22 +00:00
OpenStack Proposal Bot 3b54b0440e Updated from global requirements
Change-Id: I0814578df068d6c4b655ac22c5f38b66cf6570b9
2016-07-21 13:44:02 +00:00