Skip to content

Commit

Permalink
update action to build python package
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoralez committed Oct 11, 2023
1 parent 5fca0c6 commit d2cd993
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 40 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/build-python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Build python package

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
build_wheels:
name: Build wheels for ${{ matrix.platform-id }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
platform-id: manylinux_x86_64
- os: windows-2019
platform-id: win_amd64
- os: macos-latest
platform-id: macosx_x86_64
- os: macos-latest
platform-id: macosx_arm64

steps:
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: cp38-${{ matrix.platform-id }}
CIBW_ARCHS: all
CIBW_TEST_SKIP: '*-macosx_arm64'

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build sdist
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Build sdist
run: |
python -m pip install build scikit-build-core
python -m build --sdist --outdir dist
- uses: actions/upload-artifact@v3
with:
path: ./dist/*.tar.gz

upload_all:
# if: github.repository == 'Nixtla/coreforecast' && startsWith(github.ref, 'refs/tags/v')
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- name: Display structure of downloaded files
run: ls -R dist

# - name: Publish package to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
39 changes: 0 additions & 39 deletions .github/workflows/wheels.yml

This file was deleted.

7 changes: 6 additions & 1 deletion coreforecast/grouped_array.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import ctypes
import platform
import sys

import numpy as np
from importlib_resources import files

if sys.version_info < (3, 10):
from importlib_resources import files
else:
from importlib.resources import files


if platform.system() in ("Windows", "Microsoft"):
Expand Down

0 comments on commit d2cd993

Please sign in to comment.