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
34 changes: 21 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,46 @@ name: Build

on: [push, pull_request]

permissions:
contents: read

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-15-intel, macos-latest]

steps:
- uses: actions/checkout@v4

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
- uses: actions/checkout@v6
with:
platforms: all
persist-credentials: false

# Used to host cibuildwheel
- uses: actions/setup-python@v6

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==3.3.1

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
env:
CIBW_ARCHS: all
- uses: actions/upload-artifact@v3
run: python -m cibuildwheel --output-dir wheelhouse

- uses: actions/upload-artifact@v6
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Build SDist
run: pipx run build --sdist
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v6
with:
name: sdist
path: dist/*.tar.gz
17 changes: 12 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,22 @@ on:
push:
pull_request:
name: Test
permissions:
contents: read
jobs:
pytest:
name: pytest
name: pytest (${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v5
- uses: actions/checkout@v6
with:
python-version: "3.10"
persist-credentials: false
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
architecture: "x64"
- run: python -m pip install -U pip wheel setuptools
- run: python -m pip install -r test-requirements.txt
Expand All @@ -19,4 +26,4 @@ jobs:
CFLAGS: "-DCYTHON_TRACE=1"
BENCODER_LINETRACE: 1
- run: python -m pytest --cov=bencoder --cov-report=xml .
- uses: codecov/codecov-action@v3.1.4
- uses: codecov/codecov-action@v4
5 changes: 2 additions & 3 deletions bencoder.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,8 @@ cdef encode_dict(x, list r):


encode_func = {
int: encode_int,
bool: encode_int,
long: encode_long,
int: encode_long,
bool: encode_int,
bytes: encode_bytes,
str: encode_string,
list: encode_list,
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[build-system]
requires = ["cython>=0.29.32", "setuptools>=58.0", "wheel"]
requires = ["cython>=3.0", "setuptools>=58.0", "wheel"]
build-backend = "setuptools.build_meta"

[tool.cibuildwheel]
skip = "cp36-* cp37-* cp38-* cp39-* pp37-* pp38-* pp39-*"
test-requires = "pytest"
test-command = "pytest {project}/tests"
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,18 @@ def run_tests(self):
'Programming Language :: Cython',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Utilities',
],
python_requires='>=3.10',
ext_modules=ext_modules,
install_requires=[],
tests_require=['cython', 'pytest', 'coverage'],
Expand Down
6 changes: 3 additions & 3 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Cython==0.29.32
pytest==7.2.0
pytest-cov==4.0.0
Cython>=3.0
pytest>=7.2.0
pytest-cov>=4.0.0
Loading