From bb484847511239917e30ff312aab39b8cc90a3bd Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Mon, 15 Jan 2018 08:26:55 -0800 Subject: [PATCH] python 3: run tests on circle --- README.md | 2 +- circle.yml | 29 ++++++++++++++++++----------- requirements.freeze.txt | 2 +- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 08d5e139..40b3a458 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Granary is a library and REST API that fetches and converts between a wide varie Here's how to get started: * Granary is [available on PyPi.](https://pypi.python.org/pypi/granary/) Install with `pip install granary`. -* Supports Python 2.7+ and 3.4+. +* Supports Python 2.7+ and 3.3+. * [Click here for getting started docs.](#using) * [Click here for reference docs.](https://granary.readthedocs.io/en/latest/source/granary.html) * The REST API and demo app are deployed at [granary.io](https://granary.io/). diff --git a/circle.yml b/circle.yml index e5c0cecd..4c4cf353 100644 --- a/circle.yml +++ b/circle.yml @@ -1,30 +1,37 @@ # CircleCI automatically reads this file from our repo and uses it for # configuration. Docs: https://circleci.com/docs/configuration +machine: + environment: + # PYTHONPATH: $PYTHONPATH:`gcloud info |grep -E '^Python PATH:' | sed -E 's/Python PATH: \[(.+)\]/\1/'` + PYTHONPATH: $PYTHONPATH:/opt/google-cloud-sdk/platform/google_appengine + COVERAGE_FILE: $CIRCLE_ARTIFACTS/.coverage + post: + - pyenv local 2.7.12 3.6.2 + checkout: post: - git clone https://github.com/snarfed/oauth-dropins.git # use oauth-dropins master at head. (see pip install -e below.) - - cd oauth-dropins; git submodule sync; git submodule update --init - - cd oauth-dropins/oauth_dropins/webutil; git checkout master; git pull + - cd oauth-dropins; git submodule sync; git submodule update --init; git checkout python3 + - cd oauth-dropins/oauth_dropins/webutil; get fetch origin; git pull; git checkout python3 + - pip3 install -r requirements.freeze.txt dependencies: pre: - sudo `which gcloud` -q components install app-engine-python app-engine-python-extras - pip install -e oauth-dropins/ + - pip3 install -e oauth-dropins/ + - cd oauth-dropins; git checkout python3 + - cd oauth-dropins/oauth_dropins/webutil; git checkout python3 post: - pip install coverage coveralls # for https://coveralls.io/ - ln -s $VIRTUAL_ENV local # we use app engine's vendor module to point here -machine: - environment: - # PYTHONPATH: $PYTHONPATH:`gcloud info |grep -E '^Python PATH:' | sed -E 's/Python PATH: \[(.+)\]/\1/'` - PYTHONPATH: $PYTHONPATH:/opt/google-cloud-sdk/platform/google_appengine - COVERAGE_FILE: $CIRCLE_ARTIFACTS/.coverage - test: override: - - python -m coverage run --source=. --omit=granary/test/\*,local/\*,oauth-dropins/\*,old_apps/\*,setup.py,test_\*,\*_live_test.py -m unittest discover -v - - python -m coverage html -d $CIRCLE_ARTIFACTS - - python ./instagram_live_test.py --debug + - PYTHONPATH= python3.6 -m unittest discover -s granary/test/ + - python2.7 -m coverage run --source=. --omit=granary/test/\*,local/\*,oauth-dropins/\*,old_apps/\*,setup.py,test_\*,\*_live_test.py -m unittest discover -v + - python2.7 -m coverage html -d $CIRCLE_ARTIFACTS + - PYTHONPATH= python2.7 ./instagram_live_test.py --debug post: - if [ "$COVERALLS_REPO_TOKEN" != "" ]; then coveralls; fi diff --git a/requirements.freeze.txt b/requirements.freeze.txt index 3e64d49c..04d9e770 100644 --- a/requirements.freeze.txt +++ b/requirements.freeze.txt @@ -1,5 +1,5 @@ beautifulsoup4==4.4.1 -brevity==0.2.14 +brevity==0.2.16 certifi==2017.7.27.1 chardet==3.0.4 coverage==4.0.3