Skip to content

Commit 833ba9d

Browse files
authored
Pypi (#287)
* use pypi * split actions * no double * merge jobs * fix yml? * try to fix cmake * try to fix cmake * try to fix cmake * revert commending out Development.Embed in cmakelist * don't build wheels through pypi * revert changes in CMakelists * remove spurious action
1 parent 9117f96 commit 833ba9d

File tree

3 files changed

+59
-41
lines changed

3 files changed

+59
-41
lines changed

.github/workflows/pypi.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/sdist.yml

Lines changed: 56 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,65 @@
1-
name: Python Package using Conda
1+
name: Gen sdist and upload to PyPI
22

33
env:
44
CIBW_TEST_REQUIRES: pytest
55
CIBW_TEST_COMMAND: "pytest tests"
66

7-
on: [push]
7+
on:
8+
workflow_dispatch:
9+
pull_request:
10+
push:
11+
branches:
12+
- main
13+
release:
14+
types:
15+
- published
816

917
jobs:
10-
make_sdist:
11-
name: Make SDist
18+
# build_wheels:
19+
# name: Build wheels on ${{ matrix.os }}
20+
# runs-on: ${{ matrix.os }}
21+
# strategy:
22+
# matrix:
23+
# # macos-13 is an intel runner, macos-14 is apple silicon
24+
# os: [ubuntu-22.04, windows-2022, macos-13, macos-14]
25+
26+
# steps:
27+
# - uses: actions/checkout@v4
28+
29+
# - name: Build wheels
30+
# uses: pypa/[email protected]
31+
32+
# - uses: actions/upload-artifact@v4
33+
# with:
34+
# name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
35+
# path: ./wheelhouse/*.whl
36+
build_sdist:
37+
name: Build source distribution
1238
runs-on: ubuntu-latest
1339
steps:
14-
- uses: actions/checkout@v4
15-
with:
16-
fetch-depth: 0 # Optional, use if you use setuptools_scm
17-
submodules: true # Optional, use if you have submodules
18-
19-
- name: Build SDist
20-
run: pipx run build --sdist
21-
22-
- uses: actions/upload-artifact@v4
23-
with:
24-
name: cibw-sdist
25-
path: dist/*.tar.gz
40+
- uses: actions/checkout@v4
41+
42+
- name: Build sdist
43+
run: pipx run build --sdist
44+
45+
- uses: actions/upload-artifact@v4
46+
with:
47+
name: cibw-sdist
48+
path: dist/*.tar.gz
49+
50+
upload_pypi:
51+
needs: [build_sdist]
52+
runs-on: ubuntu-latest
53+
environment: pypi
54+
permissions:
55+
id-token: write
56+
if: github.event_name == 'release' && github.event.action == 'published'
57+
steps:
58+
- uses: actions/download-artifact@v4
59+
with:
60+
# unpacks all CIBW artifacts into dist/
61+
pattern: cibw-*
62+
path: dist
63+
merge-multiple: true
64+
65+
- uses: pypa/gh-action-pypi-publish@release/v1

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ cmake_minimum_required(VERSION 3.15...3.26)
33
project(${SKBUILD_PROJECT_NAME} LANGUAGES CXX)
44
message(STATUS '${SKBUILD_PROJECT_NAME}')
55
set(CMAKE_VERBOSE_MAKEFILE ON)
6-
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
76

7+
8+
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
89
find_package(Python COMPONENTS Interpreter Development.Embed REQUIRED)
10+
911
set(PYBIND11_FINDPYTHON ON)
1012
find_package(pybind11 CONFIG REQUIRED)
1113

0 commit comments

Comments
 (0)