From 48eaf4162c03c8fadc3841d238271511a2989852 Mon Sep 17 00:00:00 2001 From: Syrus Dark Date: Fri, 14 Aug 2020 12:19:23 +0530 Subject: [PATCH 1/2] Move to NuGet - Make script shorter --- .travis.yml | 11 +++++------ .travis/downloadCairo.sh | 4 ---- .travis/runPycairo.sh | 28 ++++++++++++++++++++++++++++ .travis/runPycairox64.sh | 13 ------------- .travis/runPycairox86.sh | 12 ------------ 5 files changed, 33 insertions(+), 35 deletions(-) delete mode 100644 .travis/downloadCairo.sh create mode 100644 .travis/runPycairo.sh delete mode 100644 .travis/runPycairox64.sh delete mode 100644 .travis/runPycairox86.sh diff --git a/.travis.yml b/.travis.yml index d8a9d2d8..487ef21b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,17 +4,17 @@ matrix: language: sh python: 3.6 name: Build on Python 3.6.8 in Windows - env: PYVER="3.6.8" PYDIR="Python36" CAIRO_VERSION=1.17.2 + env: PYVER="3.6.8" CAIRO_VERSION=1.17.2 - os: windows language: sh python: 3.7 name: Build on Python 3.7.7 in Windows - env: PYVER="3.7.7" PYDIR="Python37" CAIRO_VERSION=1.17.2 + env: PYVER="3.7.7" CAIRO_VERSION=1.17.2 - os: windows language: sh python: 3.8 name: Build on Python 3.8.3 in Windows - env: PYVER="3.8.3" PYDIR="Python38" CAIRO_VERSION=1.17.2 + env: PYVER="3.8.3" CAIRO_VERSION=1.17.2 - os: linux dist: trusty language: python @@ -45,7 +45,6 @@ matrix: name: Build on Python 3.8 in Mac OSX xcode11.3 env: CFLAGS="-Werror -coverage" install: - - if [ "$TRAVIS_OS_NAME" == "windows" ]; then source .travis/downloadCairo.sh; fi - if [ "$TRAVIS_OS_NAME" == "linux" ]; then travis_retry sudo apt-get update -q; fi - if [ "$TRAVIS_OS_NAME" == "linux" ]; then travis_retry sudo apt-get install -y libcairo2-dev; fi - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi @@ -62,8 +61,7 @@ install: - if [ "$TRAVIS_OS_NAME" != "windows" ]; then python -m pip install --upgrade mypy || true; fi script: #windows build - - if [ "$TRAVIS_OS_NAME" == "windows" ]; then source .travis/runPycairox64.sh; fi - - if [ "$TRAVIS_OS_NAME" == "windows" ]; then source .travis/runPycairox86.sh; fi + - if [ "$TRAVIS_OS_NAME" == "windows" ]; then source .travis/runPycairo.sh; fi - if [ "$TRAVIS_OS_NAME" != "windows" ]; then python setup.py sdist; fi - if [ "$TRAVIS_OS_NAME" != "windows" ]; then python setup.py bdist; fi - if [ "$TRAVIS_OS_NAME" != "windows" ]; then python setup.py install --root=_root; fi @@ -83,6 +81,7 @@ before_cache: - rm -f $HOME/.cache/pip/log/debug.log deploy: + if: TRAVIS_OS_NAME = windows provider: releases file_glob: true api_key: $GITHUBOAUTHTOKEN diff --git a/.travis/downloadCairo.sh b/.travis/downloadCairo.sh deleted file mode 100644 index 9d7bbb01..00000000 --- a/.travis/downloadCairo.sh +++ /dev/null @@ -1,4 +0,0 @@ - -curl -L https://github.com/preshing/cairo-windows/releases/download/$CAIRO_VERSION/cairo-windows-$CAIRO_VERSION.zip -o cairocomplied.zip -7z x cairocomplied.zip -mv cairo-windows-$CAIRO_VERSION cairocomplied \ No newline at end of file diff --git a/.travis/runPycairo.sh b/.travis/runPycairo.sh new file mode 100644 index 00000000..3eed2474 --- /dev/null +++ b/.travis/runPycairo.sh @@ -0,0 +1,28 @@ +#download cairo +curl -L https://github.com/preshing/cairo-windows/releases/download/$CAIRO_VERSION/cairo-windows-$CAIRO_VERSION.zip -o cairocomplied.zip +7z x cairocomplied.zip +mv cairo-windows-$CAIRO_VERSION cairocomplied +curl -L https://aka.ms/nugetclidl -o nuget.exe +#x64 python begins here +export INCLUDE="$PWD/cairocomplied/include/" +export LIB="$PWD/cairocomplied/lib/x64/" +cp cairocomplied/lib/x64/cairo.dll cairo/cairo.dll +./nuget install python -Version $PYVER -OutputDirectory python +./python/python.$PYVER/tools/python.exe -m pip install --upgrade pip +./python/python.$PYVER/tools/python.exe -m pip install --upgrade wheel +./python/python.$PYVER/tools/python.exe -m pip install --upgrade setuptools +./python/python.$PYVER/tools/python.exe -m pip install pytest +./python/python.$PYVER/tools/python.exe -m pip install --upgrade mypy || true +./python/python.$PYVER/tools/python.exe setup.py bdist_wheel +rm cairo/cairo.dll +#x86 python begins here +./nuget install pythonx86 -Version $PYVER -OutputDirectory pythonx86 +cp cairocomplied/lib/x86/cairo.dll cairo/cairo.dll +./pythonx86/pythonx86.$PYVER/tools/python.exe -m pip install --upgrade pip +./pythonx86/pythonx86.$PYVER/tools/python.exe -m pip install --upgrade wheel +./pythonx86/pythonx86.$PYVER/tools/python.exe -m pip install --upgrade setuptools +./pythonx86/pythonx86.$PYVER/tools/python.exe -m pip install pytest +./pythonx86/pythonx86.$PYVER/tools/python.exe -m pip install --upgrade mypy || true +export INCLUDE="$PWD/cairocomplied/include/" +export LIB="$PWD/cairocomplied/lib/x86/" +./pythonx86/pythonx86.$PYVER/tools/python.exe setup.py bdist_wheel diff --git a/.travis/runPycairox64.sh b/.travis/runPycairox64.sh deleted file mode 100644 index 1c6a03fc..00000000 --- a/.travis/runPycairox64.sh +++ /dev/null @@ -1,13 +0,0 @@ -export INCLUDE="$PWD/cairocomplied/include/" -export LIB="$PWD/cairocomplied/lib/x64/" -cp cairocomplied/lib/x64/cairo.dll cairo/cairo.dll -choco install python --version=$PYVER -export PATH="/c/$PYDIR:/c/$PYDIR/Scripts:$PATH" -cmd.exe //c "RefreshEnv.cmd" -python -m pip install --upgrade pip -python -m pip install --upgrade wheel -python -m pip install --upgrade setuptools -python -m pip install pytest -python -m pip install --upgrade mypy || true -cmd.exe //c "RefreshEnv.cmd" -python setup.py bdist_wheel diff --git a/.travis/runPycairox86.sh b/.travis/runPycairox86.sh deleted file mode 100644 index 59b50df8..00000000 --- a/.travis/runPycairox86.sh +++ /dev/null @@ -1,12 +0,0 @@ -cp cairocomplied/lib/x86/cairo.dll cairo/cairo.dll -curl -L https://aka.ms/nugetclidl -o nuget.exe -./nuget install pythonx86 -Version $PYVER -OutputDirectory pythonx86 -./pythonx86/pythonx86.$PYVER/tools/python.exe -m pip install --upgrade pip -./pythonx86/pythonx86.$PYVER/tools/python.exe -m pip install --upgrade wheel -./pythonx86/pythonx86.$PYVER/tools/python.exe -m pip install --upgrade setuptools -./pythonx86/pythonx86.$PYVER/tools/python.exe -m pip install pytest -./pythonx86/pythonx86.$PYVER/tools/python.exe -m pip install --upgrade mypy || true -export INCLUDE="$PWD/cairocomplied/include/" -export LIB="$PWD/cairocomplied/lib/x86/" -cmd.exe //c "RefreshEnv.cmd" -./pythonx86/pythonx86.$PYVER/tools/python.exe setup.py bdist_wheel From 024b29654575fc8e6deeced03a5294d81947d27c Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Sun, 16 Aug 2020 19:18:45 +0530 Subject: [PATCH 2/2] Remove Cache and before_cache as not required --- .travis.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 487ef21b..2648ce08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -71,15 +71,6 @@ script: - if [ "$TRAVIS_OS_NAME" != "windows" ]; then if [[ "${TRAVIS_PYTHON_VERSION:0:4}" != "pypy" ]] ; then python -m pip install .; fi; fi - if [ "$TRAVIS_OS_NAME" != "windows" ]; then python -m sphinx -W -a -E -b html -n docs docs/_build; fi -cache: - directories: - - $HOME/.cache/pip - - $HOME/Library/Caches/Homebrew - -before_cache: - - brew cleanup - - rm -f $HOME/.cache/pip/log/debug.log - deploy: if: TRAVIS_OS_NAME = windows provider: releases