From d091f7585923fbdcaca9670cda2c6e8184467ca3 Mon Sep 17 00:00:00 2001 From: Matteo Guzzo Date: Sun, 13 Oct 2019 16:23:47 +0200 Subject: [PATCH 1/3] Add template for circleCI --- .circleci/config.yml | 55 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..f51ac4c --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,55 @@ +# Python CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-python/ for more details +# +version: 2 +jobs: + build: + docker: + # specify the version you desire here + # use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers` + - image: circleci/python:3.7.4 + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + # - image: circleci/postgres:9.4 + + working_directory: ~/repo + + steps: + - checkout + + # Download and cache dependencies + - restore_cache: + keys: + - v1-dependencies-{{ checksum "requirements.txt" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: + name: install dependencies + command: | + python3 -m venv venv + . venv/bin/activate + pip install -r requirements.txt + + - save_cache: + paths: + - ./venv + key: v1-dependencies-{{ checksum "requirements.txt" }} + + # run tests! + # this example uses Django's built-in test-runner + # other common Python testing frameworks include pytest and nose + # https://pytest.org + # https://nose.readthedocs.io + - run: + name: run tests + command: | + . venv/bin/activate + python -m pytest + + - store_artifacts: + path: test-reports + destination: test-reports \ No newline at end of file From 25c88d5edc9824d94a97fe8d781171c08cf4b127 Mon Sep 17 00:00:00 2001 From: Matteo Guzzo Date: Sun, 13 Oct 2019 17:03:50 +0200 Subject: [PATCH 2/3] Add pre-commit step to CI --- .circleci/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index f51ac4c..c3bca7f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,6 +44,12 @@ jobs: # other common Python testing frameworks include pytest and nose # https://pytest.org # https://nose.readthedocs.io + - run: + name: run pre-commits + command: | + . venv/bin/activate + python -m pre_commit run --all-files + - run: name: run tests command: | From 30d10c709a3cb8c03048ed4a6473d4b5fcba45cb Mon Sep 17 00:00:00 2001 From: Matteo Guzzo Date: Mon, 14 Oct 2019 18:26:16 +0200 Subject: [PATCH 3/3] Relax pylint constrains --- .pylintrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index c34f51a..9da3df0 100644 --- a/.pylintrc +++ b/.pylintrc @@ -313,6 +313,10 @@ function-naming-style=snake_case good-names=i, j, k, + l, + m, + n, + e, ex, Run, _ @@ -548,7 +552,7 @@ max-bool-expr=5 max-branches=12 # Maximum number of locals for function / method body. -max-locals=15 +max-locals=21 # Maximum number of parents for a class (see R0901). max-parents=7