From 4525717d41846ec1fb3e751eab19a88b75672e69 Mon Sep 17 00:00:00 2001 From: Alexandre Chaussier Date: Fri, 19 May 2017 20:08:11 +0200 Subject: [PATCH 1/3] WIP - Implement pbr --- AUTHORS | 4 ++ ChangeLog | 118 ++++++++++++++++++++++++++++++++++++ HISTORY.rst | 71 ---------------------- docs/temelio_monitoring.rst | 8 +-- requirements_dev.txt | 1 + setup.cfg | 30 +++++++++ setup.py | 61 +------------------ 7 files changed, 160 insertions(+), 133 deletions(-) create mode 100644 AUTHORS create mode 100644 ChangeLog delete mode 100644 HISTORY.rst diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..7cd713e --- /dev/null +++ b/AUTHORS @@ -0,0 +1,4 @@ +Alexandre Chaussier +Alexandre Chaussier +Alexandre Chaussier +pyup-bot diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..d5d7d59 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,118 @@ +CHANGES +======= + +* Update requests-mock from 0.7.0 to 1.3.0 +* Update capturer from 2.1.1 to 2.4 +* Update sphinx from 1.4.5 to 1.6.1 +* Update tox from 2.1.1 to 2.7.0 +* Update pytest-mock from 1.1 to 1.6.0 +* Update pytest-cov from 2.2.1 to 2.5.1 +* Update pytest from 2.9.1 to 3.0.7 +* Update pylint from 1.5.5 to 1.7.1 +* Update wheel from 0.23.0 to 0.29.0 +* Update requests from 2.9.1 to 2.14.2 + +0.6.0 +----- + +* Bumpversion to 0.6.0 +* Add pyup integration, with develop base branch +* Add probe state file parser +* Add Redis ressource to get commands stats +* Update pylint settings, needed to manage fake classes in tests +* Add Redis section name magement in ScalarInfoValue class +* Add section parser + +0.5.2 +----- + +* Bumpversion 0.5.2 +* Add database id in metric returned by ScalarInfoValue Redis resource + +0.5.1 +----- + +* Bumpversion 0.5.1 +* Port parser must have a customizable default value + +0.5.0 +----- + +* Bumpversion 0.5.0 +* Add generic thresholds parser + +0.4.0 +----- + +* Bumpversion 0.4.0 +* Add missing documentation link +* Fix setup.py missing dependency +* Add pytest-mock dev dependency +* Add metric name parser +* Add database id parser +* Add host and port location cli parsers +* Add resource to mangage scalar Redis infos +* Update function max args pylint setting +* Add client cli parser +* Add rejected connection cli parser +* Update and fix documentation +* Update sphinx version +* Add duration day context and parser + +0.3.0 +----- + +* Bumpversion 0.3.0 +* Add client certificate management for requests +* Add certificate file and key file arguments parser + +0.2.0 +----- + +* Bumpversion 0.2.0 +* Add ActiveConnectionParser and WaitingCOnnectionParser +* Add web url parser +* Add Common, Password and Username parser +* Rename class files without capital letters + +0.1.2 +----- + +* Fix bad version in setup.py + +0.1.1 +----- + +* Update history fix setup.py fixes +* Complete install\_require and tests\_require +* Use find\_packages() to create packages list + +0.1.0 +----- + +* Update release date and description +* Add Performance management for CountValuesFromJSON class +* Factorize metric value change +* Add CountValuesFromJSON context class +* Add ScalarValueFromJSON context class +* Move single value management from JSON path result to ContextUtils +* Better string value from JSON management +* Add ContextUtils class +* Move StringEqualityFromJSON context to json submodule +* Add OperatorUtils class +* GetValueByJsonPath can manage multiple JSON path +* GetValueByJsonPath context name and metric name can be defined by user +* Use \*\*kwargs in GetValueByJsonPath init +* Remove browser display in docs make target +* Change tasks order in .travis.yml file +* Change tox target order +* Fix index error exception +* Fix linter deuplicate warning +* Add JSON management with JSON path +* Add JSON string value testing +* Update tox.ini whitelisting +* Update documentation +* Add probe to manage stub status Nginx page +* Add ConnectionCount context +* Add base project structure +* Initial commit diff --git a/HISTORY.rst b/HISTORY.rst deleted file mode 100644 index c86d74b..0000000 --- a/HISTORY.rst +++ /dev/null @@ -1,71 +0,0 @@ -======= -History -======= - -0.6.0 (2017-05-19) ------------------- - -Resources: -* Add Redis commands statistics - -General: -* Add pyup integration - -0.5.2 (2016-08-02) ------------------- - -Resources: -* Add database id in metric returned by redis info resource - -0.5.1 (2016-07-30) ------------------- - -Cli parsers: -* Fix a missing customizable default value for PortParser - -0.5.0 (2016-07-30) ------------------- - -Cli parsers: -* Add generic thresholds cli parser - -0.4.0 (2016-07-30) ------------------- - -Resources: -* Add sclar redis info resource - -Cli parsers: -* Add database id cli parser -* Add host cli parser -* Add metric name cli parser -* Add port cli parser -* Add rejected connection cli parser - -0.3.0 (2016-07-03) ------------------- - -* Add certificate management for JSON probe and requests utils - -0.2.0 (2016-06-16) ------------------- - -* Rename class files -* Add cli argument parser classes - -0.1.2 (2016-06-13) ------------------- - -* Fix version in setup.py - -0.1.1 (2016-06-12) ------------------- - -* Fix dependencies management in setup.py -* Fix packages list using find_packages() - -0.1.0 (2016-06-12) ------------------- - -* Add JSON probe and contexts management -* Add Nginx stub status page probe and context diff --git a/docs/temelio_monitoring.rst b/docs/temelio_monitoring.rst index d602efb..88910c4 100644 --- a/docs/temelio_monitoring.rst +++ b/docs/temelio_monitoring.rst @@ -1,5 +1,5 @@ -temelio_monitoring package -========================== +temelio\_monitoring package +=========================== Subpackages ----------- @@ -14,8 +14,8 @@ Subpackages Submodules ---------- -temelio_monitoring.temelio_monitoring module --------------------------------------------- +temelio\_monitoring\.temelio\_monitoring module +----------------------------------------------- .. automodule:: temelio_monitoring.temelio_monitoring :members: diff --git a/requirements_dev.txt b/requirements_dev.txt index 001ea7c..e80cfb3 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,6 +1,7 @@ bumpversion==0.5.3 wheel==0.29.0 watchdog==0.8.3 +pbr==3.0.1 pylint==1.7.1 pytest==3.0.7 pytest-cov==2.5.1 diff --git a/setup.cfg b/setup.cfg index 8a0b6f5..6aaaf6d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,33 @@ +[metadata] +name = temelio_monitoring +author = Temelio +author-email = alexandre.chaussier@temelio.com +summary = Temelio monitoring lib written in Python, used with Shinken +description-file = + README.rst +home-page = https://github.com/Temelio/monitoring-lib-python +requires-python = >=3.4 +classifier = + 'Development Status :: 2 - Pre-Alpha', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: ISC License (ISCL)', + 'Natural Language :: English', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + +[pbr] +autodoc_tree_index_modules = True +autodoc_tree_excludes = + setup.py + temelio_monitoring/tests/ + +[build_sphinx] +all-files = 1 +build-dir = doc/build +source-dir = doc/source +warning-is-error = 1 + [bumpversion] current_version = 0.6.0 commit = False diff --git a/setup.py b/setup.py index 73e76de..21c15a7 100755 --- a/setup.py +++ b/setup.py @@ -2,64 +2,9 @@ # -*- coding: utf-8 -*- -try: - from setuptools import setup, find_packages -except ImportError: - from distutils.core import setup, find_packages - - -with open('README.rst') as readme_file: - readme = readme_file.read() - -with open('HISTORY.rst') as history_file: - history = history_file.read() - -requirements = [ - 'jsonpath_rw==1.4', - 'nagiosplugin==1.2.4', - 'redis==2.10.5', - 'requests==2.9.1', -] - -test_requirements = [ - 'bumpversion==0.5.3', - 'wheel==0.23.0', - 'watchdog==0.8.3', - 'pylint==1.5.5', - 'pytest==2.9.1', - 'pytest-cov==2.2.1', - 'pytest-mock==1.1', - 'tox==2.1.1', - 'Sphinx==1.3.1', - 'capturer==2.1.1', - 'requests_mock==0.7.0', -] +from setuptools import setup setup( - name='temelio_monitoring', - version='0.6.0', - description="Temelio monitoring lib written in Python, used with Shinken.", - long_description=readme + '\n\n' + history, - author="Temelio", - author_email='alexandre.chaussier@temelio.com', - url='https://github.com/Temelio/monitoring-lib-python', - packages=find_packages(), - package_dir={'temelio_monitoring': - 'temelio_monitoring'}, - include_package_data=True, - install_requires=requirements, - license="ISCL", - zip_safe=False, - keywords='temelio_monitoring', - classifiers=[ - 'Development Status :: 2 - Pre-Alpha', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: ISC License (ISCL)', - 'Natural Language :: English', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - ], - test_suite='tests', - tests_require=test_requirements + setup_requires=['pbr>=1.9', 'setuptools>=17.1'], + pbr=True, ) From 7700602c48f827fb9840e0a4b3ff6ccb7626b3cf Mon Sep 17 00:00:00 2001 From: Alexandre Chaussier Date: Fri, 19 May 2017 23:21:27 +0200 Subject: [PATCH 2/3] Update Travis testing to use tox --- .travis.yml | 14 ++++++++------ tox.ini | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 84a376c..3492cd9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,11 +6,13 @@ python: - '3.4' - '3.5' -# command to install dependencies -install: 'pip install -r requirements_dev.txt' +env: + matrix: + - TOXENV='py34' + - TOXENV='py35' -# command to run tests script: - - 'make docs' - - 'make lint' - - 'make test' + - 'pip install tox-travis' + +script: + - 'tox -e "${TOXENV}"' diff --git a/tox.ini b/tox.ini index af0ab97..f873ec0 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py34, py35 +envlist = py34,py35 [testenv] setenv = From 1c4533a1e9d77c576e11a105f8d214fb5b7de159 Mon Sep 17 00:00:00 2001 From: Alexandre Chaussier Date: Fri, 19 May 2017 23:30:32 +0200 Subject: [PATCH 3/3] Fix Travis config --- .travis.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3492cd9..808958e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,6 @@ dist: 'trusty' sudo: 'required' language: 'python' -python: - - '3.4' - - '3.5' env: matrix: @@ -13,6 +10,5 @@ env: script: - 'pip install tox-travis' - -script: + - 'pip install -r requirements_dev.txt' - 'tox -e "${TOXENV}"'