Skip to content

Commit 7ec13c5

Browse files
committed
feat: building wheels and add continuous integration
1 parent 4e5a238 commit 7ec13c5

File tree

8 files changed

+67
-11
lines changed

8 files changed

+67
-11
lines changed

.github/workflows/build_wheels.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
build_wheels:
11+
name: Build wheels on ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
# macos-13 is an intel runner, macos-14 is apple silicon
16+
os: [ubuntu-latest] #, windows-latest, macos-13, macos-14]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
submodules: recursive
22+
23+
# Used to host cibuildwheel
24+
- uses: actions/setup-python@v5
25+
26+
- name: Install cibuildwheel
27+
run: python -m pip install cibuildwheel==2.21.3
28+
29+
- name: Build wheels
30+
run: python -m cibuildwheel --output-dir wheelhouse
31+
32+
- uses: actions/upload-artifact@v4
33+
with:
34+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
35+
path: ./wheelhouse/*.whl

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
.vscode/
33
build/
44
__pycache__/
5-
*.egg-info
5+
*.egg-info
6+
wheelhouse

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "fastflow"]
2-
path = fastflow
2+
path = extern/fastflow
33
url = https://github.com/fastflow/fastflow.git

Makefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
.PHONY: clean config repara-copy titanic-copy build
1+
.PHONY: clean config repara-copy titanic-copy build ci
22

33
# run source .venv/bin/activate before running make build
44
build: clean
55
pip install .
66

7-
repara-copy:
8-
rsync -av -e ssh --exclude 'fastflow' --exclude '.git' --exclude '.venv' --exclude '*.egg-info' --exclude 'build' ./ [email protected]:/home/dferraro/fastflow-python
9-
10-
titanic-copy:
11-
rsync -av -e ssh --exclude 'fastflow' --exclude '.git' --exclude '.venv' --exclude '*.egg-info' --exclude 'build' ./ [email protected]:/home/dferraro/fastflow-python
7+
ci:
8+
cibuildwheel --platform linux
129

1310
clean:
1411
rm -rf build

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Whether you’re processing massive datasets, building scalable applications, or
2626

2727
## Installation
2828

29-
To install **fastflow**, ensure you have the following dependencies: `python3`, `python3-venv` and `python3-dev`. For example on Ubuntu you can install them using `apt install`.
29+
To install **fastflow**, ensure you have the following dependencies: `python3`, `python3-venv` and `python3-dev`. For example on Ubuntu you can install them using `apt install`. Ensure you have updated submodules by running `git submodule init && git submodule update`.
3030

3131
1. From the root directory, create virtual environment via `python3 -m venv .venv`
3232
2. From the root directory, activate the virtual environment by running `source .venv/bin/activate`
@@ -485,6 +485,10 @@ pipeline.add_stage(sink())
485485
pipeline.run_and_wait_end()
486486
```
487487

488+
## Test CI locally
489+
490+
To test the CI locally (optional), useful to test changes before actually change the whole ci, `pip install cibuildwheel` and then run `cibuildwheel --platform linux` or `make ci`.
491+
488492
## Contributing
489493

490494
Contributions are welcome! Please submit pull requests or open issues to help improve this project.

pyproject.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
11
[build-system]
22
requires = ["setuptools>=61.0"]
33
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "fastflow"
7+
version = "1.0.0"
8+
requires-python = ">= 3.8"
9+
authors = [
10+
{name = "Domenico Ferraro", email = "[email protected]"},
11+
]
12+
maintainers = [
13+
{name = "Domenico Ferraro", email = "[email protected]"},
14+
]
15+
description = "Unlock the full potential of parallel computing in Python with FastFlow, a powerful C++ library now available in Python, that brings high-performance, scalable parallelism right to your fingertips."
16+
readme = {file = "README.md", content-type = "text/markdown"}
17+
license = {file = "LICENSE"}
18+
19+
[tool.cibuildwheel]
20+
# Disable building PyPy wheels on all platforms and skip 32-bit builds
21+
skip = ["pp*", "*-manylinux_i686", "*-musllinux_i686"]

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,20 @@ def main():
77
description="Description",
88
author="Domenico Ferraro",
99
author_email="[email protected]",
10-
python_requires=">=3.8",
1110
ext_modules=[
1211
Extension(
1312
"fastflow",
1413
["fastflow_module.cpp"],
15-
include_dirs=['fastflow', 'include'],
14+
include_dirs=['extern/fastflow', 'include'],
1615
language="c++",
1716
extra_compile_args=['-O3', '-std=c++17'],
1817
# use a safe subset of the Python C API to get a forward-compatibility guarantee
1918
# to support any future version of Python, without recompilation
2019
py_limited_api = True
2120
)
2221
],
22+
package_dir={"": "."},
23+
python_requires=">=3.8",
2324
)
2425

2526
if __name__ == "__main__":

0 commit comments

Comments
 (0)