From 3ab8a7cd2720f983faa1144140aa36e9ee7fa49d Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Thu, 11 Jul 2019 09:35:51 -0700 Subject: [PATCH 1/3] Start trying to get Windows CI working, refs #511 --- .travis.yml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 29388bc1..402ac0c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,15 +2,27 @@ language: python dist: xenial # 3.6 is listed first so it gets used for the later build stages -python: - - "3.6" - - "3.7" - - "3.5" +matrix: + include: + - os: linux + python: "3.6" + - os: linux + python: "3.5" + - os: linux + python: "3.7" + - os: windows + language: bash + name: Windows + +install: + - if [ "$TRAVIS_OS_NAME" = "windows" ]; then + choco install python3; + # Executed for 3.5 AND 3.5 as the first "test" stage: script: - - pip install -U pip wheel - - pip install .[test] + - python -m pip install -U pip wheel + - python -m pip install .[test] - pytest cache: @@ -23,7 +35,7 @@ jobs: - stage: deploy latest.datasette.io if: branch = master AND type = push script: - - pip install .[test] + - python -m pip install .[test] - npm install -g now - python tests/fixtures.py fixtures.db fixtures.json - export ALIAS=`echo $TRAVIS_COMMIT | cut -c 1-7` From 2b2929f731c3575f479960e7260800083b0f6cca Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Mon, 15 Jul 2019 17:56:43 -0700 Subject: [PATCH 2/3] Much simpler, just trying to get Windows tests to run --- .travis.yml | 72 ++++++++++++----------------------------------------- 1 file changed, 16 insertions(+), 56 deletions(-) diff --git a/.travis.yml b/.travis.yml index 402ac0c8..b478fdba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,67 +1,27 @@ -language: python -dist: xenial +cache: pip + +language: python -# 3.6 is listed first so it gets used for the later build stages matrix: include: - - os: linux - python: "3.6" - - os: linux - python: "3.5" - - os: linux - python: "3.7" - os: windows language: bash name: Windows + - os: linux + python: "3.5" + - os: linux + python: "3.6" + - os: linux + python: "3.7-dev" install: - if [ "$TRAVIS_OS_NAME" = "windows" ]; then - choco install python3; + choco install python3; + export PATH=/c/Python37:/c/Python37/Scripts:/c/Python38:/c/Python38/Scripts:$PATH; + python -m pip install -e .[test] + else + pip install -e .[test] + fi; - -# Executed for 3.5 AND 3.5 as the first "test" stage: script: - - python -m pip install -U pip wheel - - python -m pip install .[test] - - pytest - -cache: - directories: - - $HOME/.cache/pip - -# This defines further stages that execute after the tests -jobs: - include: - - stage: deploy latest.datasette.io - if: branch = master AND type = push - script: - - python -m pip install .[test] - - npm install -g now - - python tests/fixtures.py fixtures.db fixtures.json - - export ALIAS=`echo $TRAVIS_COMMIT | cut -c 1-7` - - datasette publish nowv1 fixtures.db -m fixtures.json --token=$NOW_TOKEN --branch=$TRAVIS_COMMIT --version-note=$TRAVIS_COMMIT --name=datasette-latest-$ALIAS --alias=latest.datasette.io --alias=$ALIAS.datasette.io - - stage: release tagged version - if: tag IS present - python: 3.6 - deploy: - - provider: pypi - user: simonw - distributions: bdist_wheel - password: ${PYPI_PASSWORD} - on: - branch: master - tags: true - - stage: publish docker image - if: tag IS present - python: 3.6 - script: - - npm install -g now - - export ALIAS=`echo $TRAVIS_COMMIT | cut -c 1-7` - - export TAG=`echo $TRAVIS_TAG | sed 's/\./-/g' | sed 's/.*/v&/'` - - now alias $ALIAS.datasette.io $TAG.datasette.io --token=$NOW_TOKEN - # Build and release to Docker Hub - - docker login -u $DOCKER_USER -p $DOCKER_PASS - - export REPO=datasetteproject/datasette - - docker build -f Dockerfile -t $REPO:$TRAVIS_TAG . - - docker tag $REPO:$TRAVIS_TAG $REPO:latest - - docker push $REPO + - pytest From 47b5ab43be87217c4e40ad93b8aa2e9639fa371f Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Mon, 15 Jul 2019 17:59:06 -0700 Subject: [PATCH 3/3] Missing semicolons --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b478fdba..78361887 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,9 @@ install: - if [ "$TRAVIS_OS_NAME" = "windows" ]; then choco install python3; export PATH=/c/Python37:/c/Python37/Scripts:/c/Python38:/c/Python38/Scripts:$PATH; - python -m pip install -e .[test] + python -m pip install -e .[test]; else - pip install -e .[test] + pip install -e .[test]; fi; script: