Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 65 additions & 36 deletions .github/workflows/pypi_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,45 +22,69 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest, macos-latest]
# os: [ubuntu-latest, windows-latest, macos-13, macos-14]
# python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest]
python-version: ["3.12"]

steps:
# # TODO: Add C++ compliers
# # Fetch CUDA toolkit using Jimver/cuda-toolkit
# - name: Fetch CUDA toolkit
# uses: Jimver/[email protected]
# id: cuda-toolkit
# with:
# cuda: "12.1.0"

# - name: Check nvcc version
# run: nvcc -V

- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
# - name: Set up Python
# uses: actions/setup-python@v5
# # with:
# # python-version: "3.12"
# with:
# python-version: ${{ matrix.python-version }}

# - name: Install system dependencies (Ubuntu)
# if: runner.os == 'Linux'
# run: |
# sudo apt-get update
# sudo apt-get install -y make gcc g++ python3-dev

# - name: Install system dependencies (macOS)
# if: runner.os == 'macOS'
# run: |
# brew install gcc make

# - name: Install development and distributions version
# run: |
# pip install --upgrade pip
# pip install -v .
# pip install pytest build cibuildwheel

# - name: Build Source Distribution
# run: |
# # make
# # make test
# # python -m build --sdist
# cibuildwheel --output-dir dist

- name: build wheels with cibuildwheel
uses: pypa/[email protected]
# env:
# CIBW_SOME_OPTION: value
# ...
# with:
# python-version: "3.12"
with:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y make gcc g++ python3-dev
# package-dir: .
# output-dir: wheelhouse
# config-file: "{package}/pyproject.toml"

- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install gcc make
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install development and distributions version
run: |
pip install --upgrade pip
Expand All @@ -73,11 +97,10 @@ jobs:
make test
python -m build --sdist

- name: Store the distribution packages
uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
name: cibw-sdist
path: dist/*.tar.gz

publish-to-pypi:
name: Publish Python distribution to PyPI
Expand All @@ -96,8 +119,10 @@ jobs:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
env:
Expand All @@ -118,8 +143,10 @@ jobs:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
Expand Down Expand Up @@ -160,8 +187,10 @@ jobs:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true
- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
11 changes: 2 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ requires = [
"setuptools_scm>=8", # For version management
"setuptools>=61.0.0", # For building the package
"pytest>=8.0.0", # For running tests
"cibuildwheel>=2.0.0",
"wheel",
]
# build-backend = "scikit_build_core.build"
build-backend = "setuptools.build_meta"
Expand Down Expand Up @@ -92,15 +94,6 @@ packages = [
"data/*.npz" # Compressed NumPy data files
]

# Build configuration
[tool.scikit-build]
sdist.exclude = [
".github",
"tests/data/*.fchk",
"examples/*.fchk"
]
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"

# Version management configuration
[tool.setuptools_scm]
# Enable setuptools-scm for version management
Loading