forked from pygobject/pycairo
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Port bash script naveen521kk to .travis.yml #1
Closed
stuaxo
wants to merge
14
commits into
naveen521kk:windows-wheels
from
stuaxo:feature/port-to-tavis-yml
Closed
Changes from 8 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6ddbd97
Try using nuget
naveen521kk 7366e95
Make as single script
naveen521kk 8883cf1
Remove a line
naveen521kk 895a850
WIP: Port bash script naveen521kk to .travis.yml
stuaxo 112a22e
Update .travis.yml
stuaxo 76a3b97
Update .travis.yml
stuaxo a18151a
Merge branch 'windows-wheels' into feature/port-to-tavis-yml
stuaxo b4ca83f
Ignore windows from test
naveen521kk 2bf0f5c
Update .travis.yml
stuaxo 0893722
Update .travis.yml
stuaxo 7e36ce5
Update .travis.yml
stuaxo f2b9591
Update .travis.yml
stuaxo 447e8ae
Revert to original changes - Testing
naveen521kk d7727ca
Fix x86 build
naveen521kk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,18 +3,33 @@ matrix: | |
- 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 | ||
name: Build on x64 Python 3.6.8 in Windows | ||
env: ARCH=x64 CAIRO_VERSION=1.17.2 PYTHON_PACKAGE=python PYTHON_VERSION="3.6.8" | ||
- 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 | ||
name: Build on x64 Python 3.7.7 in Windows | ||
env: ARCH=x64 CAIRO_VERSION=1.17.2 PYTHON_PACKAGE=python PYTHON_VERSION="3.7.7" | ||
- 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 | ||
name: Build on x64 Python 3.8.3 in Windows | ||
env: ARCH=x64 CAIRO_VERSION=1.17.2 PYTHON_PACKAGE=python PYTHON_VERSION="3.8.3" | ||
- os: windows | ||
language: sh | ||
python: 3.6 | ||
name: Build on x86 Python 3.6.8 in Windows | ||
env: ARCH=x86 CAIRO_VERSION=1.17.2 PYTHON_PACKAGE=pythonx86 PYTHON_VERSION="3.6.8" | ||
- os: windows | ||
language: sh | ||
python: 3.7 | ||
name: Build on x86 Python 3.7.7 in Windows | ||
env: ARCH=x86 CAIRO_VERSION=1.17.2 PYTHON_PACKAGE=pythonx86 PYTHON_VERSION="3.7.7" | ||
- os: windows | ||
language: sh | ||
python: 3.8 | ||
name: Build on x86 Python 3.8.3 in Windows | ||
env: ARCH=x86 CAIRO_VERSION=1.17.2 PYTHON_PACKAGE=pythonx86 PYTHON_VERSION="3.8.3" | ||
stuaxo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- os: linux | ||
dist: trusty | ||
language: python | ||
|
@@ -44,6 +59,8 @@ matrix: | |
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 | ||
|
@@ -56,20 +73,33 @@ install: | |
- 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 | ||
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then curl -sS -L https://aka.ms/nugetclidl -o $TMP/nuget.exe; fi | ||
stuaxo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then curl -sS -L https://github.com/preshing/cairo-windows/releases/download/$CAIRO_VERSION/cairo-windows-$CAIRO_VERSION.zip -o $TMP/cairo-windows-$CAIRO_VERSION.zip; fi | ||
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then 7z x $TMP/cairo-windows-$CAIRO_VERSION.zip -o$TMP; fi | ||
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then $TMP/nuget install python -Version $PYTHON_VERSION -OutputDirectory $TMP/nuget-$ARCH; fi | ||
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then export INCLUDE="$TMP/cairo-windows-$CAIRO_VERSION/include"; fi | ||
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then export LIB=$TMP/cairo-windows-$CAIRO_VERSION/lib/$ARCH; fi | ||
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then export PATH=$TMP/nuget-$ARCH/python.$PYTHON_VERSION/tools/:$TMP/nuget-$ARCH/python.$PYTHON_VERSION/tools/Scripts:$PATH; fi | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found why it fails. Because the nuget package |
||
- python -m pip install --upgrade wheel | ||
- 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 | ||
|
||
script: | ||
#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 | ||
- if [[ "$TRAVIS_OS_NAME" == "windows" ]] ; then cp $TMP/cairo-windows-$CAIRO_VERSION/lib/$ARCH/cairo.dll cairo/cairo.dll; fi | ||
- python -m coverage run --branch setup.py test | ||
- python -m codecov --required || true | ||
stuaxo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- 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_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 | ||
|
||
|
||
deploy: | ||
if: TRAVIS_OS_NAME = windows | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be updated to
3.8.5
as it is released now.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot...
We can automate this, I spoke to dependencies.io who gave me an account for open source stuff + that can generate diffs and PRs for this sort of thing.
It's annoying nuget doesn't accept a query like 3.7.x and give the highest match, I wonder if chocolatey can do it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use a query like
3.7
I think.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I just found that choco and nuget are one and the same thing in structure. Choco uses nugets structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chocolatey has some extensions, I'm inclined to switch back to it, as it has some advantages.
Native support in Travis: one less thing to install, and Travis' cache support seems to include it.
You can force it to install for 32 or 64 bit as needed.
Semver: not supported now, but they have a ticket.
chocolatey/choco#1610
In the meantime I think we might be able to do semver support with a combination of powershell and the output of
choco search
or hit their API directly withcURL
.This would be good as we could specify the python version with 2 digit versions, not 3, so one less thing to support and patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can pass - -x86 to install 32 bit versions, I haven't tried it yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't help much. Nuget python is build for CI ,but choco is using default py installer which may be troublesome. So better to use nuget for x86.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, will stay on nuget, if there are questions around chocolatey.
Do you know what the issues with the default installer are?
I haven't used windows as my default OS for a while, well aware windows + python + C extensions can get pretty painful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kinda use windows as my default one. Maybe because I don't know C or something. I just know quite a few basic of python and got to know about this because of manim. Some video tool which use pycairo as it's base. I don't even have C compilers in my PC and that made me do this. But yeah Nuget x86 py build should be used or we should use something kinada docker or something but not required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be easily fixed if we were to use GitHub Actions.