Skip to content

Commit 7d03717

Browse files
authored
Merge pull request #14 from whtsky/ci/circleci
ci(circleci): build manylinux & test linux pythons on circle ci
2 parents a54cadc + 0236c2f commit 7d03717

13 files changed

+232
-60
lines changed

.circleci/config.yml

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
build-wheel: &build-wheel
2+
working_directory: /work
3+
steps:
4+
- checkout
5+
- run:
6+
name: build wheel
7+
command: bash /work/ci/build-wheels.sh
8+
- run:
9+
name: upload
10+
command: |
11+
if [ $CIRCLE_TAG ]; then source /work/ci/deploy.sh; fi
12+
13+
test: &test
14+
working_directory: ~/bencoder.pyx
15+
steps:
16+
- checkout
17+
- run:
18+
name: install dependencies
19+
command: |
20+
sudo pip install -r tox-requirements.txt
21+
- restore_cache:
22+
keys:
23+
- tox-env-{{ checksum "test-requirements" }}-{{ checksum "build-requirements.txt" }}
24+
- tox-env-
25+
- run:
26+
name: test
27+
command: |
28+
tox -e ${CIRCLE_JOB}
29+
- save_cache:
30+
key: tox-env-{{ checksum "test-requirements" }}-{{ checksum "build-requirements.txt" }}
31+
paths:
32+
- .tox
33+
test_pypy: &test_pypy
34+
working_directory: ~/bencoder.pyx
35+
steps:
36+
- checkout
37+
- run:
38+
name: install dependencies
39+
command: |
40+
pip install -r tox-requirements.txt
41+
- run:
42+
name: test
43+
command: |
44+
tox -e ${CIRCLE_JOB}
45+
46+
47+
version: 2
48+
jobs:
49+
#
50+
# test
51+
#
52+
py27:
53+
docker:
54+
- image: circleci/python:2.7
55+
<<: *test
56+
py34:
57+
docker:
58+
- image: circleci/python:3.4
59+
<<: *test
60+
py35:
61+
docker:
62+
- image: circleci/python:3.5
63+
<<: *test
64+
py36:
65+
docker:
66+
- image: circleci/python:3.6
67+
<<: *test
68+
py37:
69+
docker:
70+
- image: circleci/python:3.7-rc
71+
<<: *test
72+
pypy:
73+
docker:
74+
- image: pypy:2
75+
<<: *test_pypy
76+
pypy3:
77+
docker:
78+
- image: pypy:3
79+
<<: *test_pypy
80+
81+
#
82+
# build manylinux wheel
83+
#
84+
85+
#
86+
# x64
87+
#
88+
manylinux-x64_cp27-cp27m:
89+
docker:
90+
- image: quay.io/pypa/manylinux1_x86_64
91+
<<: *build-wheel
92+
93+
manylinux-x64_cp27-cp27mu:
94+
docker:
95+
- image: quay.io/pypa/manylinux1_x86_64
96+
<<: *build-wheel
97+
98+
manylinux-x64_cp34-cp34m:
99+
docker:
100+
- image: quay.io/pypa/manylinux1_x86_64
101+
<<: *build-wheel
102+
103+
manylinux-x64_cp35-cp35m:
104+
docker:
105+
- image: quay.io/pypa/manylinux1_x86_64
106+
<<: *build-wheel
107+
108+
manylinux-x64_cp36-cp36m:
109+
docker:
110+
- image: quay.io/pypa/manylinux1_x86_64
111+
<<: *build-wheel
112+
#
113+
# x86
114+
#
115+
manylinux-x86_cp27-cp27m:
116+
docker:
117+
- image: quay.io/pypa/manylinux1_i686
118+
<<: *build-wheel
119+
120+
manylinux-x86_cp27-cp27mu:
121+
docker:
122+
- image: quay.io/pypa/manylinux1_i686
123+
<<: *build-wheel
124+
125+
manylinux-x86_cp34-cp34m:
126+
docker:
127+
- image: quay.io/pypa/manylinux1_i686
128+
<<: *build-wheel
129+
130+
manylinux-x86_cp35-cp35m:
131+
docker:
132+
- image: quay.io/pypa/manylinux1_i686
133+
<<: *build-wheel
134+
135+
manylinux-x86_cp36-cp36m:
136+
docker:
137+
- image: quay.io/pypa/manylinux1_i686
138+
<<: *build-wheel
139+
140+
141+
workflows:
142+
version: 2
143+
test_and_build:
144+
jobs:
145+
- py27
146+
- py34
147+
- py35
148+
- py36
149+
- py37
150+
- pypy
151+
- pypy3
152+
153+
- manylinux-x64_cp27-cp27m:
154+
requires:
155+
- py27
156+
- manylinux-x64_cp27-cp27mu:
157+
requires:
158+
- py27
159+
- manylinux-x64_cp34-cp34m:
160+
requires:
161+
- py34
162+
- manylinux-x64_cp35-cp35m:
163+
requires:
164+
- py35
165+
- manylinux-x64_cp36-cp36m:
166+
requires:
167+
- py36
168+
169+
- manylinux-x86_cp27-cp27m:
170+
requires:
171+
- py27
172+
- manylinux-x86_cp27-cp27mu:
173+
requires:
174+
- py27
175+
- manylinux-x86_cp34-cp34m:
176+
requires:
177+
- py34
178+
- manylinux-x86_cp35-cp35m:
179+
requires:
180+
- py35
181+
- manylinux-x86_cp36-cp36m:
182+
requires:
183+
- py36

.travis.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,12 @@ env:
1010
- VERSION=3.4
1111
- VERSION=3.5
1212
- VERSION=3.6
13-
matrix:
14-
include:
15-
- sudo: required
16-
os: linux
17-
language: python
18-
services:
19-
- docker
20-
env: DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
21-
- sudo: required
22-
os: linux
23-
language: python
24-
services:
25-
- docker
26-
env: DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
27-
PRE_CMD=linux32
2813

2914
install:
3015
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then source ci/travis_osx_install.sh; fi
31-
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then source ci/travis_linux_install.sh; fi
3216

3317
script:
3418
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then source ci/travis_osx_script.sh; fi
35-
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then source ci/travis_linux_script.sh; fi
3619

3720
after_success:
3821
- ls wheelhouse/

README.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@ Bencoder.pyx
44
A fast bencode implementation in Cython supports both Python2 & Python3 .
55

66
.. image:: https://img.shields.io/travis/whtsky/bencoder.pyx/master.svg?maxAge=3600&label=macOS
7+
:alt: macOS Test Status
78
:target: https://travis-ci.org/whtsky/bencoder.pyx
89
.. image:: https://img.shields.io/appveyor/ci/whtsky/bencoder-pyx/master.svg?maxAge=3600&label=Windows
10+
:alt: Windows Test Status
911
:target: https://ci.appveyor.com/project/whtsky/bencoder-pyx
10-
.. image:: https://semaphoreci.com/api/v1/whtsky/bencoder-pyx/branches/master/shields_badge.svg
11-
:target: https://semaphoreci.com/whtsky/bencoder-pyx
12-
13-
.. image:: https://img.shields.io/travis/whtsky/bencoder.pyx/master.svg?maxAge=3600&label=wheels
14-
:target: https://travis-ci.org/whtsky/bencoder.pyx
12+
.. image:: https://img.shields.io/circleci/ci/whtsky/bencoder-pyx/master.svg?maxAge=3600&label=Linux
13+
:alt: Linux Test Status
14+
:target: https://circleci.com/gh/whtsky/bencoder.pyx
15+
.. image:: https://img.shields.io/pypi/l/bencoder.pyx.svg
16+
:alt: PyPI License
17+
:target: https://pypi.org/project/bencoder.pyx/
1518
.. image:: https://codecov.io/gh/whtsky/bencoder.pyx/branch/master/graph/badge.svg
19+
:alt: Codecov Coverage
1620
:target: https://codecov.io/gh/whtsky/bencoder.pyx
1721

1822
Install

ci/build-wheels.sh

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
#!/bin/bash
22
set -e -x
33

4-
cd /io
4+
cd /work
55

6-
# compile wheels
7-
for PYBIN in /opt/python/*/bin/; do
8-
${PYBIN}/pip install -r /io/build-requirements.txt
9-
${PYBIN}/pip wheel /io/ -w /tmp/wheelhouse/
10-
done
6+
MANYLINUX_PYTHON=$(echo ${CIRCLE_JOB} | cut -d"_" -f2)
7+
ARCHITECTURE=$(echo ${CIRCLE_JOB} | cut -d"_" -f1 | cut -d"-" -f2)
8+
PYBIN=/opt/python/${MANYLINUX_PYTHON}/bin
9+
echo "MANYLINUX_PYTHON [${MANYLINUX_PYTHON}] ${ARCHITECTURE}"
10+
if [ "$ARCHITECTURE" == "x86" ]
11+
then
12+
echo "x86 architect, use linux32"
13+
PRE_CMD=linux32
14+
fi
15+
${PRE_CMD} ${PYBIN}/pip install -r /work/dev-requirements.txt
16+
${PRE_CMD} ${PYBIN}/pip wheel /work/ -w /tmp/wheelhouse/
1117

12-
# Bundle external shared libraries into the wheels
1318
for whl in /tmp/wheelhouse/bencoder*.whl; do
14-
auditwheel repair $whl -w /io/wheelhouse/
19+
auditwheel repair $whl -w /work/wheelhouse/
1520
done
1621

1722
# Install packages and test again
18-
for PYBIN in /opt/python/*/bin/; do
19-
${PYBIN}/pip install bencoder.pyx --no-index -f /io/wheelhouse
20-
${PYBIN}/pip install pytest pytest-benchmark
21-
(cd /io; ${PYBIN}/py.test)
22-
done
23+
${PRE_CMD} ${PYBIN}/pip install bencoder.pyx --no-index -f /work/wheelhouse
24+
(cd /work; ${PRE_CMD} ${PYBIN}/py.test)

ci/travis_linux_install.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

ci/travis_linux_script.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

ci/travis_osx_install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ git clone https://github.com/matthew-brett/multibuild.git
22
source multibuild/osx_utils.sh
33
get_macpython_environment $VERSION venv
44
pip install --upgrade pip wheel
5-
pip install -r dev-requirements.txt
5+
pip install -r test-requirements.txt

dev-requirements.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
-r build-requirements.txt
2-
pytest==3.2.5
3-
coverage==4.5.1
4-
tox==2.5.0
1+
-r test-requirements.txt
2+
-r tox-requirements.txt

setup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
from setuptools.extension import Extension
77
from setuptools.command.test import test as TestCommand
88

9-
version = platform.python_version_tuple()
10-
install_requires = []
11-
129
pyx_path = 'bencoder.pyx'
1310
c_path = 'bencoder.c'
1411

@@ -110,6 +107,7 @@ def get_tag(self):
110107
keywords=['bencoding', 'encode', 'decode', 'bittorrent', 'bencode', 'bencoder', 'cython'],
111108
cmdclass=cmdclass,
112109
classifiers=[
110+
'Development Status :: 5 - Production/Stable',
113111
'Environment :: Other Environment',
114112
'Intended Audience :: Developers',
115113
'License :: OSI Approved :: BSD License',
@@ -131,6 +129,6 @@ def get_tag(self):
131129
'Topic :: Utilities',
132130
],
133131
ext_modules=ext_modules,
134-
install_requires=install_requires,
132+
install_requires=[],
135133
tests_require=['cython', 'pytest', 'coverage'],
136134
)

test-requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-r build-requirements.txt
2+
pytest==3.2.5
3+
coverage==4.5.1

0 commit comments

Comments
 (0)