Skip to content

Commit 52bca43

Browse files
authored
Release v0.1.3
--------- Signed-off-by: Adam Li <adam2392@gmail.com>
1 parent d03603f commit 52bca43

File tree

11 files changed

+156
-35
lines changed

11 files changed

+156
-35
lines changed

.github/workflows/build_wheels.yml

Lines changed: 78 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- "**.py"
77
- "**.pxd"
88
- "**.pyx"
9+
- "**"
910
push:
1011
branches: [main]
1112
workflow_dispatch:
@@ -77,29 +78,82 @@ jobs:
7778

7879
- uses: actions/upload-artifact@v3
7980
with:
80-
path: ./wheelhouse/*.whl
81+
path: ./wheelhouse/
8182
name: ${{ matrix.python[0] }}-${{ matrix.os[1] }}
8283

83-
# TODO: let's figure out how to build these wheels?
84-
# build_wheels_macos:
85-
# name: Build wheels on macos-11
86-
# runs-on: macos-11
87-
# steps:
88-
# - uses: actions/checkout@v3
89-
90-
# - uses: actions/setup-python@v4.6.1
91-
# with:
92-
# python-version: 3.9
93-
94-
# - name: macosx_arm64 - setup builddir
95-
# run: |
96-
# python -m pip wheel --config-settings builddir=build .
97-
98-
# - name: Build wheels
99-
# uses: pypa/cibuildwheel@v2.13.1
100-
# env:
101-
# CIBW_ARCHS_MACOS: arm64
102-
103-
# - uses: actions/upload-artifact@v3
104-
# with:
105-
# path: ./wheelhouse/*.whl
84+
build-wheels-m1:
85+
name: Build wheels on Arm M1 with Python ${{ matrix.python[0] }}
86+
runs-on: macos-latest
87+
88+
strategy:
89+
# Ensure that a wheel builder finishes even if another fails
90+
fail-fast: false
91+
matrix:
92+
python: [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"]]
93+
# python[0] is used to specify the python versions made by cibuildwheel
94+
95+
steps:
96+
- name: Checkout code
97+
uses: actions/checkout@v3
98+
99+
- name: Set up Python
100+
uses: actions/setup-python@v4.6.1
101+
with:
102+
python-version: 3.9 # Replace with the desired Python version
103+
104+
- name: Install cibuildwheel dependencies
105+
run: |
106+
python -m pip install cibuildwheel
107+
python -m pip install -r build_requirements.txt
108+
python -m pip install spin
109+
python spin setup-submodule
110+
111+
- name: Build wheels
112+
uses: pypa/cibuildwheel@v2.13.1
113+
env:
114+
CIBW_BUILD: ${{ matrix.python[0] }}-macosx_arm64
115+
CIBW_ARCHS_MACOS: arm64
116+
117+
- uses: actions/upload-artifact@v3
118+
with:
119+
path: ./wheelhouse
120+
name: ${{ matrix.python[0] }}-arm
121+
122+
# Build the source distribution under Linux
123+
build_sdist:
124+
name: Source distribution
125+
runs-on: ubuntu-latest
126+
127+
steps:
128+
- name: Checkout scikit-tree
129+
uses: actions/checkout@v3
130+
131+
- name: Setup Python
132+
uses: actions/setup-python@v4
133+
with:
134+
python-version: '3.9' # update once build dependencies are available
135+
136+
- name: Build source distribution
137+
run: |
138+
python -m pip install -r build_requirements.txt
139+
python -m pip install spin
140+
python spin setup-submodule
141+
python spin sdist
142+
# run: bash build_tools/github/build_source.sh
143+
# env:
144+
# SKLEARN_BUILD_PARALLEL: 3
145+
146+
# - name: Test source distribution
147+
# run: bash build_tools/github/test_source.sh
148+
# env:
149+
# SKLEARN_SKIP_NETWORK_TESTS: 1
150+
151+
- name: Store artifacts
152+
uses: actions/upload-artifact@v3
153+
with:
154+
path: dist/*.tar.gz
155+
156+
- uses: actions/upload-artifact@v3
157+
with:
158+
path: dist
159+
name: ${{ matrix.python[0] }}-${{ matrix.os[1] }}

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
fail-fast: false
3232
matrix:
3333
os: [ubuntu-22.04, macos-latest]
34-
python-version: [3.8, 3.9, "3.10"]
34+
python-version: [3.9, "3.10", "3.11"]
3535
poetry-version: [1.3.0]
3636
runs-on: ${{ matrix.os }}
3737
defaults:
@@ -171,7 +171,9 @@ jobs:
171171
- name: pip-packages
172172
run: |
173173
pip install -r build_requirements.txt
174+
pip install -r test_requirements.txt
174175
pip install spin
176+
pip install numpy==1.22.4
175177
176178
- name: openblas-libs
177179
# shell: bash

.github/workflows/style.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ jobs:
3232
steps:
3333
- name: Checkout repository
3434
uses: actions/checkout@v3
35-
- name: Setup Python 3.9
35+
- name: Setup Python 3.10
3636
uses: actions/setup-python@v4.6.1
3737
with:
38-
python-version: "3.9"
38+
python-version: "3.10"
3939
architecture: "x64"
4040

4141
- name: Install packages for Ubuntu

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[submodule "sktree/_lib/sklearn"]
22
path = sktree/_lib/sklearn_fork
33
url = https://github.com/neurodata/scikit-learn
4-
branch = submodulev2
4+
branch = v1.3

.spin/cmds.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,9 @@ def build(ctx, meson_args, jobs=None, clean=False, forcesubmodule=False, verbose
160160

161161
# run build as normal
162162
ctx.invoke(meson.build, meson_args=meson_args, jobs=jobs, clean=clean, verbose=verbose)
163+
164+
165+
@click.command()
166+
def sdist():
167+
"""📦 Build a source distribution in `dist/`"""
168+
util.run(["python", "-m", "build", ".", "--sdist"])

DEVELOPING.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,23 @@ In order for any code to be added to the repository, we require unit tests to pa
5757
The general design of scikit-tree follows that of the tree-models inside scikit-learn, where tree-based models are inherently Cythonized, or written with C++. Then the actual forest (e.g. RandomForest, or ExtraForest) is just a Python API wrapper that creates an ensemble of the trees.
5858

5959
In order to develop new tree models, generally Cython and C++ code will need to be written in order to optimize the tree building process, otherwise fitting a single forest model would take very long.
60+
61+
# Making a Release
62+
63+
Scikit-tree is in-line with scikit-learn and thus relies on each new version released there. Moreover, scikit-tree relies on compiled code, so releases are a bit more complex than the typical Python package.
64+
65+
1. Download wheels from GH Actions and put all wheels into a ``dist/`` folder
66+
67+
https://github.com/neurodata/scikit-tree/actions/workflows/build_wheels.yml will have all the wheels for common OSes built for each Python version.
68+
69+
2. Upload wheels to test PyPi
70+
71+
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
72+
73+
Verify that installations work as expected on your machine.
74+
75+
3. Upload wheels
76+
77+
twine upload dist/*
78+
79+
4. Update version number on ``meson.build`` and ``_version.py`` to the relevant version.

build_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ rich-click
99
doit
1010
pydevtool
1111
spin
12+
build

examples/overlapping_gaussians.png

380 Bytes
Loading

meson.build

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ project(
44
# Note that the git commit hash cannot be added dynamically here
55
# That only happens when importing from a git repository.
66
# See `sktree/__init__.py`
7-
version: '0.0.0.dev0',
7+
version: '0.1.3',
88
license: 'BSD-3',
99
meson_version: '>= 0.64.0',
1010
default_options: [
@@ -45,7 +45,8 @@ if not cython.found()
4545
error('MESON_BUILD_FAILED: Cython3 not found. Please install it.')
4646
endif
4747

48-
run_command('git', 'submodule', 'update', '--init', check: true)
48+
# r = run_command('git', 'submodule', 'update', '--init', check: false)
49+
r = run_command('mv', 'sktree/_lib/sklearn_fork/sklearn', 'sktree/_lib/sklearn', check: false)
4950

5051
# Setup Python:
5152
# https://mesonbuild.com/Python-module.html
@@ -62,8 +63,8 @@ py3 = py3_mod.find_installation(
6263
# print some debugging output
6364
message(py3.full_path())
6465
message(py3.get_install_dir())
65-
if py3.language_version().version_compare('<3.8')
66-
error('At least Python 3.8 is required.')
66+
if py3.language_version().version_compare('<3.9')
67+
error('At least Python 3.9 is required.')
6768
endif
6869
py3_dep = py3.dependency()
6970

pyproject.toml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
1+
[project]
2+
name = "sktree"
3+
#
4+
# 0.0.0 is standard placeholder for poetry-dynamic-versioning
5+
# any changes to this should not be checked in
6+
#
7+
version = "0.1.3"
8+
description = "Modern decision trees in Python"
9+
maintainers = [
10+
{name="Neurodata", email="adam.li@columbia.edu"}
11+
]
12+
documentation = "https://scikit-tree.neurodata.io"
13+
repository = "https://github.com/neurodata/scikit-tree"
14+
readme = "README.md"
15+
requires-python = ">=3.9"
16+
classifiers = [
17+
'Development Status :: 4 - Beta',
18+
"Intended Audience :: Science/Research",
19+
"Intended Audience :: Developers",
20+
"License :: OSI Approved :: BSD License",
21+
"Programming Language :: C",
22+
"Programming Language :: Python",
23+
"Programming Language :: Python :: 3",
24+
'Programming Language :: Python :: 3.9',
25+
'Programming Language :: Python :: 3.10',
26+
'Programming Language :: Python :: 3.11',
27+
"Topic :: Scientific/Engineering",
28+
"Operating System :: Microsoft :: Windows",
29+
"Operating System :: POSIX :: Linux",
30+
"Operating System :: POSIX",
31+
"Operating System :: Unix",
32+
"Operating System :: MacOS",
33+
]
34+
keywords = ['tree', 'oblique trees', 'manifold-learning', 'scikit-learn']
35+
include = [
36+
{ path = "meson.build", format = "sdist" },
37+
]
38+
139
[tool.poetry]
240
name = "sktree"
341
#
@@ -13,8 +51,6 @@ repository = "https://github.com/neurodata/scikit-tree"
1351
readme = "README.md"
1452
classifiers = [
1553
'Development Status :: 4 - Beta',
16-
'License :: OSI Approved :: BSD-3 License',
17-
'Programming Language :: Python :: 3.8',
1854
'Programming Language :: Python :: 3.9',
1955
'Programming Language :: Python :: 3.10',
2056
'Programming Language :: Python :: 3.11',
@@ -216,6 +252,7 @@ Build = [
216252
# "spin.cmds.meson.build",
217253
".spin/cmds.py:build",
218254
".spin/cmds.py:setup_submodule",
255+
".spin/cmds.py:sdist",
219256
"spin.cmds.meson.test",
220257
]
221258
Environments = [

0 commit comments

Comments
 (0)