From 8f0bd3ada3b9c17acb83b653e85dc98337e62f81 Mon Sep 17 00:00:00 2001 From: Forrest Andrews Date: Wed, 5 Sep 2018 10:05:13 -0500 Subject: [PATCH 1/2] don't try to subtract dicts from each other mongo 3.6 has added some additional information in the form of dicts to the network stats that is causing new relic stats collection to fail also upgrade to circleci 2 --- .circleci/config.yml | 56 +++++++++++++++++++++++++++++++ circle.yml | 31 ----------------- objectrocket/instances/mongodb.py | 2 +- requirements/dev.txt | 2 +- setup.py | 2 +- 5 files changed, 59 insertions(+), 34 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..cd7151f --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,56 @@ +version: 2 +jobs: + test: + docker: + - image: python:3.5 + working_directory: ~/python-client + steps: + - checkout + + - run: + command: pip install --upgrade pip tox + + - run: + command: | + tox -e lint + tox -e py35 + + pypi_upload: + docker: + - image: circleci/python:3.5 + steps: + - run: + command: tox -e build_pypi + + pypi_upload_rc: + docker: + - image: circleci/python:3.5 + steps: + - run: + command: tox -e build_testpypi + +workflows: + version: 2 + test: + jobs: + - test + pypi_upload: + jobs: + - pypi_updload: + requires: + - test + filters: + tags: + only: + - /^[0-9]+.[0-9]+.[0-9]+$/ + + - pypi_upload_rc: + requires: + - test + filters: + tags: + only: + - /^[0-9]+.[0-9]+.[0-9]+-rc[0-9]+$/ + + + \ No newline at end of file diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 1a85f0d..0000000 --- a/circle.yml +++ /dev/null @@ -1,31 +0,0 @@ -machine: - environment: - COVERALLS_REPO_TOKEN: CUTHCbRbNtBjLFtFG4NSxVeIf1qQN3Zjo - - python: - version: 3.5.0 - -dependencies: - override: - - pip install -r requirements/dev.txt - - pip install tox-pyenv codecov coveralls twine - - pyenv local 2.7.10 3.5.0 - -test: - override: - - tox - - post: - - codecov - - coveralls - -deployment: - release: - tag: /^[0-9]+.[0-9]+.[0-9]+$/ - commands: - - tox -e build_pypi - - releaseCandidate: - tag: /^[0-9]+.[0-9]+.[0-9]+-rc[0-9]+$/ - commands: - - tox -e build_testpypi diff --git a/objectrocket/instances/mongodb.py b/objectrocket/instances/mongodb.py index f0d253a..ebbc17c 100644 --- a/objectrocket/instances/mongodb.py +++ b/objectrocket/instances/mongodb.py @@ -195,7 +195,7 @@ def _compile_new_relic_stats(self, stats_this_second, stats_next_second): first_doc = stats_this_second['aggregate_server_statistics'][subdoc] second_doc = stats_next_second['aggregate_server_statistics'][subdoc] keys = set(first_doc.keys()) | set(second_doc.keys()) - server_statistics_per_second[subdoc] = {key: int(second_doc[key]) - int(first_doc[key]) for key in keys} + server_statistics_per_second[subdoc] = {key: int(second_doc[key]) - int(first_doc[key]) for key in keys if isinstance(first_doc[key], int)} for node1, node2 in zip(stats_this_second['opcounters_per_node'], stats_next_second['opcounters_per_node']): node_opcounters_per_second = {} for repl, members in node2.items(): diff --git a/requirements/dev.txt b/requirements/dev.txt index a4f3ca1..1a78b3b 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -4,7 +4,7 @@ flake8>=2.1.0 mock>=1.0.1 pytest>=2.5.2 pytest-cov>=1.7.0 -setuptools>=2.1 +setuptools==40.2.0 sphinx_rtd_theme tox>=2.1 wheel>=0.22.0 diff --git a/setup.py b/setup.py index 063f279..567acbf 100755 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import find_packages from setuptools import setup -VERSION = ('0', '4', '9') +VERSION = ('0', '4', '10') __version__ = '.'.join(VERSION) with open('README.md') as f: From 4039ac7f47965e295da59f6d3e6179d6fb3b229c Mon Sep 17 00:00:00 2001 From: Forrest Andrews Date: Wed, 5 Sep 2018 13:19:10 -0500 Subject: [PATCH 2/2] typo --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cd7151f..29758fb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,7 +36,7 @@ workflows: - test pypi_upload: jobs: - - pypi_updload: + - pypi_upload: requires: - test filters: