Skip to content

Commit

Permalink
Merge pull request #37 from tttapa/develop
Browse files Browse the repository at this point in the history
Version 0.3.0
  • Loading branch information
tttapa authored Nov 25, 2024
2 parents 420f73c + 024875a commit 59c10bc
Show file tree
Hide file tree
Showing 213 changed files with 11,910 additions and 4,855 deletions.
185 changes: 113 additions & 72 deletions .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: python:${{ matrix.python-version }}-bullseye
container: python:${{ matrix.python-version }}${{ matrix.image-suffix }}-bullseye
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
include:
- python-version: '3.13'
image-suffix: '-rc'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build
shell: bash
run: |
Expand All @@ -27,48 +29,51 @@ jobs:
python -m pip install -U pip build
python -m build .
- name: Upload Wheel
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: py_build_cmake-whl-${{ matrix.python-version }}
path: dist/py_build_cmake-*.whl
- name: Upload source
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: py_build_cmake-src-${{ matrix.python-version }}
path: dist/py-build-cmake-*.tar.gz
path: dist/py_build_cmake-*.tar.gz

test:
needs: build
runs-on: ubuntu-latest
container: python:${{ matrix.python-version }}-bullseye
container: python:${{ matrix.python-version }}${{ matrix.image-suffix }}-bullseye
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
include:
- python-version: '3.13'
image-suffix: '-rc'
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: py_build_cmake-whl-${{ matrix.python-version }}
path: dist
- name: Run Nox
run: |
python -m pip install -U pip nox
python -m nox
python -m pip install -U pip nox distlib jinja2
python -m nox --force-color
env:
PY_BUILD_CMAKE_WHEEL_DIR: ${{ github.workspace }}/dist

build-windows:
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Build
shell: powershell
run: |
Expand All @@ -79,102 +84,133 @@ jobs:
env:
PYTHONUTF8: 1
- name: Upload Wheel
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: py_build_cmake-whl-win-${{ matrix.python-version }}
path: dist/py_build_cmake-*.whl
- name: Upload source
uses: actions/upload-artifact@v3
with:
name: py_build_cmake-src-${{ matrix.python-version }}
path: dist/py-build-cmake-*.tar.gz

test-windows:
needs: build-windows
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v3
allow-prereleases: true
- uses: actions/download-artifact@v4
with:
name: py_build_cmake-whl-win-${{ matrix.python-version }}
path: dist
- name: Run Nox
run: |
python -m pip install -U pip nox
python -m nox
python -m pip install -U pip nox distlib jinja2
python -m nox --force-color
env:
PY_BUILD_CMAKE_WHEEL_DIR: ${{ github.workspace }}/dist

build-macos:
runs-on: macos-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
os: ['macos-13', 'macos-latest']
exclude:
- python-version: '3.7'
os: 'macos-latest'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Build
run: |
python -m venv py-venv
. ./py-venv/bin/activate
python -m pip install -U pip build
python -m build .
- name: Upload Wheel
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: py_build_cmake-whl-mac-${{ matrix.python-version }}
name: py_build_cmake-whl-${{ matrix.os }}-${{ matrix.python-version }}
path: dist/py_build_cmake-*.whl
- name: Upload source
uses: actions/upload-artifact@v3
with:
name: py_build_cmake-src-${{ matrix.python-version }}
path: dist/py-build-cmake-*.tar.gz

test-macos:
needs: build-macos
runs-on: macos-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
os: ['macos-13', 'macos-latest']
exclude:
- python-version: '3.7'
os: 'macos-latest'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v3
allow-prereleases: true
- uses: actions/download-artifact@v4
with:
name: py_build_cmake-whl-mac-${{ matrix.python-version }}
name: py_build_cmake-whl-${{ matrix.os }}-${{ matrix.python-version }}
path: dist
- name: Run Nox
run: |
python -m pip install -U pip nox
python -m nox
python -m pip install -U pip nox distlib jinja2
python -m nox --force-color
env:
PY_BUILD_CMAKE_WHEEL_DIR: ${{ github.workspace }}/dist

release:
cibw:
needs: [build]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-13, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: py_build_cmake-whl-3.11
path: dist
- name: Build Wheels
uses: pypa/cibuildwheel@7940a4c0e76eb2030e473a5f864f291f63ee879b
with:
package-dir: examples/pybind11-project
output-dir: dist
env:
CIBW_ARCHS_LINUX: 'x86_64 i686'
CIBW_ARCHS_WINDOWS: 'AMD64 x86 ARM64'
CIBW_ARCHS_MACOS: 'x86_64 universal2 arm64'
CIBW_BUILD: 'cp311-* pp39-*'
CIBW_ENVIRONMENT: 'PIP_FIND_LINKS=${{ github.workspace }}/dist PY_BUILD_CMAKE_VERBOSE=1'
CIBW_ENVIRONMENT_LINUX: 'PIP_FIND_LINKS=/project/dist PY_BUILD_CMAKE_VERBOSE=1'
CIBW_ENVIRONMENT_WINDOWS: 'PIP_FIND_LINKS=D:/a/py-build-cmake/py-build-cmake/dist PY_BUILD_CMAKE_VERBOSE=1'
- name: Upload Wheels
uses: actions/upload-artifact@v4
with:
name: pybind11_project-${{ matrix.os }}-whl
path: dist/*.whl

check-release:
if: ${{ github.event.action == 'released' || github.event.action == 'prereleased' }}
needs: [test, test-windows, test-macos]
needs: [test, test-windows, test-macos, cibw]
runs-on: ubuntu-latest
container: python:${{ matrix.python-version }}-bullseye
strategy:
matrix:
python-version: ['3.10']
python-version: ['3.11']
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: py_build_cmake-whl-${{ matrix.python-version }}
path: dist
Expand All @@ -184,19 +220,24 @@ jobs:
run: |
[ "${{ github.event.release.tag_name }}" == "$(python -c 'from importlib.metadata import version as v; print(v("py_build_cmake"))')" ]
shell: bash
- name: Install Twine
run: pip install twine
- name: Upload Wheel to PyPI
run: python -m twine upload dist/py_build_cmake-*.whl
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PyPI }}
- uses: actions/download-artifact@v3

release:
needs: [check-release]
if: ${{ github.event.action == 'released' || github.event.action == 'prereleased' }}
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/py-build-cmake
permissions:
id-token: write # mandatory for trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
name: py_build_cmake-src-${{ matrix.python-version }}
name: py_build_cmake-whl-3.11
path: dist
- name: Upload source to PyPI
run: python -m twine upload dist/py-build-cmake-*.tar.gz
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PyPI }}
- uses: actions/download-artifact@v4
with:
name: py_build_cmake-src-3.11
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
py*-venv
.venv
/toolchains
.venv*
build
.build
.*cache
__pycache__
*.pyc
dist
dist-nox
.nox
old
old
48 changes: 48 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.3.4"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: "24.3.0"
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.9.0"
hooks:
- id: mypy
files: ^src
args: []
additional_dependencies:
- "distlib~=0.3.5"
- "pyproject-metadata~=0.7.1"
- "tomli>=1.2.3,<3; python_version < '3.11'"
- "lark>=1.1.9,<2"
- "click~=8.1.3"
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: "v18.1.2"
hooks:
- id: clang-format
types_or: [c++, c]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
exclude: '(^tests/expected_contents/.*\.txt$)|(^docs/(Components|Config)\.md$)'
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: name-tests-test
args: ["--pytest-test-first"]
- id: requirements-txt-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
exclude: '^docs/(Components|Config)\.md$'
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"python.formatting.provider": "yapf",
"python.formatting.provider": "black",
"python.linting.mypyEnabled": true,
"cmake.configureEnvironment": {
"VIRTUAL_ENV": "${workspaceFolder}/.venv"
},
}
}
Loading

0 comments on commit 59c10bc

Please sign in to comment.