From cecd82064539422c96b01bce7ac190e3ef9fddde Mon Sep 17 00:00:00 2001 From: Venkatesh Duppada Date: Sat, 16 Sep 2017 12:23:56 +0530 Subject: [PATCH 01/11] Move to CircleCi --- .circleci/config.yml | 72 ++++++++++++++++++++++++++++++++++++++++++++ .travis.yml | 14 --------- MANIFEST.in | 4 ++- requirements.txt | 1 - setup.py | 6 +++- 5 files changed, 80 insertions(+), 17 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 .travis.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..61e98a1 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,72 @@ +version: 2 + +jobs: + env_setup: + setps: + - run: + name: Private pypi config setup + command: | + echo "[distutils]" >> ~/.pypirc + echo "index-servers = pypi-private" >> ~/.pypirc + echo "[pypi-private]" >> ~/.pypirc + echo "repository=$PYPI_HOST" >> ~/.pypirc + echo "username=$PYPI_USERNAME" >> ~/.pypirc + echo "password=$PYPI_PASSWORD" >> ~/.pypirc + + build: + docker: + - image: python:2.7 + working_directory: ~/circulate + steps: + - checkout + - run: + name: Pre-install virtual env + command: | + pip install virtualenv + virtualenv venv + - restore_cache: + key: deps2.7-{{ .Branch }}-{{ checksum "requirements.txt" }} + - run: + name: Install dependencies + command: | + . venv/bin/activate + python setup.py install + - save_cache: + key: deps2.7-{{ .Branch }}-{{ checksum "requirements.txt" }} + paths: + - "venv" + + test: + working_directory: ~/circulate + docker: + - image: python:2.7 + steps: + - checkout + - restore_cache: + key: deps2.7-{{ .Branch }}-{{ checksum "requirements.txt" }} + - run: + name: Test + command: | + . venv/bin/activate + pip install coveralls + coverage run --source=. -m unittest discover -v + coveralls + - run: + name: Push to private pypi server + command: | + python setup.py bdist_wheel upload -r $PYPI_HOST + python setup.py sdist upload -r $PYPI_HOST + - store_artifacts: + path: test-reports/ + destination: tr1 + +workflows: + version: 2 + build-and-deploy: + jobs: + - build: + requires: + env_setup + - test: + requires: + - build diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a2d9d85..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: python -python: - - "2.7" -install: - - pip install -U pip wheel setuptools - - pip install cython - - pip install -r requirements.txt - - pip install . - - pip install coveralls - -script: coverage run --source=. -m unittest discover -v - -after_success: - coveralls diff --git a/MANIFEST.in b/MANIFEST.in index 5fd68cf..9b3197b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,3 @@ -recursive-include emoint/resources/ * \ No newline at end of file +recursive-include emoint/resources/ * +include README.md +include requirements.txt \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index b659877..095e823 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ ---extra-index-url https://seernet-pypi.herokuapp.com/ Cython xgboost sklearn diff --git a/setup.py b/setup.py index 376371f..24e3c97 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,16 @@ from setuptools import setup, find_packages from codecs import open from os import path +from pip.req import parse_requirements here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() +install_reqs = parse_requirements('requirements.txt', session='session') +reqs = [str(ir.req) for ir in install_reqs] + setup( name='EmoInt', version='0.1.0', @@ -31,7 +35,7 @@ 'setuptools>=18.0', 'cython', ], - install_requires=[], + install_requires=reqs, extras_require={}, package_data={ 'emoint': ['resources/*', 'resources/NRC-Hashtag-Sentiment-Lexicon-v0.1/*', 'resources/SentiStrength/*', From ff780496a5453c2010bb3ca2e1af7044612f6a7c Mon Sep 17 00:00:00 2001 From: Venkatesh Duppada Date: Sat, 16 Sep 2017 12:59:24 +0530 Subject: [PATCH 02/11] Update travis yml --- .travis.yml | 12 ++++++++++++ requirements.txt | 1 + 2 files changed, 13 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..50f3508 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: python +python: + - "2.7" +install: + - pip install -U pip wheel setuptools + - pip install coveralls + - python setup.py install + +script: coverage run --source=. -m unittest discover -v + +after_success: + coveralls \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 095e823..50ccefb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +--extra-index-url $PYPI_HOST Cython xgboost sklearn From f413f3dcef059b910cd9c24a7972ff894480e380 Mon Sep 17 00:00:00 2001 From: Venkatesh Duppada Date: Sat, 16 Sep 2017 13:09:20 +0530 Subject: [PATCH 03/11] Install tweetokenize separately --- .circleci/config.yml | 1 + .travis.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 61e98a1..754753c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,6 +30,7 @@ jobs: name: Install dependencies command: | . venv/bin/activate + pip install tweetokenize --extra-index-url $PYPI_HOST python setup.py install - save_cache: key: deps2.7-{{ .Branch }}-{{ checksum "requirements.txt" }} diff --git a/.travis.yml b/.travis.yml index 50f3508..9bed974 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ python: install: - pip install -U pip wheel setuptools - pip install coveralls + - pip install tweetokenize --extra-index-url $PYPI_HOST - python setup.py install script: coverage run --source=. -m unittest discover -v From b9d5c801339beee4e5eeade3d7ab68b4d771e60d Mon Sep 17 00:00:00 2001 From: Venkatesh Duppada Date: Sat, 16 Sep 2017 13:21:09 +0530 Subject: [PATCH 04/11] Fix circleci config --- .circleci/config.yml | 30 ++++++++++++------------------ .travis.yml | 4 ++-- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 754753c..7ac618a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,8 +1,13 @@ version: 2 jobs: - env_setup: - setps: + + build: + docker: + - image: python:2.7 + working_directory: ~/circulate + steps: + - checkout - run: name: Private pypi config setup command: | @@ -12,13 +17,6 @@ jobs: echo "repository=$PYPI_HOST" >> ~/.pypirc echo "username=$PYPI_USERNAME" >> ~/.pypirc echo "password=$PYPI_PASSWORD" >> ~/.pypirc - - build: - docker: - - image: python:2.7 - working_directory: ~/circulate - steps: - - checkout - run: name: Pre-install virtual env command: | @@ -30,8 +28,9 @@ jobs: name: Install dependencies command: | . venv/bin/activate - pip install tweetokenize --extra-index-url $PYPI_HOST - python setup.py install + pip install cython + pip install coveralls + pip install -r requirements.txt --extra-index-url $PYPI_HOST - save_cache: key: deps2.7-{{ .Branch }}-{{ checksum "requirements.txt" }} paths: @@ -49,7 +48,6 @@ jobs: name: Test command: | . venv/bin/activate - pip install coveralls coverage run --source=. -m unittest discover -v coveralls - run: @@ -65,9 +63,5 @@ workflows: version: 2 build-and-deploy: jobs: - - build: - requires: - env_setup - - test: - requires: - - build + - build + - test diff --git a/.travis.yml b/.travis.yml index 9bed974..4980753 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,8 @@ python: install: - pip install -U pip wheel setuptools - pip install coveralls - - pip install tweetokenize --extra-index-url $PYPI_HOST - - python setup.py install + - pip install cython + - pip install -r requirements.txt --extra-index-url $PYPI_HOST script: coverage run --source=. -m unittest discover -v From b0e1ac7000713f69bdd8e786cdb2f5f1593488b5 Mon Sep 17 00:00:00 2001 From: Venkatesh Duppada Date: Sat, 16 Sep 2017 13:35:58 +0530 Subject: [PATCH 05/11] Use quiet option with pip --- .circleci/config.yml | 8 ++++---- .travis.yml | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7ac618a..9bff3c4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,7 +20,7 @@ jobs: - run: name: Pre-install virtual env command: | - pip install virtualenv + pip install virtualenv --quiet virtualenv venv - restore_cache: key: deps2.7-{{ .Branch }}-{{ checksum "requirements.txt" }} @@ -28,9 +28,9 @@ jobs: name: Install dependencies command: | . venv/bin/activate - pip install cython - pip install coveralls - pip install -r requirements.txt --extra-index-url $PYPI_HOST + pip install cython --quiet + pip install coveralls --quiet + pip install -r requirements.txt --extra-index-url $PYPI_HOST --quiet - save_cache: key: deps2.7-{{ .Branch }}-{{ checksum "requirements.txt" }} paths: diff --git a/.travis.yml b/.travis.yml index 4980753..5ac39fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,9 @@ python: - "2.7" install: - pip install -U pip wheel setuptools - - pip install coveralls - - pip install cython - - pip install -r requirements.txt --extra-index-url $PYPI_HOST + - pip install coveralls --quiet + - pip install cython --quiet + - pip install -r requirements.txt --extra-index-url $PYPI_HOST --quiet script: coverage run --source=. -m unittest discover -v From df99d9a38295157f1e6c132b1c8bb78416700986 Mon Sep 17 00:00:00 2001 From: Venkatesh Duppada Date: Sat, 16 Sep 2017 13:38:42 +0530 Subject: [PATCH 06/11] Fix circle ci config --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9bff3c4..3d2c145 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,7 +41,6 @@ jobs: docker: - image: python:2.7 steps: - - checkout - restore_cache: key: deps2.7-{{ .Branch }}-{{ checksum "requirements.txt" }} - run: From f049b2a5dcaf61e4d7ad8c6f409ce7dad59a2ec1 Mon Sep 17 00:00:00 2001 From: Venkatesh Duppada Date: Sat, 16 Sep 2017 13:58:47 +0530 Subject: [PATCH 07/11] Change base image --- .circleci/config.yml | 8 +++++--- requirements.txt | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3d2c145..f6df616 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ jobs: build: docker: - - image: python:2.7 + - image: 2.7-alpine working_directory: ~/circulate steps: - checkout @@ -39,7 +39,7 @@ jobs: test: working_directory: ~/circulate docker: - - image: python:2.7 + - image: 2.7-alpine steps: - restore_cache: key: deps2.7-{{ .Branch }}-{{ checksum "requirements.txt" }} @@ -63,4 +63,6 @@ workflows: build-and-deploy: jobs: - build - - test + - test: + requires: + build diff --git a/requirements.txt b/requirements.txt index 50ccefb..7e65d38 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,6 @@ sklearn pandas scipy numpy -jnius +pyjnius tweetokenize nltk \ No newline at end of file From 48bfecbc034a7161a1af6f48812cbc0802e892dd Mon Sep 17 00:00:00 2001 From: Venkatesh Duppada Date: Sat, 16 Sep 2017 14:13:18 +0530 Subject: [PATCH 08/11] Jdk requirements --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index f6df616..ec9bffb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,3 +1,4 @@ +# using os base image becuase of jdk requirements in pyjinius version: 2 jobs: From 7e3d87c4d4793543ce9b6e8306c69c49177a3d6c Mon Sep 17 00:00:00 2001 From: Venkatesh Duppada Date: Sat, 16 Sep 2017 14:19:43 +0530 Subject: [PATCH 09/11] Fix circle ci config --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ec9bffb..581e29c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,5 +65,5 @@ workflows: jobs: - build - test: - requires: - build + requires: + - build From 833226563eccb5f0572104f05f6e218a8bc971b6 Mon Sep 17 00:00:00 2001 From: Venkatesh Duppada Date: Sat, 16 Sep 2017 14:21:33 +0530 Subject: [PATCH 10/11] Change base image --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 581e29c..4ccb47a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ jobs: build: docker: - - image: 2.7-alpine + - image: python:2.7-alpine working_directory: ~/circulate steps: - checkout @@ -40,7 +40,7 @@ jobs: test: working_directory: ~/circulate docker: - - image: 2.7-alpine + - image: python:2.7-alpine steps: - restore_cache: key: deps2.7-{{ .Branch }}-{{ checksum "requirements.txt" }} From 22a336dd98b4c5060cdc1c9f4d359d55d532d00e Mon Sep 17 00:00:00 2001 From: Venkatesh Duppada Date: Sat, 16 Sep 2017 14:26:20 +0530 Subject: [PATCH 11/11] Install python pip in base image --- .circleci/config.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4ccb47a..180c4de 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,10 +5,13 @@ jobs: build: docker: - - image: python:2.7-alpine + - image: ubuntu:14.04 working_directory: ~/circulate steps: - checkout + - run: + name: Install python pip + command: apt-get update && apt-get install -y python python-setuptools python-pip - run: name: Private pypi config setup command: | @@ -42,6 +45,9 @@ jobs: docker: - image: python:2.7-alpine steps: + - run: + name: Install python pip + command: apt-get update && apt-get install -y python python-setuptools python-pip - restore_cache: key: deps2.7-{{ .Branch }}-{{ checksum "requirements.txt" }} - run: