-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
157 lines (140 loc) · 7.86 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
language: python
python:
# We don't actually use the Travis Python, but this keeps it organized.
- "3.5"
#- "3.6" # TODO if enable, add -Py${TRAVIS_PYTHON_VERSION} to cache name
env:
matrix:
- QT_VER=5.6.3
QT_DIR=$TRAVIS_BUILD_DIR/Qt$QT_VER
PYQT_VER=5.6
PYQT_DIR=$TRAVIS_BUILD_DIR/PyQt$PYQT_VER-with_src
PYQT_DIST_DIR=$TRAVIS_BUILD_DIR/PyQt5
CACHE_NAME=Qt5.6.3-PyQt5.6
# Note: PYQT_DIST_DIR folder should have the same name than the python package
# - QT_VER=5.9.2 PYQT_VER=5.9 CACHE_NAME=Qt5.9.2-PyQt5.9 >> 5.9 does not work
global:
- GH_REF: [email protected]:smarie/PyQt5-minimal.git
# cache: pip
cache:
directories:
- '$QT_DIR'
- '$PYQT_DIR'
install:
- sudo apt-get install pandoc
- sudo apt-get install ant
- sudo apt-get install ant-optional
- sudo apt-get install rpm
- sudo apt-get install alien
# (a) install conda - from https://conda.io/docs/user-guide/tasks/use-conda-with-travis-ci.html
- echo "downloading miniconda"; if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
sudo wget -q https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
else
sudo wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- echo "installing miniconda to $HOME/miniconda"; bash miniconda.sh -b -p $HOME/miniconda; export PATH="$HOME/miniconda/bin:$PATH"
- echo "configuring miniconda"; hash -r; conda config --set always_yes yes --set changeps1 no
# - conda update -q conda NO !!!! # conda info -a # Use this to debug conda
# (b) setup conda environment
- echo "conda-installing python, pip, and setuptools"; conda install "python=$TRAVIS_PYTHON_VERSION" "sip" "pip" "setuptools" -q
# - echo "pip-installing sip"; pip install "sip>=4.19.3"
# (c) Compile and install Qt
# - conda install "qt==5.6.0" >> linked to ICU, too big ! > we end up with a 80Mo package for envswitch
# => build & install Qt from sources instead:
- cd "$TRAVIS_BUILD_DIR"
- echo $QT_DIR
# only build qt if needed (no cached version yet)
# !!!! warning NO QUOTES and NO CURLY BRACES in the test !!!!
- if ls $QT_DIR/lib/*.so 1> /dev/null 2>&1; then
echo "Qt was already built in a previous run, using cached folder $QT_DIR";
ls $QT_DIR/lib;
else
echo "Building Qt from sources using script $TRAVIS_BUILD_DIR/ci_tools/build_install_qt.sh";
rm -rf $QT_DIR;
source "$TRAVIS_BUILD_DIR/ci_tools/build_install_qt.sh";
fi
- echo "Adding qt directory $QT_DIR/bin to path"; export PATH=$QT_DIR/bin:$PATH
script:
# ********* Compile PyQt ***********
- cd "$TRAVIS_BUILD_DIR"
- echo $PYQT_DIR
# only build pyqt if needed (no cached version yet)
# !!!! warning NO QUOTES and NO CURLY BRACES in the test !!!!
- if [ ! -f $PYQT_DIR/QtGui.pyi ]; then
echo "Building PyQt from sources using script $TRAVIS_BUILD_DIR/ci_tools/build_pyqt.sh";
rm -rf $PYQT_DIR;
source "$TRAVIS_BUILD_DIR/ci_tools/build_pyqt.sh";
else
echo "PyQt was already built in a previous run, using cached folder $PYQT_DIR";
ls $PYQT_DIR;
fi
- echo "Installing PyQt to python site-packages"; cd "$PYQT_DIR"; sudo make install
# - echo "Moving PyQt binaries to working directory"; mkdir $TRAVIS_BUILD_DIR/PyQt5; cd $PYQT_DIR; find . \( -name "*so" -o -name "*pyi" \) -not -name "lib*" -exec cp {} $TRAVIS_BUILD_DIR/PyQt5 \;
# - pip install .
after_success:
# ***packaging for releases***
- echo "Creating the appropriate archives into dist/" ;
cd $TRAVIS_BUILD_DIR;
mkdir dist;
export SUF=minimal-Linux-x86_64
# Qt
- echo "Creating Qt archive" ;
sudo tar czvf ${TRAVIS_BUILD_DIR}/dist/Qt${QT_VER}_lgpl_${SUF}.tar.gz Qt${QT_VER} >/dev/null
# PyQt sources+binaries
- echo "Creating PyQt+src archive" ;
sudo tar czvf ${TRAVIS_BUILD_DIR}/dist/PyQt${PYQT_VER}_gpl_py${TRAVIS_PYTHON_VERSION}_${SUF}-with_src.tar.gz PyQt${PYQT_VER}-with_src >/dev/null
# PyQt binaries only (note: we do not include the lib*.so since they dont seem to be needed, they are not copied by the standard pyqt installer)
# NOTE2: on linux, PyQt depends on Qt in an absolute way so the users need to install Qt exactly at the same path...
- echo "Creating PyQt archive" ;
mkdir ${PYQT_DIST_DIR} ;
cd ${PYQT_DIR} ;
echo "copy all interesting files *.so *.pyi *.pyd"; find . \( -name "*so" -o -name "*pyi" -o -name "*pyd" \) -not -name "lib*" -exec cp {} ${PYQT_DIST_DIR} \; ;
echo "copy __init__.py"; cp ./__init__.py ${PYQT_DIST_DIR}
# this was a bad idea we should let the users handle the qt installation + addition to path themselves.
# echo "copy qt files inside pyqt5"; cd ${TRAVIS_BUILD_DIR}/${QT_DIR}/lib ; find . \( -name "*Core.so*" -o -name "*Gui.so*" -o -name "*Widgets.so*" \) -exec cp {} ${PYQT_DIST_DIR} \; ;
- echo "finally create the archive"; cd ${TRAVIS_BUILD_DIR};
sudo tar czvf ${TRAVIS_BUILD_DIR}/dist/PyQt${PYQT_VER}_gpl_py${TRAVIS_PYTHON_VERSION}_${SUF}.tar.gz PyQt5 >/dev/null
- ls dist
#
# # ***documentation***
# - mkdocs build -f docs/mkdocs.yml
# # mkdocs gh-deploy requires special care :
# # ---grant the possibility to push on the repo---
# - openssl aes-256-cbc -K $encrypted_92426aa61fa3_key -iv $encrypted_92426aa61fa3_iv -in ci_tools/github_travis_rsa.enc -out ci_tools/github_travis_rsa -d
# - chmod 600 ci_tools/github_travis_rsa
# - eval `ssh-agent -s` # launch the authentication agent
# - ssh-add ci_tools/github_travis_rsa # register the key
# - git config user.name "Automatic Publish"
# - git config user.email "[email protected]"
# - git remote add gh-remote "${GH_REF}";
# - git fetch gh-remote && git fetch gh-remote gh-pages:gh-pages;
# # push but only if this is not a build triggered by a pull request
# - if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_PYTHON_VERSION}" = "3.5" ]; then echo "Pushing to github"; mkdocs gh-deploy -v --dirty -f docs/mkdocs.yml --remote-name gh-remote; git push gh-remote gh-pages; fi;
deploy:
# # the pypi package
# - provider: pypi
# user: "smarie"
# password:
# secure: "UA7YFzkzKDWjTc53XVrQA0ztTRkXBp6k1+/M0aTH1XckwwTak3uVTQGAYHGpZSQ6jqm7Rz46YivmaW9IdC+rVWpWcsaO4XdhSV8lnBJW0XFdl4yuGst5wXfSQMx4JEiOzHpRn607H6ZzPgBE8mOdYqE+jAo3Mn6q8aLUMz+zUEhGV6zbqJUwV0JrwUrWsaMWLFpK3ryHmLKNnvoyaa/qudD9NJmPnrw0cXtHa/S3X02r2YyZ2LtOlDJ+ZmSDjBVF8iK2CGSTwlXViv/rHc3XPRYe0/OOJm2A7DgQgqx41tqfyBmh8kiYT1M5t2U5+OZxSdshWw0tMjpzql2LiH+ww8KmoSiMBNFa+uRzRdnDG2IGunN8D15dFSwZ2nFT4xYaIaXJ35tzoEXoBDl0LT67X+i48MuWDyvRe1kXpzz0cdPSLJ9JylrB9ErIbIE4d+m7gS4ula8YQvYJMmpLRwNO4ewb1t94tDjW+DN/5YxQuytFBMIlYx2cST5svx2jghgpkxrxOH2EZo7W6uVdltiMHJs6IcrcPaOo8GI7/TPWA7fQTuSHQ1psuRPiDECcVYmzxAqqDAQCHFLw6O1cE0S1bmPYVHFl4w7rdHa0AlJjcwVIFgAujPgAA1fof7tTMAz7/xWwluwLV+YQbJ5BP8RyNI/DnbOdR1+OOcz86RsxPS4="
# on:
# tags: true
# python: 3.5 #only one of the builds have to be deployed
# # server: https://test.pypi.org/legacy/
# distributions: "sdist bdist_wheel"
# the release on github
- provider: releases
api_key:
secure: "BRP10CcTXKIUgMqKaoOiVTCBNE3i/WPqw5AGzdV+7YVHYY5XpJ4a0ioJUdNqwHBarli6L5v7Z4uUwFXpl+ONQyenhBAlBoMm42eonMayDTl4bZC59hvWA82fEST99FF+m/entPJRfdLFeDU00Y6GfobKed6tQx+uqgN4a/OQGto1q3ZL7Znj3dZobOq38TfFRg9CZp+/0RAAnQr6wfFdTlC44oQZDF9UrG9xgLyNmId+A4Szv6fG10x+BQdxNgD5Kl4d8wMpqf//pJKE/IkeMiduu6ghOmsNjGPCbWwxIPjzKWJuKzr4k9wNVAJ/JOQ5g4e08C6bPHrVhnINEKZwx/0zSLMNGQ/IoguG/4sSANmkiGZJj04Jb+SgMZ4PrU1XHy9UJaytyx8PpBZ6stk25HVLhv8gCZ07uHcAeZ1QtUG4YfM03jV9qLjSg2eA2IXV8Dl7ObR9aQ6+/Lh7DABfi7WneA8d1YeROQnaPiyqlo3Vkty2R74UZKBNpTtZd2+Z7PgosIWD5A4HgjfM/Jt8fzPGw5GREz2PgvrxYJSEoFvp2bnbVew3xCYd7C6il7E61UQ5EPA1+m+sFmfcXeGwFtcQ1s1swIpUXVmvBhhS0EKttlLHgcBGdH03V7fXBef7k9CJGLdiEuJBaMHhFdlGYbFiRuLBjgkjNbjQ77TVveU="
file_glob: true
file:
- dist/*
# on:
# repo: smarie/PyQt5-minimal
skip_cleanup: true
on:
tags: true
matrix:
fast_finish: true
notifications:
email:
on_success: never # options: [always|never|change] default: always