Skip to content

Commit c76cf0b

Browse files
authored
Merge pull request #43 from petrasvestartas/release+pypi
Release+pypi
2 parents ff11311 + c9aad03 commit c76cf0b

File tree

5 files changed

+90
-29
lines changed

5 files changed

+90
-29
lines changed

.github/workflows/release.yml

Lines changed: 77 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ name: Release
33
on:
44
push:
55
tags:
6-
- "v*"
6+
- "v*" # Runs only when a version tag (e.g., v1.0.0) is pushed.
77

88
jobs:
9-
Release:
9+
create_release:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
13-
- name: Create Release
13+
14+
- name: Create GitHub Release
1415
id: create_release
1516
uses: actions/create-release@v1
1617
env:
@@ -20,3 +21,76 @@ jobs:
2021
release_name: Release ${{ github.ref }}
2122
draft: false
2223
prerelease: false
24+
25+
build_wheels:
26+
name: Build wheels on ${{ matrix.platform }}
27+
runs-on: ${{ matrix.os }}
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
include:
32+
- os: ubuntu-latest
33+
platform: manylinux
34+
- os: macos-latest
35+
platform: mac
36+
- os: windows-latest
37+
platform: windows
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
with:
42+
fetch-depth: 0
43+
44+
- name: Install cibuildwheel
45+
run: pipx install cibuildwheel==2.23.1
46+
47+
- name: Build wheels
48+
run: cibuildwheel --output-dir wheelhouse .
49+
50+
- uses: actions/upload-artifact@v4
51+
with:
52+
name: wheels-${{ matrix.platform }}
53+
path: wheelhouse/*.whl
54+
55+
build_sdist:
56+
name: Build source distribution
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v4
60+
with:
61+
fetch-depth: 0
62+
63+
- name: Build SDist
64+
run: pipx run build --sdist
65+
66+
- uses: actions/upload-artifact@v4
67+
with:
68+
name: sdist
69+
path: dist/*.tar.gz
70+
71+
publish:
72+
needs: [build_sdist, build_wheels]
73+
runs-on: ubuntu-latest
74+
environment:
75+
name: pypi
76+
url: https://pypi.org/project/compas_cgal
77+
permissions:
78+
id-token: write # Required for PyPI trusted publishing
79+
80+
steps:
81+
- uses: actions/download-artifact@v4
82+
with:
83+
pattern: wheels-*
84+
path: dist
85+
merge-multiple: true
86+
87+
- uses: actions/download-artifact@v4
88+
with:
89+
name: sdist
90+
path: dist
91+
92+
- name: List files before upload
93+
run: ls -lhR dist
94+
95+
- name: Publish to PyPI
96+
uses: pypa/gh-action-pypi-publish@release/v1

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818

1919
### Added
2020

21+
* Added GitHub release action.
22+
2123
### Changed
2224

2325
* Split binding into separate dynamic libraries.

pyproject.toml

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,12 @@ doctest_optionflags = [
5858
# ============================================================================
5959

6060
[tool.scikit-build]
61-
# Protect the configuration against future changes in scikit-build-core
6261
minimum-version = "build-system.requires"
63-
64-
# Setuptools-style build caching in a local directory
6562
build-dir = "build/{wheel_tag}"
66-
67-
# Build stable ABI wheels for CPython 3.12+
68-
wheel.py-api = "cp312"
69-
70-
# Configure CMake
63+
wheel.py-api = "cp312" # Build all Python currently supported versions.
7164
cmake.version = ">=3.15"
7265
cmake.build-type = "Release"
7366

74-
# Set CMake args for verbose output
75-
cmake.args = ["-DCMAKE_VERBOSE_MAKEFILE=ON"]
76-
7767
[tool.scikit-build.metadata.version]
7868
provider = "scikit_build_core.metadata.regex"
7969
input = "src/compas_cgal/__init__.py"
@@ -86,19 +76,15 @@ CMAKE_POLICY_DEFAULT_CMP0135 = "NEW"
8676
# ============================================================================
8777

8878
[tool.cibuildwheel]
89-
# Necessary to see build output from the actual compilation
90-
build-verbosity = 1
91-
92-
# Run pytest to ensure that the package was correctly built
93-
test-command = "pytest {project}/tests"
94-
test-requires = "pytest"
95-
96-
# Don't test Python 3.8 wheels on macOS/arm64
97-
test-skip = "cp38-macosx_*:arm64"
98-
99-
# Needed for full C++17 support
100-
[tool.cibuildwheel.macos.environment]
101-
MACOSX_DEPLOYMENT_TARGET = "10.14"
79+
# build = ["cp38-*", "cp39-*", "cp31?-*"] # Build for specific Python versions.
80+
build-verbosity = 3
81+
test-requires = ["numpy", "compas", "pytest", "build"]
82+
test-command = "pip install numpy compas && pip list && pytest {project}/tests"
83+
build-frontend = "pip"
84+
manylinux-x86_64-image = "manylinux2014"
85+
skip = ["*_i686", "*-musllinux_*", "*-win32", "pp*"]
86+
macos.environment.MACOSX_DEPLOYMENT_TARGET="11.00"
87+
macos.archs = ["x86_64", "arm64"]
10288

10389
# ============================================================================
10490
# replace bumpversion.cfg

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ scikit-build-core[pyproject] >=0.10
1313
sphinx_compas2_theme
1414
twine
1515
wheel
16+
cibuildwheel

tests/test_reconstruction_pointset_outlier_removal.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
from compas.geometry import Pointcloud
44
from compas_cgal.reconstruction import pointset_outlier_removal
55
import numpy as np
6-
from line_profiler import profile
76

87

9-
@profile
108
def reconstruction_pointset_outlier_removal():
119
FILE = Path(__file__).parent.parent / "data" / "forked_branch_1.ply"
1210
c1 = Pointcloud.from_ply(FILE)

0 commit comments

Comments
 (0)