diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..180c4de --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,75 @@ +# using os base image becuase of jdk requirements in pyjinius +version: 2 + +jobs: + + build: + docker: + - 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: | + 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 + - run: + name: Pre-install virtual env + command: | + pip install virtualenv --quiet + virtualenv venv + - restore_cache: + key: deps2.7-{{ .Branch }}-{{ checksum "requirements.txt" }} + - run: + name: Install dependencies + command: | + . venv/bin/activate + 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: + - "venv" + + test: + working_directory: ~/circulate + 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: + name: Test + command: | + . venv/bin/activate + 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 + - test: + requires: + - build diff --git a/.travis.yml b/.travis.yml index a2d9d85..5ac39fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,11 @@ python: - "2.7" install: - pip install -U pip wheel setuptools - - pip install cython - - pip install -r requirements.txt - - pip install . - - pip install coveralls + - 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 after_success: - coveralls + coveralls \ No newline at end of file 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..7e65d38 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,10 @@ ---extra-index-url https://seernet-pypi.herokuapp.com/ +--extra-index-url $PYPI_HOST Cython xgboost sklearn pandas scipy numpy -jnius +pyjnius tweetokenize nltk \ No newline at end of file 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/*',