Commit Graph

46 Commits

Author SHA1 Message Date
Hervé Beraud b0d5e455fc Add doc/requirements
We need to specify doc requirements in doc/requirements.txt
to avoid problems with the pip resolver [1] for the release team [2][3].
Removed specific doc requirements from test-requirements.txt.

The problem here is that this repos haven't doc/requirements.txt file
and by default in this case zuul will use the test-requirements.txt file
to pull requirements [4].

This requirements file contains extra requirements like flake8 that
collided with those allowed in our job environment and so the new pip
resolver fails to install these requirements and the job exits in error.

This project meet the conditions leading to the bug.

[1] http://lists.openstack.org/pipermail/release-job-failures/2021-January/001500.html
[2] http://lists.openstack.org/pipermail/openstack-discuss/2021-January/019611.html
[3] http://lists.openstack.org/pipermail/openstack-discuss/2021-January/019612.html
[4] https://opendev.org/zuul/zuul-jobs/src/branch/master/roles/ensure-sphinx/tasks/main.yaml#L36

Change-Id: I6bdfa9830a32ecf36e1931e1bb0afa366f1dfeb9
2021-01-05 14:00:00 +01:00
Andreas Jaeger 11ff7365a3 Update lower-constraints
This repo has not been testing lower-constraints at all due to
broken install_command. If you look at any lower-constraints run and
compare the install python packages with lower-constraints, you see
that those are completely different.

This change removes install_command and updates deps in tox.ini to
follow best practices (moving constraints into deps).
It also updates lower-constraints to newer versions.

Remove broken hacking test.

Co-Authored-By: Justin Ferrieu <jferrieu@objectif-libre.com>
Change-Id: I13daab9e53617266beff7053e50779d1f281802c
2020-12-14 18:03:59 -03:00
wangzihao 1cccdb2976 Bump hacking min version to 3.0.1
hacking 3.0.1 fix the pinning of flake8 to avoid bringing in a new
version with new checks.

bumping the min version for hacking so that any older hacking versions
which auto adopt the new checks are not used.

Change-Id: I80da860ff80bc3766d66511c70eb22467e25df01
2020-09-18 10:31:19 +08:00
Andreas Jaeger cbcdacac61 Switch to newer openstackdocstheme and reno versions
Switch to openstackdocstheme 2.2.1 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems

Update Sphinx version as well.

Set openstackdocs_pdf_link to link to PDF file. Note that
the link to the published document only works on docs.openstack.org
where the PDF file is placed in the top-level html directory. The
site-preview places the PDF in a pdf directory.

Disable openstackdocs_auto_name to use 'project' variable as name.

Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.

openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.

See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html

Change-Id: I6be1174686cb1d8f11e8cb4be58c0e739bf0f931
2020-09-07 18:47:30 +02:00
Andreas Jaeger b014dbe64c 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: I41a5518f1210c9a1b6d5217bbbcd99bbaa3c9b53
2020-08-18 22:27:09 -03:00
Sean McGinnis 18a47cb24a Use unittest.mock instead of third party mock
We can now use the standard library mock library instead of the third
party one previously needed for py27 compatibility.

Change-Id: Ia8e87cd6a25621a97c876de5422d0c9d0c8dd751
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-08-13 09:43:50 +00:00
Andreas Jaeger 56609c46f9 [ussuri][goal] Cleanup drop python 2.7 support
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

this removes some cruft that can be removed now:
* cruft in setup.cfg and setup.py
* tox.ini: Add ignore_basepython_conflict and increase minversion
  for that
* Python 2/3 specific requirements, the repo is Python 3 only.

Change-Id: Iae68e58c82a180eb771bef00a3f44fd28abe5fae
2020-02-24 20:16:56 +01:00
caoyuan 05eb7b9a58 tox: Keeping going with docs
Sphinx 1.8 introduced [1] the '--keep-going' argument which, as its name
suggests, keeps the build running when it encounters non-fatal errors.
This is exceptionally useful in avoiding a continuous edit-build loop
when undertaking large doc reworks where multiple errors may be
introduced.

[1] https://github.com/sphinx-doc/sphinx/commit/e3483e9b045

Change-Id: Ic3a57b513d3646b6931edc6163c2702805d29d57
2019-12-19 15:21:01 +08:00
Ghanshyam Mann afef05aca4 [ussuri][goal] Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in ussuri cycle.

Cloudkitty 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://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Depends-On: https://review.opendev.org/#/c/693631/
Change-Id: I44ea5cfe479558969ccb3ca57f416511614626cc
2019-11-16 14:35:39 +00:00
Luka Peschke 54c1b98b12 Update bandit version
This fixes the minimal bandit version to 1.6.0 and updates the
format of the -x option.

Change-Id: Ib0691b53669b6f4f7824bd4385640c5a805a1e2a
2019-08-26 12:17:41 +00:00
pengyuesheng 22e8c9337e Bump openstackdocstheme to 1.30.0
...to pick up many improvements, including the return of table borders.

Change-Id: Icfa6f07857d8afba91a2825c051b1d4b3449040e
2019-06-27 09:53:47 +08:00
pengyuesheng 460f12f744 Blacklist sphinx 2.1.0 (autodoc bug)
See https://github.com/sphinx-doc/sphinx/issues/6440 for upstream details
Depend-On: https://review.opendev.org/#/c/663060/

Change-Id: I5ce4d3388806ecbe050e78d40997ff68f9997afc
2019-06-17 14:36:38 +08:00
pengyuesheng 870679a441 Update sphinx dependency
Sphinx 2.0 no longer works on python 2.7,
so we need to start capping it there as well
depend on https://review.opendev.org/#/c/657890/

Change-Id: I64dc2b4aec81409bbc58291f36628221142cc3b3
2019-05-31 16:25:44 +08:00
Luka Peschke dc2509ba65 Bootstrap the v2 API
This adds a v2 API root to CloudKitty. An example endpoint along with some
developer documentation has been added. The API root is now served with Flask
instead of pecan.

Change-Id: I4ede52dae531631f7fe708400def01bc08a64dec
Story: 2004208
Task: 27717
Task: 27718
Task: 27719
2019-04-01 13:52:04 +02:00
Hervé Beraud 60740282c9 Add bandit for security static analysis and fix potential security issues
This change adds a basic bandit config for cloudkitty. It can be invoked
by running the tox environment for bandit;
    tox -e bandit

These changes also fix potential security issues find during bandit checks.
- binding to all interface: remove useless host_ip option to avoid issue
- hash function issue: switch from sha1 to sha512
- use of exec: can't be removed for moment so using #nosec comment

Change-Id: Iae7d7604457345fe6d482cf48311c9b75fdde947
2019-03-25 16:26:05 +00:00
Dao Cong Tien b3ae81dc92 Adds doc8 check to pep8
This patch adds doc8 check for .rst files to pep8.
Files that fail doc8 check are also fixed.

Change-Id: Ib8556b6eac0fb5a9bd3b7f8dcf000ab1b23e23bc
2018-10-22 11:14:57 +02:00
Luka Peschke c417e5f6cb Use global-requirements for requirements
This updates cloudkitty's requirement and setup files in order to use
openstack/requirements for constraints. This will help to avoid dependency
conflicts when cloudkitty is deployed in an openstack context.

Work items:

* Updated requirements.txt, test-requirements.txt and setup.py with the
  `update-requirements` tool provided by openstack/requirements.

* Added a lower-constraints.txt file.

* Added the "check-requirements" zuul job template to the CI.

Change-Id: I5aab02374523be83a65c8b7f47f1df5e93b5a3d2
2018-10-17 07:29:48 +00:00
François Magimel 2d455849b1 Bump the openstackdocstheme extension to 1.20
Some options are now automatically configured by the version 1.20:
- project
- html_last_updated_fmt
- latex_engine
- latex_elements
- version
- release.

This will show other versions of the doc, too.

Change-Id: I7d0a1b4e6cbb65e92eb332349e87c8896680e716
2018-08-21 13:54:06 +00:00
Vu Cong Tuan a3fd90b776 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: Icb3886271885bfee19981a6acdda3163f3cd72f8
2018-07-18 08:00:06 +07:00
Jeremy Liu 8fea4e1ec7 Update usage of gabbi in Cloudkitty test
Update usage of gabbi in CK tests, also set upper constraints for CK.

Change-Id: Idb207161d2704200e8e6108d3f3049ce95e9f797
2017-10-24 15:06:04 +00:00
Van Hung Pham efb35ee3a0 Switch from oslosphinx to openstackdocstheme
As part of the docs migration work[0] for Pike we need to switch to use
the openstackdocstheme.

[0]https://review.openstack.org/#/c/472275/

Change-Id: I90c760c25a2d9007982c7c0ae5b0bd76c9606bd2
2017-06-29 09:03:20 +07:00
ricolin 45e2ccfdfd [Fix gate]Update test requirement
Since pbr already landed and the old version of hacking seems not
work very well with pbr>=2, we should update it to match global
requirement.
Partial-Bug: #1668848

Change-Id: I1db16aa57df507352986f199260e2ba9e92e4605
2017-03-02 22:19:26 +08:00
Deepak 0fbb20ab3a Added release note for cloudkitty
This adds the releasenotes directory to the cloudkitty repo.
It maintains the releasenotes for cloudkitty.

Change-Id: Ia624add53a456c05e24f3a725f5f5edd6af35f45
Implements: blueprint maintain-releasenotes
2017-01-09 05:50:39 +01:00
Jeremy Liu 5d35fa1d93 Introduce hacking check to Cloudkitty
Add hacking check to ensure we use proper rules and follow
community guideline [1].

[1] http://docs.openstack.org/developer/hacking/

Change-Id: I6586c94023f94adb71369ac11b1a2eb13b449f56
2016-12-16 22:23:28 +08:00
Jeremy Liu 80d4aaffa6 Remove discover from test-requirements
It's only needed for python < 2.7 which is not supported

Change-Id: Id6e82bf0ea61c33f8f8e7c2bbd9549c742086bd0
2016-12-13 00:07:21 +08:00
Jeremy Liu 112310329b Pin kombu to < 4.0.0 to fix gate error
Change-Id: I5f872bd482e047230aabc2280e2362fc3143fcdb
2016-12-09 18:43:57 +08:00
Luong Anh Tuan 8dbb42d55b Remove mox3 in test-requirement.txt
mox3 was used for unit tests. But now we replace it with mock.
So I think there no need to keep it in test-requirement.txt.

Change-Id: I721edb98718b8f947446b4514fd0cc3d2cd7078a
2016-10-21 15:43:49 +07:00
Luka Peschke 302bb438f8 Specifies gabbi version in test-requirements.txt
Because of the modification of the handlers module in gabbi 1.26,
the python2.7 gate jobs did not work properly. This patch specifies that
the gabbi version must be inferior to 1.26.

Change-Id: I69f93959f30a829d746da24a17c10c8f75d60d6a
Closes-Bug: 1628930
2016-09-29 15:42:29 +02:00
Michael Krotscheck d71f167796 Updated from global requirements
Updated with mitaka requirements.
This patch performs a manual update of all requirements from the
openstack global-requirements repo.

Change-Id: Iab34d66b1c12deb53dc5c302db88d8726cabc88c
2016-03-25 01:14:12 +01:00
Stéphane Albert 4482d7daf8 Added new rating module PyScripts
PyScripts can execute arbitrary Python code.

Code is stored in the database.
Every piece of code is loaded in memory and executed on the fly.
Code isolation is ensured so that only required data is modified.
Implemented gabbi tests.

Change-Id: Ieb7cd45e53078694603062e425451fa68dc0f791
2015-10-15 17:43:27 +02:00
Stéphane Albert 04a9f0cd43 Added gabbi API tests
Added tests on all the core API.

Change-Id: I6610ddbe5071ce1231c80319ab1b43c9cd626de4
Depends-On: I2231521708f163d80538fe2e7e5559d4c06cf0c3
Depends-On: Ib05d533eecd32159c1bc7a639db1a49df678f726
Depends-On: I3302617c266111ba1d705d04f1acf20b9348614d
Depends-On: I0ab0f1b2a75d39b8d371c54a264856db69adc2fd
2015-09-17 08:50:13 +02:00
Stéphane Albert 1039e44ee6 Moving to Liberty cycle (0.5)
Transitioned from deprecated oslo namespace to newer ones.
Updated requirements.
Updated configuration.

Change-Id: Ic395878a21564ceed6febe85179523efd9956eb9
2015-08-28 16:51:03 +02:00
Stéphane Albert 34390d5308 Updated requirements to stable/kilo
Change-Id: I96114c8a9b2fb684be82d5edd6427c53e7ca9921
2015-06-09 16:53:10 +02:00
Stéphane Albert 2db226974d New HashMap rating module version
This commit is breaking the old HashMap database models and
configuration, migrations can't be applied.

- Renamed BasicHashMap to HashMap.
- Refactored all the API.
- Changed the way configuration is handled:
  - Every model is now accessed via UUID.
  - Every model can be seen as "flat" from the new API.
- Added calculation grouping, you can now apply multiple HashMap
  calculations for different metrics, the sum of every group is then
  applied.
- Added two levels of mapping, directly on the service name and on
  metadata field.
- Refactored HashMap to handle the new core API.
- Fixed problems with SQL and Numeric truncating data.
- Optimized SQL requests and models to use joins and filters.
- Added unit tests for the hashmap module.

Change-Id: Ibb63b0ac88eb92bec42497e0d72bf9800ea7379c
2015-03-16 15:32:23 +01:00
Stéphane Albert 8c05e1e451 Modified utils to implement all time calculations
Added support for oslo.utils.
Added tests for time calculations functions.
Modified code to reflect changes and remove direct usages of timeutils
and datetime.
All calculations are now enforced on UTC datetimes or timestamps.

Change-Id: I2e8add7e9d619c81cdeb25a066ea4e0bf8327792
2014-11-24 14:45:19 +01:00
Gauvain Pocentek 4a67f81068 Add tests for the DB state manager
This patch also defines a testcase base class which handles the database
connection setup.

Fix the format() calls for python 2.6.

Add eventlet requirement.

Change-Id: Id110aa817a680cc02c882ea24f275eb127a738a8
2014-09-26 18:45:55 +02:00
Jenkins 9816741a20 Merge "Bump hacking to version 0.9.2" 2014-09-05 15:00:47 +00:00
François Magimel fee222e9ad Remove docutils from test-requirements
The package docutils is not anymore in the global requirements and is
not required.

Change-Id: I4b0f8b060b8dac2b9acf511838bdbe4e73819913
2014-08-27 12:22:40 +02:00
Jenkins 59c3d9bd1a Merge "Removed docbook requirements from documentation" 2014-08-20 11:14:28 +00:00
Stéphane Albert 2b0f1a3b02 Removed docbook requirements from documentation
Dockbook extension is causing issues with read the docs and libtidy

Change-Id: I4ecf2e39d6862c76250d9b424ecda02f0e92200e
2014-08-20 13:04:37 +02:00
Stéphane Albert 01673326ff Updated sphinx version in test-requirements
Change-Id: Id7fc1e5545e724bf1081e6962439e2e65e085ac6
2014-08-20 12:43:20 +02:00
Stéphane Albert 254b13af5e Improved documentation (docstrings and sphinx)
Added docstrings to every controllers and types.
Added samples for every types.
Improved CloudKitty's developper documentation.

Change-Id: Idcd25777f67c61c096fbc52962bc173a86d614ba
2014-08-12 09:44:41 +02:00
Stéphane Albert 0dee462ea9 Setup and dist modifications
Renamed ckitty-orchestrator to cloudkitty-processor.
Updated requirements for future needs.

Change-Id: I2e35bb15e64d095d47314cc234fc2a701130655a
2014-08-07 23:22:54 +02:00
Christian Berendt a0221847b2 Bump hacking to version 0.9.2
Change-Id: If88c5345db65536604fd1f2d4c635a95a8b8f13d
2014-07-16 16:32:13 +02:00
Stéphane Albert d6f0a32b94 PEP8 and hacking compliance
Change-Id: I8854027c486fdf8ee3b2ca1812f5231a50b1014e
2014-06-20 19:03:26 +02:00
Stéphane Albert da94b9f21e Pushing initial work
Change-Id: I4a63e06985dafc15fcc50f325e49fe811d5a84b9
2014-05-30 19:37:53 +02:00