-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
47 lines (47 loc) · 1.4 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
dist: xenial
language: python
python:
- '2.7'
- '3.5'
- '3.6'
- '3.7'
cache:
directories:
- "$HOME/.rpmlint/"
install:
- sudo apt-get install -y lintian
- if [[ $TRAVIS_PYTHON_VERSION != 2.6 ]]; then pip install pylint; fi
- pip install -r requirements.txt
- pip install -r test-requirements.txt
- pip install coverage
before_script:
- if [[ "$TRAVIS_PYTHON_VERSION" = "2.7" ]]; then export IS_PRIMARY_MATRIX_JOB=true;
fi
- SEMVER_REGEX="^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(\-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$"
- |
- if [[ "$TRAVIS_TAG" =~ $SEMVER_REGEX ]]; then export PACKAGE_VERSION=${TRAVIS_TAG#v};
fi
- echo $TRAVIS_TAG
- echo $PACKAGE_VERSION
- echo $IS_PRIMARY_MATRIX_JOB
script:
- python -c "import sys; print('python version:%s' % sys.version);"
- python -c "import sys; print('python version:%s' % sys.version[0]);"
- if [[ "$TRAVIS_PYTHON_VERSION" != 3.7 ]]; then ./pylint-runner.py -s; fi
- nosetests -v --with-coverage
- python setup.py sdist bdist_wheel
after_success:
- bash <(curl -s https://codecov.io/bash)
before_deploy:
- PACKAGE_DATE=$(git log -1 --pretty="format:%ad" $TRAVIS_TAG --date=short);
- echo $PACKAGE_DATE;
after_deploy:
- cat $HOME/.pypirc
deploy:
- provider: pypi
user: apptuit.ai
distributions: sdist bdist_wheel
on:
tags: true
condition: $PACKAGE_VERSION != "" && $IS_PRIMARY_MATRIX_JOB == "true"
password: $PYPI_CREDS