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

feat(deps): bump llvmlite and numba versions #1209

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
use flake
watch_file poetry.lock

watch_file uv.lock
watch_file nix/pyproject-overrides.nix
watch_file nix/overlay.nix
3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

262 changes: 126 additions & 136 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,159 +12,149 @@ concurrency:
cancel-in-progress: true

jobs:
nix:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
python-version:
- "39"
- "310"
- "311"
- "312"
include:
- os: macos-latest
python-version: "39"
- os: macos-latest
python-version: "312"

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30
with:
nix_path: nixpkgs=channel:nixos-unstable-small

- uses: cachix/cachix-action@v15
with:
name: numbsql
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: nix-community,poetry2nix

- name: build and test
run: nix build --no-link --keep-going '.#numbsql${{ matrix.python-version }}'

- name: show closure size
run: |
set -euo pipefail

nix path-info -Shr '.#numbsql${{ matrix.python-version }}' | sort -h -k2

conda:
# nix:
# strategy:
# fail-fast: false
# matrix:
# os:
# - ubuntu-latest
# python-version:
# - "310"
# - "311"
# - "312"
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v4
#
# - uses: cachix/install-nix-action@v30
# with:
# nix_path: nixpkgs=channel:nixos-unstable-small
#
# - uses: cachix/cachix-action@v15
# with:
# name: numbsql
# authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
# extraPullNames: nix-community
#
# - name: build
# run: nix build --no-link --keep-going '.#numbsql${{ matrix.python-version }}'
#
# - name: test
# run: nix build --no-link --keep-going '.#numbsql${{ matrix.python-version }}.passthru.tests.pytest'
#
# - name: show closure size
# run: |
# set -euo pipefail
#
# nix path-info -Shr '.#numbsql${{ matrix.python-version }}' | sort -h -k2
uv:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
# - ubuntu-latest
- windows-latest
spec:
- deps:
python-version: "3.9"
numba: "0.53"
llvmlite: "0.36"
- env:
NUMBA_CAPTURED_ERRORS: new_style
deps:
python-version: "3.10"
- env:
NUMBA_CAPTURED_ERRORS: new_style
deps:
python-version: "3.11"
- env:
NUMBA_CAPTURED_ERRORS: new_style
deps:
python-version: "3.12"
defaults:
run:
shell: bash -l {0}
- macos-latest
python-version:
# - "3.10"
# - "3.11"
- "3.12"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
id: install_python
with:
python-version: ${{ matrix.spec.deps.python-version }}
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v3

- run: pip3 install poetry2conda poetry
- name: show sqlite version
run: uv run python -c 'import sqlite3; print(sqlite3.sqlite_version)'

- run: poetry add --lock "numba@${{ matrix.spec.deps.numba }}" "llvmlite@${{ matrix.spec.deps.llvmlite }}" --python "${{ steps.install_python.outputs.python-version }}"
if: ${{ matrix.spec.deps.numba != null && matrix.spec.deps.llvmlite != null }}
- name: show C API libversion pre installation
run: uv run python -c 'from numbsql.sqlite import sqlite3_libversion; print(sqlite3_libversion().decode())'

- run: poetry2conda --dev pyproject.toml - | tee environment.yaml
- name: show library pre installation
if: matrix.os == 'windows-latest'
run: uv run python -c 'import ctypes.util as u; print(u.find_library("sqlite3"))'

- uses: conda-incubator/setup-miniconda@v3
with:
mamba-version: "*"
miniforge-variant: Mambaforge
miniforge-version: latest
channel-priority: strict
activate-environment: numbsql
python-version: ${{ matrix.spec.deps.python-version }}
environment-file: environment.yaml
- name: install sqlite on windows
if: matrix.os == 'windows-latest'
run: choco install sqlite

- run: pip install .
- name: show os sqlite version
run: sqlite3 -version

- run: pytest --numprocesses auto
env:
NUMBA_CAPTURED_ERRORS: ${{ matrix.spec.env.NUMBA_CAPTURED_ERRORS }}
- name: show sqlite3 path
shell: bash
run: which sqlite3

dry-run-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30
with:
nix_path: nixpkgs=channel:nixos-unstable-small

- uses: cachix/cachix-action@v15
with:
name: numbsql
extraPullNames: nix-community,poetry2nix

- name: setup git info
run: |
set -euo pipefail

git config user.name 'phillip-ground[bot]'
git config user.email 'phillip-ground[bot]@users.noreply.github.com'

- name: dry run semantic-release
run: ./ci/release/dry_run.sh
- name: show C API libversion post installation
run: uv run python -c 'from numbsql.sqlite import sqlite3_libversion; print(sqlite3_libversion().decode())'

release:
runs-on: ubuntu-latest
needs:
- conda
- dry-run-release
- nix
steps:
- uses: actions/[email protected]
id: generate_token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.generate_token.outputs.token }}

- uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30
with:
nix_path: nixpkgs=channel:nixos-unstable-small

- uses: cachix/cachix-action@v15
with:
name: numbsql
extraPullNames: nix-community,poetry2nix
- name: show library post installation
if: matrix.os == 'windows-latest'
run: uv run python -c 'import ctypes.util as u; print(u.find_library("sqlite3"))'

- name: run semantic-release
run: ./ci/release/run.sh
- name: run tests
run: uv run --group tests pytest -vv -x --randomly-dont-reorganize
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
NUMBA_CAPTURED_ERRORS: new_style

# dry-run-release:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
#
# - uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30
# with:
# nix_path: nixpkgs=channel:nixos-unstable-small
#
# - uses: cachix/cachix-action@v15
# with:
# name: numbsql
# extraPullNames: nix-community
#
# - name: setup git info
# run: |
# set -euo pipefail
#
# git config user.name 'phillip-ground[bot]'
# git config user.email 'phillip-ground[bot]@users.noreply.github.com'
#
# - name: dry run semantic-release
# run: ./ci/release/dry_run.sh

# release:
# runs-on: ubuntu-latest
# needs:
# - uv
# # - dry-run-release
# # - nix
# steps:
# - uses: actions/[email protected]
# id: generate_token
# with:
# app-id: ${{ secrets.APP_ID }}
# private-key: ${{ secrets.APP_PRIVATE_KEY }}
#
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# token: ${{ steps.generate_token.outputs.token }}
#
# - uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30
# with:
# nix_path: nixpkgs=channel:nixos-unstable-small
#
# - uses: cachix/cachix-action@v15
# with:
# name: numbsql
# extraPullNames: nix-community
#
# - name: run semantic-release
# run: ./ci/release/run.sh
# env:
# UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
# GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ integers might be unsafe, then you shouldn't use this library.

## Requirements

* Python `>=3.7`
* Python `>=3.9`
* `numba`
* `llvmlite`

Use `nix-shell` from the repository to avoid dependency hell.
Use `nix develop` from the repository root to avoid dependency hell.

## Installation

* `poetry install`
* `pip install numbsql`

## Examples

Expand Down
6 changes: 3 additions & 3 deletions ci/release/prepare.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/bin/env nix-shell
#!nix-shell -p cacert gnugrep unzip poetry nix -i bash
#!nix-shell -p cacert gnugrep unzip uv nix -i bash
# shellcheck shell=bash

set -euo pipefail

version="${1}"

# set version
poetry version "$version"
uvx --from=toml-cli toml set --toml-path=pyproject.toml project.version "$version"

# build artifacts
poetry build
uv build

# ensure that the built wheel has the correct version number
unzip -p "dist/numbsql-${version}-py3-none-any.whl" numbsql/__init__.py | grep -q "__version__ = \"$version\""
4 changes: 2 additions & 2 deletions ci/release/publish.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env nix-shell
#!nix-shell --pure --keep POETRY_PYPI_TOKEN_PYPI -p cacert poetry -i bash
#!nix-shell --pure --keep UV_PUBLISH_TOKEN -p cacert uv -i bash
# shellcheck shell=bash

set -euo pipefail

poetry publish
uv publish
2 changes: 1 addition & 1 deletion ci/release/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -p cacert poetry git nodejs nix -i bash
#!nix-shell -p cacert uv git nodejs nix -i bash
# shellcheck shell=bash

set -euo pipefail
Expand Down
8 changes: 4 additions & 4 deletions ci/release/verify.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=channel:nixos-unstable-small --pure --keep POETRY_PYPI_TOKEN_PYPI -p poetry -i bash
#!nix-shell -I nixpkgs=channel:nixos-unstable-small --pure --keep UV_PUBLISH_TOKEN -p uv -i bash
# shellcheck shell=bash

set -euo pipefail

dry_run="${1:-false}"

# verify pyproject.toml
poetry check
# verify pyproject.toml and lock file
uv lock --locked

# verify that we have a token available to push to pypi using set -u
if [ "${dry_run}" = "false" ]; then
: "${POETRY_PYPI_TOKEN_PYPI}"
: "${UV_PUBLISH_TOKEN}"
fi
Loading
Loading