From c571a3b1aa5f6ef34cd7747c31f02230346a7c60 Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Sat, 10 Mar 2018 06:51:43 -0800 Subject: [PATCH] migrate from circle 1 to 2 https://circleci.com/docs/2.0/migrating-from-1-2/ --- .circleci/config.yml | 60 +++++++++++++++++++++++++++++++++++++++++ circle.yml | 30 --------------------- requirements.freeze.txt | 4 +-- requirements.txt | 2 +- setup.py | 2 +- 5 files changed, 64 insertions(+), 34 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..82392cb1 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,60 @@ +# CircleCI automatically reads this file from our repo and uses it for +# configuration. Docs: +# https://circleci.com/docs/2.0/configuration-reference/ +# https://circleci.com/docs/2.0/sample-config/ +version: 2 + +jobs: + build: + docker: + # https://circleci.com/docs/2.0/google-container-engine/#selecting-a-base-image + - image: google/cloud-sdk + - image: circleci/python:2.7 + + environment: + - PYTHONPATH: /usr/lib/google-cloud-sdk/platform/google_appengine + + steps: + - checkout + + - restore_cache: + key: venv-{{ .Branch }}-{{ checksum "requirements.freeze.txt" }} + + - run: + name: Install oauth-dropins and granary + command: | + # use oauth-dropins master at head. (see pip install -e below.) + cd /tmp + git clone https://github.com/snarfed/oauth-dropins.git + cd oauth-dropins; git submodule sync; git submodule update --init + cd oauth_dropins/webutil; git checkout master; git pull + + - run: + name: Install dependencies + command: | + apt-get install google-cloud-sdk-app-engine-python-extras + + pip install virtualenv + virtualenv local + . local/bin/activate + + pip install -r requirements.freeze.txt + pip install -e /tmp/oauth-dropins/ + pip install coverage coveralls # for https://coveralls.io/ + + - run: + name: Test + command: | + . local/bin/activate + 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 /tmp/coverage_html + python ./instagram_live_test.py --debug + if [ "$COVERALLS_REPO_TOKEN" != "" ]; then coveralls; fi + + - save_cache: + key: venv-{{ .Branch }}-{{ checksum "requirements.freeze.txt" }} + paths: + - "local" + + - store_artifacts: + path: /tmp/coverage_html diff --git a/circle.yml b/circle.yml deleted file mode 100644 index e5c0cecd..00000000 --- a/circle.yml +++ /dev/null @@ -1,30 +0,0 @@ -# CircleCI automatically reads this file from our repo and uses it for -# configuration. Docs: https://circleci.com/docs/configuration -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 - -dependencies: - pre: - - sudo `which gcloud` -q components install app-engine-python app-engine-python-extras - - pip install -e oauth-dropins/ - 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 - post: - - if [ "$COVERALLS_REPO_TOKEN" != "" ]; then coveralls; fi diff --git a/requirements.freeze.txt b/requirements.freeze.txt index ead0620e..ca807aea 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 @@ -15,7 +15,7 @@ MarkupSafe==1.0 mf2py==1.0.5 -e git+https://github.com/snarfed/mf2util.git@992b2655be66a128bb40f847f3eba0ed955cadfe#egg=mf2util mox==0.5.3 --e git+git@github.com:snarfed/oauth-dropins.git@0de5f2da6fbf345ceea262d23f9e40576e6ce7db#egg=oauth_dropins +-e git+git@github.com:snarfed/oauth-dropins.git@v1.11#egg=oauth_dropins oauth2client==4.1.2 oauthlib==2.0.2 pyasn1==0.3.3 diff --git a/requirements.txt b/requirements.txt index 752563f5..8922ed32 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,5 +7,5 @@ mf2util>=0.5.0 oauth-dropins>=1.11 requests>=2.10.0 requests-toolbelt>=0.6.2 -brevity>=0.2.14 +brevity>=0.2.16 urllib3>=1.14 diff --git a/setup.py b/setup.py index ee55712c..c87c811b 100644 --- a/setup.py +++ b/setup.py @@ -47,7 +47,7 @@ def __init__(self, *args, **kwargs): 'oauth-dropins>=1.11', 'requests>=2.10.0', 'requests-toolbelt>=0.6.2', - 'brevity>=0.2.14', + 'brevity>=0.2.16', 'urllib3>=1.14', ], extras_require={