-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding workflow to publish to PyPI (#42)
* Updating pyproject.toml and rewriting publish-to-pypi.yml. * Working to get builds to pass. * Focusing just on linux for now. * Adding cmake to dev dependencies, install cmake before build. * Remove cibw before_build requirement, move cmake to build-system requires. * Increase logging to help debug the problem. * Stab in the dark to get pybind installed locally. * Attempting to explicitly define the OS/python versions to build. * Attempting to update xcode version for OSX build. * Trying to install libomp.h But there are warnings that this might not be the best thing to do. * Running just linux and windows. * Recursively pull in repos. * Remove windows, add M1 mac. * Trying to help find omp.h * Giving older mac osx a try. * Focus exclusively on linux for now. * Updating project name to test publishing. * Using clang compiler in CMakeLists.txt and building mac OSs. * Attempting to use g++ as the compiler. * Stabbing in the dark, trying to get llvm to work for mac. * Removing attempts for mac builds, leaving linux builds.
- Loading branch information
Showing
3 changed files
with
121 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,31 +9,133 @@ | |
name: Upload Python Package | ||
|
||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
# os: [ubuntu-latest, windows-latest, macos-latest, macos-14] | ||
include: | ||
|
||
# Linux 64 bit manylinux2014 | ||
# - os: ubuntu-latest | ||
# python: 39 | ||
# platform_id: manylinux_x86_64 | ||
# manylinux_image: manylinux2014 | ||
- os: ubuntu-latest | ||
python: 310 | ||
platform_id: manylinux_x86_64 | ||
manylinux_image: manylinux2014 | ||
# - os: ubuntu-latest | ||
# python: 311 | ||
# platform_id: manylinux_x86_64 | ||
# manylinux_image: manylinux2014 | ||
# - os: ubuntu-latest | ||
# python: 312 | ||
# platform_id: manylinux_x86_64 | ||
# manylinux_image: manylinux2014 | ||
|
||
# MacOS x86_64 | ||
# - os: macos-latest | ||
# python: 39 | ||
# platform_id: macosx_x86_64 | ||
# - os: macos-latest | ||
# python: 310 | ||
# platform_id: macosx_x86_64 | ||
# - os: macos-latest | ||
# python: 311 | ||
# platform_id: macosx_x86_64 | ||
# - os: macos-latest | ||
# python: 312 | ||
# platform_id: macosx_x86_64 | ||
|
||
# MacOS arm64 | ||
# - os: macos-14 | ||
# python: 39 | ||
# platform_id: macosx_arm64 | ||
# - os: macos-14 | ||
# python: 310 | ||
# platform_id: macosx_arm64 | ||
# - os: macos-14 | ||
# python: 311 | ||
# platform_id: macosx_arm64 | ||
# - os: macos-14 | ||
# python: 312 | ||
# platform_id: macosx_arm64 | ||
|
||
steps: | ||
- name: Checkout LePhare | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Attempt to install XCode version | ||
uses: maxim-lobanov/setup-xcode@v1 | ||
if: matrix.os == 'macos-14' | ||
with: | ||
xcode-version: '15.1' | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
# CIBW_ARCHS_MACOS: auto universal2 | ||
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} | ||
CIBW_ARCHS: all | ||
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }} | ||
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }} | ||
|
||
- name: Upload wheels | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | ||
path: wheelhouse/*.whl | ||
|
||
build_sdist: | ||
name: Make SDist | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
fetch-depth: 0 # Optional, use if you use setuptools_scm | ||
submodules: true # Optional, use if you have submodules | ||
|
||
- name: Build SDist | ||
run: pipx run build --sdist | ||
|
||
- name: Upload SDist | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
python-version: '3.10' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
name: cibw-sdist | ||
path: dist/*.tar.gz | ||
|
||
upload_pypi: | ||
name: Upload to test-pypi | ||
needs: [build_wheels, build_sdist] | ||
runs-on: ubuntu-latest | ||
environment: test-pypi | ||
permissions: | ||
id-token: write | ||
# if: github.event_name == 'release' && github.event.action == 'published' | ||
# # or, alternatively, urpload to PyPI on evey tag starting with 'v' (remove on: release above to use this) | ||
# # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- name: Download distribution files | ||
uses: actions/download-artifact@v4 | ||
with: | ||
# unpacks all CIBW artifacts into dist/ | ||
pattern: cibw-* | ||
path: dist | ||
merge-multiple: true | ||
|
||
- name: Upload to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,7 +85,7 @@ def run(self): | |
|
||
|
||
setup( | ||
name="lephare", | ||
name="lephare-dev", | ||
version="2.0.0", | ||
author="Johann Cohen-Tanugi", | ||
author_email="[email protected]", | ||
|