From 1cd10da461490f023ead06ee04ee99a7f5ee1ff6 Mon Sep 17 00:00:00 2001 From: Peter Giacomo Lombardo Date: Wed, 29 May 2019 11:49:12 +0200 Subject: [PATCH 1/6] Add test runs for Python 2.7 and Python 3.5 --- .circleci/config.yml | 100 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 91ec15b1..a7cb9974 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,6 +4,104 @@ # version: 2 jobs: + build-test-python27: + docker: + - image: circleci/python:2.7.16 + + # 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.6.5-alpine-ram + - image: circleci/mysql:8.0.16 + - image: circleci/redis:5.0.4 + - image: rabbitmq:3.5.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: | + python -m venv venv + . venv/bin/activate + pip install -U pip + python setup.py install_egg_info + pip install -r requirements.txt + pip install -r requirements-test.txt + + - save_cache: + paths: + - ./venv + key: v1-dependencies-{{ checksum "requirements.txt" }} + + - run: + name: run tests + command: | + . venv/bin/activate + python runtests.py + + - store_artifacts: + path: test-reports + destination: test-reports + + build-test-python35: + docker: + - image: circleci/python:3.5.6 + + # 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.6.5-alpine-ram + - image: circleci/mysql:8.0.16 + - image: circleci/redis:5.0.4 + - image: rabbitmq:3.5.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: | + python -m venv venv + . venv/bin/activate + pip install -U pip + python setup.py install_egg_info + pip install -r requirements.txt + pip install -r requirements-test.txt + + - save_cache: + paths: + - ./venv + key: v1-dependencies-{{ checksum "requirements.txt" }} + + - run: + name: run tests + command: | + . venv/bin/activate + python runtests.py + + - store_artifacts: + path: test-reports + destination: test-reports + build-test-python36: docker: - image: circleci/python:3.6.8 @@ -56,4 +154,6 @@ workflows: version: 2 build: jobs: + - build-test-python27 + - build-test-python35 - build-test-python36 \ No newline at end of file From a90d37786d6864436f06710275b19f53c967c5b6 Mon Sep 17 00:00:00 2001 From: Peter Giacomo Lombardo Date: Wed, 29 May 2019 12:04:28 +0200 Subject: [PATCH 2/6] Update Python 2.7 venv setup --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a7cb9974..1939e4cd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,7 +31,8 @@ jobs: - run: name: install dependencies command: | - python -m venv venv + pip install virtualenv + virtualenv venv . venv/bin/activate pip install -U pip python setup.py install_egg_info From 6f27a3ce444b1a905e5cc1ad4a96e33330a0de39 Mon Sep 17 00:00:00 2001 From: Peter Giacomo Lombardo Date: Wed, 29 May 2019 12:20:34 +0200 Subject: [PATCH 3/6] Python 2.7 specific fixes for CircleCI --- .circleci/config.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1939e4cd..330a4b41 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,7 +12,7 @@ jobs: # CircleCI maintains a library of pre-built images # documented at https://circleci.com/docs/2.0/circleci-images/ - image: circleci/postgres:9.6.5-alpine-ram - - image: circleci/mysql:8.0.16 + - image: circleci/mysql:5.5.62-ram - image: circleci/redis:5.0.4 - image: rabbitmq:3.5.4 @@ -32,11 +32,10 @@ jobs: name: install dependencies command: | pip install virtualenv - virtualenv venv + virtualenv --python=python2.7 venv . venv/bin/activate pip install -U pip python setup.py install_egg_info - pip install -r requirements.txt pip install -r requirements-test.txt - save_cache: From 29133810dfeb92d0fa66b19428947ac1053713e2 Mon Sep 17 00:00:00 2001 From: Peter Giacomo Lombardo Date: Wed, 29 May 2019 12:30:42 +0200 Subject: [PATCH 4/6] Moar 2.7 work-arounds --- .circleci/config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 330a4b41..8a8f39cf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,8 +31,9 @@ jobs: - run: name: install dependencies command: | - pip install virtualenv - virtualenv --python=python2.7 venv + export PATH=/home/circleci/.local/bin:$PATH + pip install --user -U pip setuptools virtualenv + virtualenv --python=python2.7 --always-copy venv . venv/bin/activate pip install -U pip python setup.py install_egg_info From 1d5d981e78c0eee67425de2ea14ea583b47cd26b Mon Sep 17 00:00:00 2001 From: Peter Giacomo Lombardo Date: Wed, 29 May 2019 12:40:39 +0200 Subject: [PATCH 5/6] Remove venv before installing --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8a8f39cf..fe3d0102 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,6 +31,7 @@ jobs: - run: name: install dependencies command: | + rm -rf venv export PATH=/home/circleci/.local/bin:$PATH pip install --user -U pip setuptools virtualenv virtualenv --python=python2.7 --always-copy venv From 982c88d8f57ee058d72bf8d78e4f5c4f3a657949 Mon Sep 17 00:00:00 2001 From: Peter Giacomo Lombardo Date: Wed, 29 May 2019 12:43:12 +0200 Subject: [PATCH 6/6] Update job names --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fe3d0102..0d551257 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ # version: 2 jobs: - build-test-python27: + python27: docker: - image: circleci/python:2.7.16 @@ -55,7 +55,7 @@ jobs: path: test-reports destination: test-reports - build-test-python35: + python35: docker: - image: circleci/python:3.5.6 @@ -104,7 +104,7 @@ jobs: path: test-reports destination: test-reports - build-test-python36: + python36: docker: - image: circleci/python:3.6.8 @@ -156,6 +156,6 @@ workflows: version: 2 build: jobs: - - build-test-python27 - - build-test-python35 - - build-test-python36 \ No newline at end of file + - python27 + - python35 + - python36