Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to use the latest C++ libraries via pybind11. #29

Merged
merged 29 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
37d441f
Begin hauling ass to update to the latest C++ libraries.
LTLA Dec 11, 2024
8b24ff5
Continue the grind of getting the damn thing to install.
LTLA Dec 11, 2024
3dbd44d
Continue grinding.
LTLA Dec 11, 2024
ae2d0c8
Get even closer to finishing the grind.
LTLA Dec 11, 2024
6cb69b2
Bring the classifier back online.
LTLA Dec 11, 2024
be176fa
Got all the C++ code compiling again.
LTLA Dec 12, 2024
24de82a
Fixed up the Python code in preparation for the finishing touch tomor…
LTLA Dec 12, 2024
957ca88
Bring the integrated functions back online.
LTLA Dec 12, 2024
d232849
Use the latest match() that allows a variable dtype.
LTLA Dec 12, 2024
32d336e
Got the annotate_single wrapper working again.
LTLA Dec 12, 2024
8b53728
Bring the annotated_integrated checks back online.
LTLA Dec 12, 2024
990a2fa
Bumped the required version of mattress.
LTLA Dec 12, 2024
3365a3b
Updated the README.
LTLA Dec 12, 2024
c1bd77b
Cleaned up docstring for proper API generation.
LTLA Dec 13, 2024
6f5fd77
Remove duplicated row names from the reference before marker detection.
LTLA Dec 13, 2024
ff7035d
chore: remove Python 3.8 support (#28)
jkanche Dec 13, 2024
462b05d
Added deprecation warnings for passing row/column data names.
LTLA Dec 13, 2024
bdbb9a8
Got the tests to pass, more or less.
LTLA Dec 13, 2024
dec4971
Got more tests to pass.
LTLA Dec 13, 2024
4880cf4
Skip 3.13 builds for now as dolomite doesn't want to build.
LTLA Dec 13, 2024
386d4b1
Remove unnecessary mattress instruction in the install_requires.
LTLA Dec 13, 2024
d55db15
Switch to the latest mattress.
LTLA Dec 13, 2024
60b7fd1
Updated to use the latest knncolle.
LTLA Dec 13, 2024
a6017bf
Turned out that we do, in fact, need mattress for the installatino.
LTLA Dec 13, 2024
7db0485
Updated CHANGELOG.
LTLA Dec 13, 2024
6d75123
Cache gypsum assets to avoid re-pinging the API.
LTLA Dec 14, 2024
1ff1d7e
Update the ini file.
LTLA Dec 14, 2024
3a9204f
Finally get this thing to work.
LTLA Dec 14, 2024
64aeafc
Check that the correct test dataset is being used for each trained re…
LTLA Dec 14, 2024
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
28 changes: 11 additions & 17 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,23 @@ name: Build documentation

on:
push:
branches:
- master
tags:
- "*"

jobs:
test:
name: Build docs
build_docs:
name: Build docs
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v2
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.12
cache: 'pip'

- name: Set up ccache
uses: hendrikmuhs/[email protected]

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip setuptools
Expand All @@ -32,17 +27,16 @@ jobs:
DOCDEPENDENCIES=$(python -c 'with open("docs/requirements.txt") as a: available = list(a); print(" ".join(map(lambda x : x.strip(), filter(lambda x : not x.startswith("#"), available))))')
pip install ${DOCDEPENDENCIES}

# Note that doc building requires the inplace shared library.
- name: Build docs
run: |
CC="ccache gcc" python setup.py build_ext --inplace
touch src/singler/lib_singler.py
sphinx-build --color -b html -d docs/doctrees docs docs/_build/html
touch ./docs/_build/html/.nojekyll

- name: GH Pages Deployment
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: JamesIves/github-pages-deploy-action@4.1.3
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: ./docs/_build/html
clean: true # Automatically remove deleted files from the deploy branch
clean: true # Automatically remove deleted files from the deploy branch
146 changes: 146 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: Publish to PyPI

on:
push:
tags:
- "*"

jobs:
build_linux_x86_64:
name: Build wheels for linux x86_64
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS: x86_64
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9"
CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/artifactdb/prebuilt-hdf5/manylinux_x86_64:0.0.4
CIBW_MUSLLINUX_X86_64_IMAGE: ghcr.io/artifactdb/prebuilt-hdf5/musllinux_x86_64:0.0.4
CIBW_SKIP: pp*

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-ubuntu-x86_64
path: ./wheelhouse/*.whl

build_macosx_x86_64:
name: Build wheels for macosx x86_64
runs-on: macos-13
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Grab prebuilt dependencies
run: |
curl -L https://github.com/ArtifactDB/prebuilt-hdf5/releases/download/0.0.4/macosx_x86_64.tar.gz > bundle.tar.gz
tar -xvf bundle.tar.gz

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS: x86_64
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9"
CIBW_ENVIRONMENT: "MORE_CMAKE_OPTIONS=\"-DCMAKE_INSTALL_PREFIX=$(pwd)/installed -DCMAKE_OSX_ARCHITECTURES=x86_64\""
CIBW_BUILD_VERBOSITY: 3
CIBW_SKIP: pp*
MACOSX_DEPLOYMENT_TARGET: 11.7

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-macos-x86_64
path: ./wheelhouse/*.whl

build_macosx_arm64:
name: Build wheels for macosx arm64
runs-on: macos-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Grab prebuilt dependencies
run: |
curl -L https://github.com/ArtifactDB/prebuilt-hdf5/releases/download/0.0.4-manual/macosx_arm64.tar.gz > bundle.tar.gz
tar -xvf bundle.tar.gz

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS: arm64
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9"
CIBW_ENVIRONMENT: "MORE_CMAKE_OPTIONS=\"-DCMAKE_INSTALL_PREFIX=$(pwd)/installed -DCMAKE_OSX_ARCHITECTURES=arm64\""
CIBW_BUILD_VERBOSITY: 3
MACOSX_DEPLOYMENT_TARGET: 13.0

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-maxos_arm64
path: ./wheelhouse/*.whl

# build_windows_x86_64:
# name: Build wheels for windows x86_64
# runs-on: windows-2019
# steps:
# - name: Check out repository
# uses: actions/checkout@v4
#
# - name: Grab prebuilt dependencies
# run: |
# curl -L https://github.com/ArtifactDB/prebuilt-hdf5/releases/download/0.0.4/windows_x86_64.tar.gz > bundle.tar.gz
# tar -xvf bundle.tar.gz
# shell: bash
#
# - name: Store path
# run: |
# $wd = pwd
# echo "INSTALL_DIR=$wd\\installed" >> $env:GITHUB_ENV
# shell: powershell
#
# - name: Build wheels
# uses: pypa/[email protected]
# env:
# CIBW_ARCHS: AMD64
# CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9"
# CIBW_ENVIRONMENT: "MORE_CMAKE_OPTIONS=\"-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}\" VERBOSE=1"
# CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
# CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}"
# CIBW_TEST_EXTRAS: "testing"
# CIBW_TEST_COMMAND: "pytest {package}/tests"
# CIBW_BUILD_VERBOSITY: 3
# - uses: actions/upload-artifact@v3
# with:
# path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

upload_pypi:
needs: [build_linux_x86_64, build_macosx_x86_64, build_macosx_arm64, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true

- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
111 changes: 22 additions & 89 deletions .github/workflows/pypi-test.yml
Original file line number Diff line number Diff line change
@@ -1,111 +1,44 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Test the library

on:
push:
branches:
- master
tags:
- "*"
pull_request:

jobs:
test:
name: Running tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]

name: Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
submodules: true
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Specify gypsum cache
run: |
LOCATION=$(pwd)/.gypsum_cache
mkdir -p ${LOCATION} # TODO: move to gypsum_client
echo "GYPSUM_CACHE_DIR=${LOCATION}" >> $GITHUB_ENV

- name: Set up Python 3.9
uses: actions/setup-python@v2
- name: Cache gypsum assets
uses: actions/cache@v4
with:
python-version: 3.9
cache: 'pip'
path: ${{ env.GYPSUM_CACHE_DIR }}
key: gypsum-cache

- name: Install python dependencies
run: |
python -m pip install --upgrade pip setuptools
DEPENDENCIES=$(python -c 'from setuptools.config.setupcfg import read_configuration as c; a = c("setup.cfg"); print(" ".join(a["options"]["install_requires"][1:] + a["options"]["extras_require"]["testing"][1:]))')
pip install ${DEPENDENCIES}
- name: Get latest CMake
uses: lukka/get-cmake@latest

# We do proper tests if we're on the master branch, or if we're creating a new release.
- name: Test with tox
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
run: |
pip install tox
tox

# Otherwise, in a PR, we don't need the full clean test.
- name: Set up ccache
if: github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/tags')
uses: hendrikmuhs/[email protected]

- name: Quickly build and test
if: github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/tags')
run: |
CC="ccache gcc" python setup.py install
pytest

build_wheels:
name: Build wheels on ${{ matrix.os }}
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-11] # at some point get this to work on windows-2019

steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_ARCHS_LINUX: x86_64 # remove this later so we build for all linux archs
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9"
CIBW_SKIP: pp*
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

upload_pypi:
needs: [test, build_wheels, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
name: artifact
path: dist

- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
29 changes: 15 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ exclude: '^docs/conf.py'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
Expand All @@ -17,26 +17,27 @@ repos:
- id: mixed-line-ending
args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows

- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
hooks:
- id: docformatter
additional_dependencies: [tomli]
args: [--in-place, --wrap-descriptions=120, --wrap-summaries=120]
# --config, ./pyproject.toml
# - repo: https://github.com/PyCQA/docformatter
# rev: master
# hooks:
# - id: docformatter
# additional_dependencies: [tomli]
# args: [--in-place, --wrap-descriptions=120, --wrap-summaries=120]
# # --config, ./pyproject.toml

- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
language_version: python3
# - repo: https://github.com/psf/black
# rev: 24.8.0
# hooks:
# - id: black
# language_version: python3

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.287
rev: v0.6.8
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

## If like to embrace black styles even in the docs:
# - repo: https://github.com/asottile/blacken-docs
Expand Down
Loading
Loading