From 127f97102a187e84d9fd1e2a50ff5085f99925ef Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 13 Feb 2019 14:35:55 -0800 Subject: [PATCH] Added Travis-CI setup (#1) - Added 'build' to flake8 exclude - Fixed a lint error --- databuilder/.travis.yml | 7 +++++++ databuilder/Makefile | 1 - .../databuilder/publisher/elasticsearch_publisher.py | 2 +- databuilder/setup.cfg | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 databuilder/.travis.yml diff --git a/databuilder/.travis.yml b/databuilder/.travis.yml new file mode 100644 index 0000000000..a52ceb6627 --- /dev/null +++ b/databuilder/.travis.yml @@ -0,0 +1,7 @@ +language: python +python: 2.7 +install: + - pip install -r requirements.txt + - python setup.py install +script: + - make test diff --git a/databuilder/Makefile b/databuilder/Makefile index 1396abbc56..a2510ddaa0 100644 --- a/databuilder/Makefile +++ b/databuilder/Makefile @@ -18,4 +18,3 @@ test_unit2: test_unit3: python3 -bb -m pytest tests/unit - diff --git a/databuilder/databuilder/publisher/elasticsearch_publisher.py b/databuilder/databuilder/publisher/elasticsearch_publisher.py index c576500fbc..f0b8f05a51 100644 --- a/databuilder/databuilder/publisher/elasticsearch_publisher.py +++ b/databuilder/databuilder/publisher/elasticsearch_publisher.py @@ -134,7 +134,7 @@ def _fetch_old_index(self): try: indices = self.elasticsearch_client.indices.get_alias(self.elasticsearch_alias).keys() return indices - except NotFoundError as ne: + except NotFoundError: LOGGER.warn("Received index not found error from Elasticsearch", exc_info=True) # return empty list on exception return [] diff --git a/databuilder/setup.cfg b/databuilder/setup.cfg index c41bc7bc75..0aabec6f19 100644 --- a/databuilder/setup.cfg +++ b/databuilder/setup.cfg @@ -1,6 +1,6 @@ [flake8] format = pylint -exclude = .svc,CVS,.bzr,.hg,.git,__pycache__,venv,databuilder/sql_parser/usage/presto/antlr_generated +exclude = .svc,CVS,.bzr,.hg,.git,__pycache__,venv,build,databuilder/sql_parser/usage/presto/antlr_generated max-complexity = 10 max-line-length = 120 ignore = NONE