Skip to content

Commit 8cb6eee

Browse files
authored
Merge pull request #1 from aboutcode-org/ci-debug
add build and test action
2 parents efe71e8 + 0d28c20 commit 8cb6eee

4 files changed

Lines changed: 162 additions & 3 deletions

File tree

.github/workflows/pypi-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
uses: actions/setup-python@v5
6262

6363
- name: Install cibuildwheel, twine, pkginfo, and packaging
64-
run: python -m pip install --upgrade cibuildwheel twine pkginfo packaging
64+
run: python -m pip install --user --upgrade cibuildwheel twine pkginfo packaging
6565

6666
- name: Build wheels
6767
run: python -m cibuildwheel --output-dir dist/
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# Derived in part from https://github.com/google/brotli-wheels
2+
#
3+
# Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors.
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in
13+
# all copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
# THE SOFTWARE.
22+
23+
24+
name: Run tests and build wheel and sdist on all supported OS and Python
25+
26+
on: [push, pull_request, workflow_dispatch]
27+
28+
jobs:
29+
build_wheels:
30+
name: Build unicode wheels ${{ matrix.type }} ${{ matrix.arch }} on ${{ matrix.os }}
31+
runs-on: ${{ matrix.os }}
32+
defaults:
33+
run:
34+
shell: bash
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
os: [macos-latest, windows-latest]
39+
arch: [auto64]
40+
build: ["cp{39,310,311,312,313}-*"]
41+
42+
include:
43+
- os: ubuntu-latest
44+
arch: auto64
45+
type: manylinux1
46+
build: "cp39-*"
47+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
48+
49+
- os: ubuntu-latest
50+
arch: auto64
51+
type: manylinux2010
52+
build: "cp310-*"
53+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010
54+
55+
- os: ubuntu-latest
56+
arch: auto64
57+
type: manylinux2014
58+
build: "cp{311,312,313}-*"
59+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
60+
61+
- os: macos-latest
62+
arch: universal2
63+
build: "cp{39,310,311,312,313}-*"
64+
65+
- os: windows-latest
66+
arch: auto64
67+
build: "cp{39,310,311,312,313}-*"
68+
69+
steps:
70+
- uses: actions/checkout@v4
71+
72+
- name: Build wheels and run tests
73+
uses: pypa/cibuildwheel@v2.23.3
74+
env:
75+
CIBW_BUILD: ${{ matrix.build }}
76+
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.CIBW_MANYLINUX_I686_IMAGE }}
77+
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.CIBW_MANYLINUX_X86_64_IMAGE }}
78+
CIBW_ARCHS: ${{ matrix.arch }}
79+
CIBW_TEST_REQUIRES: pytest
80+
CIBW_TEST_COMMAND: pytest -vvs {project}/tests
81+
# Skip PyPy wheels
82+
CIBW_SKIP: "pp*"
83+
84+
- name: Collect built wheels
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
88+
path: ./wheelhouse/*.whl
89+
90+
build_sdist:
91+
name: Build source distribution
92+
runs-on: ubuntu-24.04
93+
94+
steps:
95+
- uses: actions/checkout@v4
96+
97+
- name: Checkout and install reqs
98+
run: |
99+
pip install --upgrade --user build twine pkginfo packaging pip setuptools cython
100+
101+
- name: Build sdist
102+
run: |
103+
python setup.py sdist
104+
twine check dist/*
105+
106+
- name: Collect built sdist
107+
uses: actions/upload-artifact@v4
108+
with:
109+
path: dist/*.tar.gz
110+
111+
test_on_posix_oses:
112+
name: Run tests ${{ matrix.python }} on ${{ matrix.os }}
113+
runs-on: ${{ matrix.os }}
114+
defaults:
115+
run:
116+
shell: bash
117+
118+
strategy:
119+
fail-fast: false
120+
matrix:
121+
os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14]
122+
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
123+
124+
steps:
125+
- name: Set up Python
126+
uses: actions/setup-python@v5
127+
with:
128+
python-version: "${{ matrix.python }}"
129+
130+
- uses: actions/checkout@v4
131+
132+
- name: Build, install and test
133+
run: >
134+
make dev &&
135+
make test
136+
137+
test_on_nt_oses:
138+
name: Run tests ${{ matrix.python }} on ${{ matrix.os }}
139+
runs-on: ${{ matrix.os }}
140+
141+
strategy:
142+
fail-fast: false
143+
matrix:
144+
os: [windows-latest]
145+
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
146+
147+
steps:
148+
- name: Set up Python
149+
uses: actions/setup-python@v5
150+
with:
151+
python-version: "${{ matrix.python }}"
152+
153+
- uses: actions/checkout@v4
154+
155+
- name: Build, install and test
156+
run: >
157+
.\configure.bat --dev &&
158+
.\venv\Scripts\activate &&
159+
py.test -vvs .

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55
[tool.setuptools_scm]
66
# this is used populated when creating a git archive
77
# and when there is .git dir and/or there is no git installed
8-
fallback_version = "9999.$Format:%h-%cs$"
8+
fallback_version = "0.0.1"
99

1010
[tool.pytest.ini_options]
1111
norecursedirs = [

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
extensions = [
8-
setuptools.Extension("cyseq._seq", ["src/cyseq/_seq.pyx"], language="c++"),
8+
setuptools.Extension("cyseq._seq", ["src/cyseq/_seq.pyx"], language="c++", extra_compile_args=["-std=c++11"]),
99
]
1010

1111
if __name__ == "__main__":

0 commit comments

Comments
 (0)