diff --git a/.travis.yml b/.travis.yml index 00b7d769..2648ce08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,63 +1,81 @@ matrix: include: + - os: windows + language: sh + python: 3.6 + name: Build on Python 3.6.8 in Windows + 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" 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" CAIRO_VERSION=1.17.2 - os: linux dist: trusty language: python - python: "3.5" + python: 3.5 + name: Build on Python 3.5 in Trusty Linux env: CFLAGS="-Werror -coverage" - os: linux dist: trusty language: python - python: "3.6" + python: 3.6 + name: Build on Python 3.6 in Trusty Linux env: CFLAGS="-Werror -coverage" - os: linux dist: xenial language: python - python: "3.7" + python: 3.7 + name: Build on Python 3.7 in Xenial Linux env: CFLAGS="-Werror -coverage" - os: linux dist: xenial language: python - python: "3.8" - env: CFLAGS="-Werror -coverage" - - os: linux - dist: xenial - language: python - python: "pypy3" + python: 3.8 + name: Build on Python 3.8 in Xenial Linux env: CFLAGS="-Werror -coverage" - os: osx osx_image: xcode11.3 language: generic + name: Build on Python 3.8 in Mac OSX xcode11.3 env: CFLAGS="-Werror -coverage" - - install: - - 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 - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install pkg-config || true; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install cairo || true; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew unlink python@2 || true; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install python || true; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then python3 -m pip install virtualenv; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then virtualenv ../venv -p python3; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source ../venv/bin/activate; fi - - python -m pip install --upgrade setuptools - - python -m pip install --upgrade pytest flake8 "sphinx<3" sphinx_rtd_theme coverage codecov hypothesis attrs - - python -m pip install --upgrade mypy || true - - if [[ "$TRAVIS_OS_NAME" != "osx" ]] && [[ "$TRAVIS_PYTHON_VERSION" != "3.8" ]] && [[ "${TRAVIS_PYTHON_VERSION:0:4}" != "pypy" ]]; then python -m pip install --upgrade pygame; 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 + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install pkg-config || true; fi + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install cairo || true; fi + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"; fi + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew unlink python@2 || true; fi + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install python || true; fi + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then python3 -m pip install virtualenv; fi + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then virtualenv ../venv -p python3; fi + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then source ../venv/bin/activate; fi + - if [ "$TRAVIS_OS_NAME" != "windows" ]; then python -m pip install --upgrade setuptools; fi + - if [ "$TRAVIS_OS_NAME" != "windows" ]; then python -m pip install --upgrade pytest flake8 "sphinx<3" sphinx_rtd_theme coverage codecov hypothesis attrs; fi + - if [ "$TRAVIS_OS_NAME" != "windows" ]; then python -m pip install --upgrade mypy || true; fi script: - - python -m coverage run --branch setup.py test - - python -m codecov --required || true - - python -m flake8 . - - python setup.py sdist - - python setup.py bdist - - python setup.py install --root=_root - - python setup.py install --root="$(pwd)"/_root_abs - - python setup.py bdist_egg - - python setup.py bdist_wheel - - python setup.py install --root=_root_setup - - if [[ "${TRAVIS_PYTHON_VERSION:0:4}" != "pypy" ]] ; then python -m pip install .; fi - - python -m sphinx -W -a -E -b html -n docs docs/_build + #windows build + - 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 + - if [ "$TRAVIS_OS_NAME" != "windows" ]; then python setup.py install --root="$(pwd)"/_root_abs; fi + - if [ "$TRAVIS_OS_NAME" != "windows" ]; then python setup.py bdist_wheel; fi + - if [ "$TRAVIS_OS_NAME" != "windows" ]; then python setup.py install --root=_root_setup; fi + - 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 + +deploy: + if: TRAVIS_OS_NAME = windows + provider: releases + file_glob: true + api_key: $GITHUBOAUTHTOKEN + file: dist/* + skip_cleanup: true + draft: true 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/setup.py b/setup.py index 7d5f812d..3918272c 100755 --- a/setup.py +++ b/setup.py @@ -579,7 +579,6 @@ def main(): "build_tests": build_tests, "sdist": sdist, } - setup( name="pycairo", version=PYCAIRO_VERSION, @@ -595,6 +594,7 @@ def main(): "cairo": [ "__init__.pyi", "py.typed", + "cairo.dll", ], }, classifiers=[