Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 0 additions & 105 deletions .circleci/config.yml

This file was deleted.

File renamed without changes.
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build

on: [push, pull_request]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-10.15]

steps:
- uses: actions/checkout@v2

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
with:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.3.1
env:
# configure cibuildwheel to build native archs ('auto'), and some
# emulated ones
CIBW_ARCHS_LINUX: auto aarch64
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl

make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build SDist
run: pipx run build --sdist
- uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
push:
pull_request:
name: Test
jobs:
pytest:
name: pytest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v2
with:
python-version: "3.8"
architecture: "x64"
- run: python -m pip install -U pip wheel setuptools
- run: python -m pip install -r test-requirements.txt
- run: python -m pip install .
env:
CFLAGS: "-DCYTHON_TRACE=1"
BENCODER_LINETRACE: 1
- run: python -m pytest --cov=bencoder --cov-report=xml .
- uses: codecov/codecov-action@v2.1.0
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
__pycache__/
*.py[cod]
*$py.class
.pytest_cache/

# C extensions
*.so
Expand Down
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ Bencoder.pyx

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

.. image:: https://img.shields.io/circleci/build/github/whtsky/bencoder.pyx/master
:alt: Linux Test Status
:target: https://circleci.com/gh/whtsky/bencoder.pyx
.. image:: https://img.shields.io/pypi/l/bencoder.pyx.svg
:alt: PyPI License
:target: https://pypi.org/project/bencoder.pyx/
Expand Down Expand Up @@ -44,6 +41,10 @@ Usage
ChangeLog
----------

Versoin 3.0.0

+ Drop support for Python 2

Version 2.0.1
~~~~~~~~~~~~~~~

Expand Down
40 changes: 0 additions & 40 deletions appveyor.yml

This file was deleted.

16 changes: 4 additions & 12 deletions bencoder.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,13 @@

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

__version__ = '2.0.1'
__version__ = '3.0.0'



from cpython.version cimport PY_MAJOR_VERSION, PY_MINOR_VERSION
IS_PY2 = PY_MAJOR_VERSION == 2
if IS_PY2:
END_CHAR = 'e'
ARRAY_TYPECODE = b'b'
else:
END_CHAR = ord('e')
ARRAY_TYPECODE = 'b'
END_CHAR = ord('e')
ARRAY_TYPECODE = 'b'

if PY_MAJOR_VERSION >= 3 and PY_MINOR_VERSION >=7:
OrderedDict = dict
Expand Down Expand Up @@ -81,10 +76,7 @@ for func, keys in [
(decode_string, [str(x) for x in range(10)])
]:
for key in keys:
if IS_PY2:
decode_func[key] = func
else:
decode_func[ord(key)] = func
decode_func[ord(key)] = func


def bdecode2(bytes x):
Expand Down
1 change: 0 additions & 1 deletion build-requirements.txt

This file was deleted.

1 change: 0 additions & 1 deletion dev-requirements.txt

This file was deleted.

7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[build-system]
requires = ["cython==0.29.21", "setuptools>=58.0", "wheel"]
build-backend = "setuptools.build_meta"

[tool.cibuildwheel]
test-requires = "pytest"
test-command = "pytest {project}/tests"
Loading