This repository has been archived by the owner on Feb 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
109 lines (106 loc) · 5.02 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
version: ~> 1.0
dist: focal
language: python
stages:
- lint
- test
- deploy
python:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "pypy3.7-7.3.5"
git:
depth: false
env:
global:
- THIS_REPO="${TRAVIS_REPO_SLUG#*/}"
- OWNER=plus3it
- RELEASE_VERSION=$(grep -E '^current_version' $TRAVIS_BUILD_DIR/.bumpversion.cfg | sed 's/^.*= //')
- PRIOR_VERSION=$(git describe --abbrev=0 --tags)
if: branch = master OR type = pull_request OR tag is present
cache: pip
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
install:
- python -m pip install -r requirements/test.txt
- python -m pip install --editable .
script:
- pytest
jobs:
include:
- stage: lint
python: 3.8
install:
- python -m pip install -r requirements/lint.txt
- python -m pip install --editable .
script:
- black --check .
- pylint pyppyn
- pylint tests/*.py
- flake8
- stage: deploy
if: branch = master AND type != pull_request
python: 3.8
env:
- JOB="Deploy to Test PyPI"
install: skip
script:
- |
if [[ "$TRAVIS_BRANCH" = "master" && "$PRIOR_VERSION" = "$RELEASE_VERSION" ]]; then
# not a release, so need to set the dev version for test pypi
# whether setup.cfg version has "dev" or not, it is added but not duplicated
ver=$(git show -s --format=%cd --date=format:'%Y%m%d%H%M%S')
sed -i -E "s/^(__version__ = )\"([0-9]+\.[0-9]+\.[0-9]+)\".*$/\1\"\2.dev$ver\"/" pyppyn/__init__.py
fi
- grep "__version__ = " pyppyn/__init__.py
deploy:
- provider: pypi
server: https://test.pypi.org/legacy/
distributions: sdist bdist_wheel
username: plus3it
password:
secure: Ms9MADWwUuFpiHv2ee2cyEu04k7NLGgiywcGWVEFMOZdfE8BW6xD9oBMyISY7mkqO1Z5o7qyLbPuFNqhJVXnIX5IuqDiMvd0SViR9AmvErhanM68Iarwz5zT6gQt5V3QEeIdgTIyVCcR5jikUyhhE/HUsXeyD2RKk+pVk8wWbfaPXquho03ztNh1PnE7s2W2mex5oTxYA8IFMY8xBtGMdXkPusrZmaBN3GU8RUoATsI1tvyPN6ydMjXDCzCCWNlMdMn8i6FmsJo7m6G8y+E3CNBIj3qUbe2ZwNO89unuvuwRJ3Deah45dvT6MkqQgJ74l6IAzv6PtQGBrcC1xTsNohUfgTViJTday4zc26e1I0Cm9r4C1Ba6eMTioYFoKxL/F8cGLalh1o1+G9wZfbuWnVSMkFpdD8LHIR1Ssd3dINc9+ELZUTRehLzjqBEecienunNTckBhARoAMzfwWGSJG35qGF6UjnJMm1s1O+oOLarKTde2ydD9KRVosw05Kq5IlHAoVVxXJwv33K0+JTDKjgTfIIGz0H8gdsxoufSTDwRIk+PEwftlkU8e5hnwnmPFkRI8w4lHwTVt5SVxpPpwBjbUpPXA5w7YYSV6MPQFTlOJlEGDlCrCHCthwWft6pKA7iNBoLuavYrW7FvTKXlrFxidFJWQ0EpGx1abZpNUCfo=
skip_cleanup: true
upload_docs: false
on:
branch: master
condition: '"$PRIOR_VERSION" = "$RELEASE_VERSION"'
- stage: deploy
if: branch = master AND type != pull_request
python: 3.8
env:
- JOB="Deploy to GitHub Releases"
- RELEASE_BODY="* [$THIS_REPO v$RELEASE_VERSION CHANGELOG](https://github.com/$OWNER/$THIS_REPO/compare/$PRIOR_VERSION...$RELEASE_VERSION)"
install: skip
script:
- echo RELEASE_BODY=$RELEASE_BODY
deploy:
- provider: releases
token:
secure: uibJIsO66C74yvBstlMAWaXS8wJv8P2pUOtRV43uC7eOsPeIaHYFPrDfHtVA/ChaU9gErr9u58b+bo2RE3BoT29fk14TGK6k/jSvmWIDkj/i+2rvQS43dWEepqisO5CddTEWPNNpbWFtIeVO3D6ybtIfRmbpaZ41z4Aj84hzZGG8/4JCdVYh1w68EcDz67FGes1QLCStvQR2SsTiHAyzTCZ2CnukqGZtJhd7M9uqKCjdkk4NW+X7SWbMTWGXfFrpIL2C16NbJ7jfu0vASvPUr5dQpsUbrg5JjeSdVKDl71mwh9CKHXNh52HBrzkU+ct9/sXWMea1IKofOZBrPcMDEDhaOHEmb/LRSQqAH0YEM9JjdvXNQuIQQ7VmpwJNqmPRuI5p5GrWI7biBMfgJTs5uhRTPM8GdHejVcvUmsb1NY7SKYI2HiWwhTWpk83/Hs8hR5dViTi5O4frw9CGwzR8h22ufrV8GHNX2cYKQJoHHaE97Z+FadRBWASXc6fKGWjt4MW5SUqlC64YRhQFAL1wzFKV59V2jHfTBHR9Qfz8lS2SB5PZwQmO7z1dW9/ttdiAanHnDl7SVgVFQv5hNWRZk4lvL1/M86LZSwjX8WPmlS5KhZsgKwsR7s3DdFr4Am2+mjyHirW+GJtJLIic2wPJAjGuOBkEx7uJmIsRzf5GOus=
name: $RELEASE_VERSION
tag_name: $RELEASE_VERSION
target_commitish: $TRAVIS_COMMIT
release_notes: $RELEASE_BODY
draft: false
on:
branch: master
condition: '"$PRIOR_VERSION" != "$RELEASE_VERSION"'
- stage: deploy
if: tag is present
python: 3.8
env:
- JOB="Deploy to PyPI"
install: skip
script: skip
deploy:
- provider: pypi
distributions: sdist bdist_wheel
username: plus3it
password:
secure: Hs9i6TQH4uqyGdnMRRoywaTbM589SIVQtgQtrdNdE0SYw7JoFKVI/AwEqjDyjsfrOLaqnl8LQ3yfNZDrW5thioj1r7MWjDOR7Cm0NwTcuHkrVE3CjVXBPE2TmevHFN59H/7TOLBW6SzQ8Wo6+9c71BAxR4agQncpq2eCoJZoepMAcfBPHpaZpExSXkH/vn5gXONfGMJaEcKU4hlP2syeyvuvCsMhHCAPr+iLTf2Lg+eWwldWnVJoZcd0u23wH01j3IZshu6HWSohMb3wAJLhjT4q7JMRD1tui600DViFdrxPQ3FSitY+ucSUZWUwX8XOtKckAlLrGIdytFkkD5j/PtIChV5cbT7peglxYuuAXKNLb0WTkJ1K6B8vgSgvs+v1dRZni3+OsUaJbnuOq8vNhgNQ4H0wUGYZDts3j7Dh2Th48Mxgt/Ebc2OToeHB81TaGSgWd0+xNQ3ewWOFdlcWjOwcsuY7xz674uD/Ocb/uq6VthX+ES0xo0QEO7PyapUwx0dpNaZDLd1azFYyY14xDGTxX3oTBGU/HOMB5ozAIap/DWswlMmOcPJ/jzK1scH49ba145PTKZ+Ln5/Ib6luOYHoNySmFyHZ3jgBk1qCUhCmnRFk4HUjRDQBjXNkr6SRXtQrbkVPOh4YXmQ+eYLP5fPip48Qv7GCNpN6ZBftwVQ=
upload_docs: false
on:
tags: true