|
1 | 1 | language: python |
| 2 | +python: 3.8 |
2 | 3 |
|
3 | | -matrix: |
4 | | - include: |
5 | | - # use macOS for py2 since building pandas wheels takes ages on linux |
6 | | - # and matplotlib is not installing on linux |
7 | | - - name: "MacOS py27" |
8 | | - os: osx |
9 | | - language: generic |
10 | | - env: |
11 | | - - PIP=pip2 |
12 | | - - CIBW_BUILD="cp27-*" |
13 | | - - COVER="off" |
14 | | - |
15 | | - # use macOS for py3 since building matplotlib is not working on linux |
16 | | - - name: "MacOS py36" |
17 | | - os: osx |
18 | | - language: generic |
19 | | - env: |
20 | | - - PIP=pip2 |
21 | | - - CIBW_BUILD="cp36-*" |
22 | | - - COVER="on" |
| 4 | +# setuptools-scm needs all tags in order to obtain a proper version |
| 5 | +git: |
| 6 | + depth: false |
23 | 7 |
|
24 | 8 | env: |
25 | 9 | global: |
| 10 | + # Note: TWINE_PASSWORD is set in Travis settings |
26 | 11 | - TWINE_USERNAME=geostatframework |
27 | | - |
28 | | -script: |
29 | | - # create wheels |
30 | | - - sudo $PIP install cibuildwheel==0.10.1 |
31 | | - - cibuildwheel --output-dir wheelhouse |
32 | | - # create source dist for pypi and create coverage (only once for linux py3.6) |
33 | | - - | |
34 | | - if [[ $COVER == "on" ]]; then |
35 | | - rm -rf dist |
36 | | - python setup.py sdist |
37 | | - fi |
38 | | -
|
39 | | -after_success: |
40 | | - # pypi upload (test allways and official on TAG) |
41 | | - - python -m pip install twine |
42 | | - - python -m twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ wheelhouse/*.whl |
43 | | - - python -m twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ dist/*.tar.gz |
44 | | - - | |
45 | | - if [[ $TRAVIS_TAG ]]; then |
46 | | - python -m twine upload --skip-existing wheelhouse/*.whl |
47 | | - python -m twine upload --skip-existing dist/*.tar.gz |
48 | | - fi |
| 12 | + - CIBW_BUILD="cp35-* cp36-* cp37-* cp38-*" |
| 13 | + - CIBW_SKIP="*_i686" # skip linux 32bit for matplotlib |
| 14 | + # update setuptools to latest version |
| 15 | + - CIBW_BEFORE_BUILD="pip install -U setuptools" |
| 16 | + # testing with cibuildwheel |
| 17 | + - CIBW_TEST_REQUIRES=pytest |
| 18 | + - CIBW_TEST_COMMAND="pytest -v {project}/tests" |
49 | 19 |
|
50 | 20 | notifications: |
51 | 21 | email: |
52 | 22 | recipients: |
53 | 23 | - info@geostat-framework.org |
| 24 | + |
| 25 | +before_install: |
| 26 | + - | |
| 27 | + if [[ "$TRAVIS_OS_NAME" = windows ]]; then |
| 28 | + choco install python --version 3.8.0 |
| 29 | + export PATH="/c/Python38:/c/Python38/Scripts:$PATH" |
| 30 | + # make sure it's on PATH as 'python3' |
| 31 | + ln -s /c/Python38/python.exe /c/Python38/python3.exe |
| 32 | + fi |
| 33 | +
|
| 34 | +install: |
| 35 | + - python3 -m pip install cibuildwheel==1.3.0 |
| 36 | + |
| 37 | +script: |
| 38 | + - python3 -m cibuildwheel --output-dir tmp_dist |
| 39 | + |
| 40 | +stages: |
| 41 | + - test |
| 42 | + - coverage |
| 43 | + - name: deploy |
| 44 | + if: (NOT type IN (pull_request)) AND (repo = GeoStat-Framework/welltestpy) |
| 45 | + |
| 46 | +jobs: |
| 47 | + include: |
| 48 | + - stage: test |
| 49 | + name: Test on Linux |
| 50 | + services: docker |
| 51 | + - stage: test |
| 52 | + name: Test on MacOS |
| 53 | + os: osx |
| 54 | + language: generic |
| 55 | + - stage: test |
| 56 | + name: Test on Windows |
| 57 | + os: windows |
| 58 | + language: shell |
| 59 | + |
| 60 | + - stage: coverage |
| 61 | + name: Coverage on Linux |
| 62 | + services: docker |
| 63 | + install: python3 -m pip install .[test] coveralls |
| 64 | + script: |
| 65 | + - python3 -m pytest --cov welltestpy --cov-report term-missing -v tests/ |
| 66 | + - python3 -m coveralls |
| 67 | + |
| 68 | + # Test Deploy source distribution |
| 69 | + - stage: deploy |
| 70 | + name: Test Deploy |
| 71 | + install: python3 -m pip install -U setuptools wheel twine |
| 72 | + script: python3 setup.py sdist --formats=gztar bdist_wheel |
| 73 | + after_success: |
| 74 | + - python3 -m twine upload --verbose --skip-existing --repository-url https://test.pypi.org/legacy/ dist/* |
| 75 | + |
| 76 | + # Deploy source distribution |
| 77 | + - stage: deploy |
| 78 | + name: Deploy to PyPI |
| 79 | + if: tag IS present |
| 80 | + install: python3 -m pip install -U setuptools wheel twine |
| 81 | + script: python3 setup.py sdist --formats=gztar bdist_wheel |
| 82 | + after_success: python3 -m twine upload --verbose --skip-existing dist/* |
0 commit comments