forked from sergiocorreia/panflute
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
97 lines (97 loc) · 3.31 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
# os: linux and sudo: false is assumed, which means it is using container-based Ubuntu 12.04
language: python
cache: pip
# build matrix: different python and pandoc versions
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
- "3.6-dev" # 3.6 development branch
# - "3.7-dev" # 3.7 development branch
- "nightly" # currently points to 3.7-dev
# pypy (version info from [Changelogs — PyPy documentation](http://doc.pypy.org/en/latest/index-of-whatsnew.html))
- "pypy" # PyPy2.7 5.3.1 (CPython 2.7 compatible)
- "pypy3" # PyPy3 2.4.0 (CPython 3.2 compatible)
# https://groups.google.com/forum/?fromgroups#!topic/pandoc-discuss/uGASAhRydfI
env:
- pandocVersion=1.19.2.1
- pandocVersion=latest
matrix:
allow_failures:
- python: "3.6-dev"
# - python: "3.7-dev"
- python: "nightly"
# - python: "pypy3"
fast_finish: true
# download pandoc
before_install:
- |
if [[ $pandocVersion == "latest" ]]; then
url="https://github.com/jgm/pandoc/releases/latest"
else
url="https://github.com/jgm/pandoc/releases/tag/$pandocVersion"
fi
path=$(curl -L $url | grep -o '/jgm/pandoc/releases/download/.*-amd64\.deb')
downloadUrl="https://github.com$path"
file=${path##*/}
# install dependencies
install:
# pandoc
- wget $downloadUrl &&
sudo dpkg -i $file
# latest pip dropped support for py3.2, which is the version of python in pypy3
- if [[ "$TRAVIS_PYTHON_VERSION" != "pypy3" ]]; then pip install -U pip; fi
- pip install -e .[test]
before_script:
# pasteurize for py2 only, except setup.py & panflute/version.py
- |
if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" || "$TRAVIS_PYTHON_VERSION" == "pypy" ]]; then
mv setup.py setup.py.temp
mv panflute/version.py panflute/version.py.temp
pasteurize -wnj 4 .
mv setup.py.temp setup.py
mv panflute/version.py.temp panflute/version.py
fi
# commands to run tests
script:
- py.test -vv --cov=panflute tests
# put filters in $DATADIR for panflute's autofilter
- mkdir -p $HOME/.pandoc/filters
- find ./examples/panflute ./docs/source/_static -iname '*.py' -exec cp {} $HOME/.pandoc/filters/ \;
# running all available .md files through panflute
- find . -iname '*.md' -print0 | xargs -0 -i -n1 -P4 bash -c 'pandoc -t native -F panflute -o $0.native $0' {}
before_deploy:
# create README.rst for PyPI README
- pandoc -f markdown+autolink_bare_uris-fancy_lists-implicit_header_references -M date="`date "+%B %e, %Y"`" --toc -s -o README.rst README.md
# debugging rst output
## install dependencies for rst to html
- pip install -e .[pypi]
## test if the rst output is valid
- rst2html.py README.rst > README.html
# building wheels
## unpasteurized python3 wheel
- python3 setup.py bdist_wheel
## pasteurized python2 wheel
### pasteurize except setup.py & panflute/version.py
- |
mv setup.py setup.py.temp
mv panflute/version.py panflute/version.py.temp
pasteurize -wnj 4 .
mv setup.py.temp setup.py
mv panflute/version.py.temp panflute/version.py
### prepare wheel
- pip2 install wheel
- python2 setup.py bdist_wheel
deploy:
provider: pypi
user: sergiocorreia
password: $pypi_password
# do not add bdist_wheel here, since it is done above
distributions: "sdist"
skip_cleanup: true
on:
branch: master
python: "3.6"
condition: $pandocVersion = latest