Skip to content

Commit 094c663

Browse files
authored
ci: use github actions (#91)
* ci: use github actions * chore: fix requirements * ci: install cython * chore: simplify test * build: avoid enable line trace in wheels * build: add more arches * fix: avoid always enable tracing
1 parent 889ac98 commit 094c663

File tree

14 files changed

+103
-249
lines changed

14 files changed

+103
-249
lines changed

.circleci/config.yml

Lines changed: 0 additions & 105 deletions
This file was deleted.
File renamed without changes.

.github/workflows/build.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build_wheels:
7+
name: Build wheels on ${{ matrix.os }}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os: [ubuntu-20.04, windows-2019, macos-10.15]
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Set up QEMU
17+
if: runner.os == 'Linux'
18+
uses: docker/setup-qemu-action@v1
19+
with:
20+
platforms: all
21+
22+
- name: Build wheels
23+
uses: pypa/cibuildwheel@v2.3.1
24+
env:
25+
# configure cibuildwheel to build native archs ('auto'), and some
26+
# emulated ones
27+
CIBW_ARCHS_LINUX: auto aarch64
28+
- uses: actions/upload-artifact@v2
29+
with:
30+
path: ./wheelhouse/*.whl
31+
32+
make_sdist:
33+
name: Make SDist
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v2
37+
- name: Build SDist
38+
run: pipx run build --sdist
39+
- uses: actions/upload-artifact@v2
40+
with:
41+
path: dist/*.tar.gz

.github/workflows/test.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
on:
2+
push:
3+
pull_request:
4+
name: Test
5+
jobs:
6+
pytest:
7+
name: pytest
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@master
11+
- uses: actions/setup-python@v2
12+
with:
13+
python-version: "3.8"
14+
architecture: "x64"
15+
- run: python -m pip install -U pip wheel setuptools
16+
- run: python -m pip install -r test-requirements.txt
17+
- run: python -m pip install .
18+
env:
19+
CFLAGS: "-DCYTHON_TRACE=1"
20+
BENCODER_LINETRACE: 1
21+
- run: python -m pytest --cov=bencoder --cov-report=xml .
22+
- uses: codecov/codecov-action@v2.1.0

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
__pycache__/
33
*.py[cod]
44
*$py.class
5+
.pytest_cache/
56

67
# C extensions
78
*.so

.travis.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

README.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ Bencoder.pyx
33

44
A fast bencode implementation in Cython supports both Python2 & Python3 .
55

6-
.. image:: https://img.shields.io/circleci/build/github/whtsky/bencoder.pyx/master
7-
:alt: Linux Test Status
8-
:target: https://circleci.com/gh/whtsky/bencoder.pyx
96
.. image:: https://img.shields.io/pypi/l/bencoder.pyx.svg
107
:alt: PyPI License
118
:target: https://pypi.org/project/bencoder.pyx/
@@ -44,6 +41,10 @@ Usage
4441
ChangeLog
4542
----------
4643

44+
Versoin 3.0.0
45+
46+
+ Drop support for Python 2
47+
4748
Version 2.0.1
4849
~~~~~~~~~~~~~~~
4950

appveyor.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

bencoder.pyx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,13 @@
1212

1313
# Based on https://github.com/karamanolev/bencode3/blob/master/bencode.py
1414

15-
__version__ = '2.0.1'
15+
__version__ = '3.0.0'
1616

1717

1818

1919
from cpython.version cimport PY_MAJOR_VERSION, PY_MINOR_VERSION
20-
IS_PY2 = PY_MAJOR_VERSION == 2
21-
if IS_PY2:
22-
END_CHAR = 'e'
23-
ARRAY_TYPECODE = b'b'
24-
else:
25-
END_CHAR = ord('e')
26-
ARRAY_TYPECODE = 'b'
20+
END_CHAR = ord('e')
21+
ARRAY_TYPECODE = 'b'
2722

2823
if PY_MAJOR_VERSION >= 3 and PY_MINOR_VERSION >=7:
2924
OrderedDict = dict
@@ -81,10 +76,7 @@ for func, keys in [
8176
(decode_string, [str(x) for x in range(10)])
8277
]:
8378
for key in keys:
84-
if IS_PY2:
85-
decode_func[key] = func
86-
else:
87-
decode_func[ord(key)] = func
79+
decode_func[ord(key)] = func
8880

8981

9082
def bdecode2(bytes x):

build-requirements.txt

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

0 commit comments

Comments
 (0)