Skip to content

Commit

Permalink
RELEASE Updating to v0.8 release (#288)
Browse files Browse the repository at this point in the history
* Updating to v0.8 release
* Only run wheels on macos-12
* Build wheels into consoidated folder-s

---------

Signed-off-by: Adam Li <adam2392@gmail.com>
  • Loading branch information
adam2392 authored Jun 24, 2024
1 parent 580e087 commit 7ea563c
Show file tree
Hide file tree
Showing 10 changed files with 109 additions and 170 deletions.
62 changes: 41 additions & 21 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Wheels
name: Build_Wheels

on:
pull_request:
Expand All @@ -19,17 +19,6 @@ concurrency:
cancel-in-progress: true

jobs:
create_artifacts_folder:
name: Create Artifacts Folder
runs-on: ubuntu-latest
outputs:
artifacts_folder: ${{ steps.set_folder.outputs.folder_name }}

steps:
- name: Set Artifacts Folder
id: set_folder
run: echo "folder_name=artifacts/${{ github.run_id }}" >> $GITHUB_ENV

build_wheels:
name: Build wheels on ${{ matrix.os[1] }} - ${{ matrix.os[2] }} with Python ${{ matrix.python[0] }}
runs-on: ${{ matrix.os[0] }}
Expand All @@ -40,12 +29,18 @@ jobs:
matrix:
os: # see scipy wheels.yml GH actions
- [ubuntu-22.04, manylinux, x86_64]
- [macos-11, macosx, x86_64]
- [macos-12, macosx, x86_64]
# - [macos-12, macosx_*, arm64]
- [windows-2019, win, AMD64]

python: [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"]]
# python[0] is used to specify the python versions made by cibuildwheel
python:
[
["cp39", "3.9"],
["cp310", "3.10"],
["cp311", "3.11"],
["cp312", "3.12"],
]

env:
IS_32_BIT: ${{ matrix.os[2] == 'x86' }}
Expand Down Expand Up @@ -99,8 +94,14 @@ jobs:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
python: [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"]]
# python[0] is used to specify the python versions made by cibuildwheel
python:
[
["cp39", "3.9"],
["cp310", "3.10"],
["cp311", "3.11"],
["cp312", "3.12"],
]

steps:
- name: Checkout code
Expand Down Expand Up @@ -141,21 +142,40 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10" # update once build dependencies are available
python-version: "3.10"

- name: Build source distribution
run: |
pip install spin build
spin setup-submodule
pip install .[build]
python -m build
python -m build --sdist
- name: Store artifacts
uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
name: ${{ matrix.python[0] }}-${{ matrix.os[1] }}
path: dist

merge-wheels:
name: Merge all wheels into one directory
needs: [build_wheels, build-wheels-m1, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: all

- name: List all files
run: |
ls all/**
- name: Merge files
run: |
mkdir dist
mv all/**/*.whl ./dist
mv all/**/*.tar.gz ./dist
- uses: actions/upload-artifact@v4
with:
path: dist
name: ${{ matrix.python[0] }}-${{ matrix.os[1] }}
name: dist
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
build_and_test_slow:
name: Slow Meson build ${{ matrix.os }} - py${{ matrix.python-version }}
timeout-minutes: 20
# needs: [build_and_test]
needs: [build_and_test]
strategy:
fail-fast: false
matrix:
Expand Down
161 changes: 22 additions & 139 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,160 +7,43 @@ concurrency:
on:
release:
types: [published]
push:
branches:
- main
pull_request:
branches:
- main
workflow_run:
workflows: [Build_Wheels]
branches: [main]
types: [completed] # This ensures it triggers only after the workflow completes

permissions:
contents: read

env:
INSTALLDIR: "build-install"
CCACHE_DIR: "${{ github.workspace }}/.ccache"

jobs:
# release is ran when a release is made on Github
# Build the source distribution under Linux
build_sdist:
name: Source distribution
check_wheels:
runs-on: ubuntu-latest

steps:
- name: Checkout scikit-tree
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10" # update once build dependencies are available

- name: Build source distribution
run: |
pip install spin build
spin setup-submodule
pip install .[build]
python -m build
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz

build_wheels:
name: Build wheels on ${{ matrix.os[1] }} - ${{ matrix.os[2] }} with Python ${{ matrix.python[0] }}
runs-on: ${{ matrix.os[0] }}

strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
os: # see scipy wheels.yml GH actions
- [ubuntu-22.04, manylinux, x86_64]
- [macos-11, macosx, x86_64]
# - [macos-12, macosx_*, arm64]
- [windows-2019, win, AMD64]

python: [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"]]
# python[0] is used to specify the python versions made by cibuildwheel

env:
IS_32_BIT: ${{ matrix.os[2] == 'x86' }}

steps:
- name: Checkout scikit-tree
uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Setup submodule
- name: Get run ID of "Build_Wheels" workflow
id: get-run-id
run: |
python -m pip install --upgrade pip spin
python -m spin setup-submodule
- name: win_amd64 - install rtools
run: |
choco install rtools -y --no-progress --force --version=4.0.0.20220206
echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH
if: ${{ runner.os == 'Windows' && env.IS_32_BIT == 'false' }}

- name: Build wheels
uses: pypa/cibuildwheel@v2.19.1
# Build all wheels here, apart from macosx_arm64, linux_aarch64
# cibuildwheel is currently unable to pass configuration flags to
# CIBW_BUILD_FRONTEND https://github.com/pypa/cibuildwheel/issues/1227
# (pip/build). Cross compilation with meson requires an initial
# configuration step to create a build directory. The subsequent wheel
# build then needs to use that directory. This can be done with pip
# using a command like:
# pip wheel --config-settings builddir=build .
# if: >-
# ( ! contains(matrix.os[2], 'arm64' ) )
OTHER_REPO="${{ github.repository }}"
WF_NAME="Build_Wheels"
RUN_ID=`gh run --repo ${OTHER_REPO} list --workflow ${WF_NAME} --json databaseId --jq .[0].databaseId`
echo "Detected latest run id of ${RUN_ID} for workflow ${WF_NAME}"
echo "run-id=${RUN_ID}" >> "$GITHUB_OUTPUT"
env:
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.os[1] }}*
CIBW_ARCHS: ${{ matrix.os[2] }}
CIBW_ENVIRONMENT_PASS_LINUX: RUNNER_OS
GH_TOKEN: ${{ github.token }}

- name: Move wheels to dist
run: |
mkdir -p dist
mv ./wheelhouse/* dist/
- uses: actions/upload-artifact@v4
- name: Download artifact from "Build_Wheels" workflow
uses: actions/download-artifact@v4
with:
path: ./dist/
name: ${{ matrix.python[0] }}-${{ matrix.os[1] }}

build-wheels-m1:
name: Build wheels on Arm M1 with Python ${{ matrix.python[0] }}
runs-on: macos-latest
name: dist # Match name used in build_wheels.yml upload artifact step
github-token: ${{ github.token }}
repository: ${{ github.repository }}
run-id: ${{ steps.get-run-id.outputs.run-id }}

strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
python: [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"]]
# python[0] is used to specify the python versions made by cibuildwheel

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10" # Replace with the desired Python version

- name: Install cibuildwheel dependencies
run: |
pip install cibuildwheel
pip install spin
spin setup-submodule
pip install .[build]
- name: Build wheels
uses: pypa/cibuildwheel@v2.19.1
env:
CIBW_BUILD: ${{ matrix.python[0] }}-macosx_arm64
CIBW_ARCHS_MACOS: arm64

- name: Move wheels to dist
run: |
mkdir -p dist
mv ./wheelhouse/* dist/
- uses: actions/upload-artifact@v4
with:
path: ./dist/
name: ${{ matrix.python[0] }}-arm
- name: Show downloaded files
run: ls -la

# PyPI on release
pypi:
needs: [build_sdist, build_wheels, build-wheels-m1]
needs: [check_wheels]
runs-on: ubuntu-latest
if: github.event_name == 'release'
permissions:
Expand Down
11 changes: 8 additions & 3 deletions doc/_static/versions.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
[
{
"name": "0.8 (devel)",
"name": "0.9 (devel)",
"version": "dev",
"url": "https://docs.neurodata.io/scikit-tree/dev/"
},
{
"name": "0.7",
"version": "stable",
"name": "0.8",
"version": "dev",
"url": "https://docs.neurodata.io/scikit-tree/stable/"
},
{
"name": "0.7",
"version": "0.7",
"url": "https://docs.neurodata.io/scikit-tree/v0.7/"
},
{
"name": "0.6",
"version": "0.6",
Expand Down
7 changes: 5 additions & 2 deletions doc/whats_new/v0.8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
.. include:: _contributors.rst
.. currentmodule:: sktree

.. _current:
.. _v0_9:

Version 0.8
===========

**In Development**
This development fixes a major bug with (CO)MIGHT, where low sample sizes produce biased tree
posteriors, which is fixed by stratifying the sampling of the dataset to ensure that each class
is represented in the bootstrap sample. Additionally, the release includes a number of bug fixes
and improvements to the codebase.

Changelog
---------
Expand Down
25 changes: 25 additions & 0 deletions doc/whats_new/v0.9.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
:orphan:

.. include:: _contributors.rst
.. currentmodule:: sktree

.. _current:

Version 0.9
===========

**In Development**

Changelog
---------

-

Code and Documentation Contributors
-----------------------------------

Thanks to everyone who has contributed to the maintenance and improvement of
the project since version inception, including:

* `Adam Li`_

2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(
# Note that the git commit hash cannot be added dynamically here
# That only happens when importing from a git repository.
# See `sktree/__init__.py`
version: '0.8.0dev0',
version: '0.8.0',
license: 'BSD-3',
meson_version: '>= 1.1.0',
default_options: [
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ requires = [

[project]
name = "scikit-tree"
version = "0.8.0dev0"
version = "0.8.0"
description = "Modern decision trees in Python"
maintainers = [
{name = "Neurodata", email = "adam.li@columbia.edu"}
Expand Down
2 changes: 1 addition & 1 deletion sktree/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
import sys

__version__ = "0.8.0dev0"
__version__ = "0.8.0"
logger = logging.getLogger(__name__)


Expand Down
Loading

0 comments on commit 7ea563c

Please sign in to comment.