Skip to content

Commit

Permalink
python 3: run tests on circle
Browse files Browse the repository at this point in the history
  • Loading branch information
snarfed committed Feb 5, 2018
1 parent 16cc7a8 commit bb48484
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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/).
Expand Down
29 changes: 18 additions & 11 deletions 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
2 changes: 1 addition & 1 deletion 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
Expand Down

0 comments on commit bb48484

Please sign in to comment.