From af228a0d2b7df8c10498869a5b588cda9a9da794 Mon Sep 17 00:00:00 2001 From: Johnny Date: Thu, 13 Feb 2025 00:17:56 +0100 Subject: [PATCH] pyproject.toml and CI --- .github/workflows/wheels.yml | 60 ++++++++++++++++++++++++++++++++++++ pyproject.toml | 55 +++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 .github/workflows/wheels.yml create mode 100644 pyproject.toml diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml new file mode 100644 index 0000000..fec22c4 --- /dev/null +++ b/.github/workflows/wheels.yml @@ -0,0 +1,60 @@ +name: Build and Publish Wheels (Multi Arch) + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + release: + types: [created] # This triggers the job when a new GitHub release is created. + +jobs: + build: + name: Build Wheels (${{ matrix.os }} - ${{ matrix.arch }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-24.04, ubuntu-22.04, macos-15, windows-2025] + arch: [x86_64] + include: + - os: ubuntu-24.04-arm + arch: aarch64 + - os: ubuntu-22.04-arm + arch: aarch64 + - os: macos-15 + arch: arm64 + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.x + uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Install dependencies + run: pip install --upgrade pip setuptools wheel twine + - name: Build wheels + run: pip wheel . -w dist + - name: Upload wheels artifact + uses: actions/upload-artifact@v4 + with: + name: wheels-${{ matrix.os }}-${{ matrix.arch }} + path: dist/* + + publish: + name: Publish to PyPI + runs-on: ubuntu-latest + needs: build # Ensure this job only runs if the build completes successfully. + if: github.event_name == 'release' # Only publish when a release is created. + steps: + - uses: actions/checkout@v4 + - name: Download all built wheels + uses: actions/download-artifact@v4 + with: + path: dist + - name: Publish package to PyPI + env: + PYPI_USERNAME: __token__ + PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + python -m pip install --upgrade twine + python -m twine upload dist/** --username "$PYPI_USERNAME" --password "$PYPI_PASSWORD" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..07d71be --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,55 @@ +# pyproject.toml +[build-system] +requires = ["setuptools>=42.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "pyplusplus" +version = "1.8.7" +authors = [ + {name = "Roman Yakovenko", email = "roman.yakovenko@gmail.com"}, +] +maintainers = [ + {name = "Mark Moll", email = "mark.moll@gmail.com"}, +] +description = "Py++ is a framework of components for creating a C++ code generator using the Boost.Python library" +readme = "README.txt" +license = {file = "LICENSE_1_0.txt"} +requires-python = ">=2.7" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Intended Audience :: Developers", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX", + "Programming Language :: Python", + "Topic :: Software Development" +] +dependencies = [ + "pygccxml" +] + +[tool.setuptools] +packages = [ + "pyplusplus", + "pyplusplus.file_writers", + "pyplusplus.code_creators", + "pyplusplus.creators_factory", + "pyplusplus.code_repository", + "pyplusplus.code_repository.indexing_suite", + "pyplusplus.decl_wrappers", + "pyplusplus.module_builder", + "pyplusplus.utils", + "pyplusplus.function_transformers", + "pyplusplus._logging_", + "pyplusplus.messages", + "pyplusplus.binary_parsers" +] + +[tool.cibuildwheel] +archs = ["auto64"] +build-verbosity = 1 + +manylinux-x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64" +manylinux-aarch64-image = "quay.io/pypa/manylinux_2_28_aarch64"