Skip to content

Commit af228a0

Browse files
committed
pyproject.toml and CI
1 parent 6dc4f8c commit af228a0

File tree

2 files changed

+115
-0
lines changed

2 files changed

+115
-0
lines changed

.github/workflows/wheels.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Build and Publish Wheels (Multi Arch)
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
release:
9+
types: [created] # This triggers the job when a new GitHub release is created.
10+
11+
jobs:
12+
build:
13+
name: Build Wheels (${{ matrix.os }} - ${{ matrix.arch }})
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ubuntu-24.04, ubuntu-22.04, macos-15, windows-2025]
19+
arch: [x86_64]
20+
include:
21+
- os: ubuntu-24.04-arm
22+
arch: aarch64
23+
- os: ubuntu-22.04-arm
24+
arch: aarch64
25+
- os: macos-15
26+
arch: arm64
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: Set up Python 3.x
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: 3.x
33+
- name: Install dependencies
34+
run: pip install --upgrade pip setuptools wheel twine
35+
- name: Build wheels
36+
run: pip wheel . -w dist
37+
- name: Upload wheels artifact
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
41+
path: dist/*
42+
43+
publish:
44+
name: Publish to PyPI
45+
runs-on: ubuntu-latest
46+
needs: build # Ensure this job only runs if the build completes successfully.
47+
if: github.event_name == 'release' # Only publish when a release is created.
48+
steps:
49+
- uses: actions/checkout@v4
50+
- name: Download all built wheels
51+
uses: actions/download-artifact@v4
52+
with:
53+
path: dist
54+
- name: Publish package to PyPI
55+
env:
56+
PYPI_USERNAME: __token__
57+
PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
58+
run: |
59+
python -m pip install --upgrade twine
60+
python -m twine upload dist/** --username "$PYPI_USERNAME" --password "$PYPI_PASSWORD"

pyproject.toml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# pyproject.toml
2+
[build-system]
3+
requires = ["setuptools>=42.0", "wheel"]
4+
build-backend = "setuptools.build_meta"
5+
6+
[project]
7+
name = "pyplusplus"
8+
version = "1.8.7"
9+
authors = [
10+
{name = "Roman Yakovenko", email = "roman.yakovenko@gmail.com"},
11+
]
12+
maintainers = [
13+
{name = "Mark Moll", email = "mark.moll@gmail.com"},
14+
]
15+
description = "Py++ is a framework of components for creating a C++ code generator using the Boost.Python library"
16+
readme = "README.txt"
17+
license = {file = "LICENSE_1_0.txt"}
18+
requires-python = ">=2.7"
19+
classifiers = [
20+
"Development Status :: 5 - Production/Stable",
21+
"Environment :: Console",
22+
"Intended Audience :: Developers",
23+
"Operating System :: MacOS :: MacOS X",
24+
"Operating System :: Microsoft :: Windows",
25+
"Operating System :: POSIX",
26+
"Programming Language :: Python",
27+
"Topic :: Software Development"
28+
]
29+
dependencies = [
30+
"pygccxml"
31+
]
32+
33+
[tool.setuptools]
34+
packages = [
35+
"pyplusplus",
36+
"pyplusplus.file_writers",
37+
"pyplusplus.code_creators",
38+
"pyplusplus.creators_factory",
39+
"pyplusplus.code_repository",
40+
"pyplusplus.code_repository.indexing_suite",
41+
"pyplusplus.decl_wrappers",
42+
"pyplusplus.module_builder",
43+
"pyplusplus.utils",
44+
"pyplusplus.function_transformers",
45+
"pyplusplus._logging_",
46+
"pyplusplus.messages",
47+
"pyplusplus.binary_parsers"
48+
]
49+
50+
[tool.cibuildwheel]
51+
archs = ["auto64"]
52+
build-verbosity = 1
53+
54+
manylinux-x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64"
55+
manylinux-aarch64-image = "quay.io/pypa/manylinux_2_28_aarch64"

0 commit comments

Comments
 (0)