diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ab508c9..4869dc2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,12 +30,12 @@ jobs: - name: Setup Cachix uses: cachix/cachix-action@v10 with: - name: slumba + name: numbsql authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} extraPullNames: nix-community - name: Build package and run tests - run: cachix watch-exec slumba nix-build -- --argstr python python${{ matrix.python-version }} --keep-going + run: cachix watch-exec numbsql nix-build -- --argstr python python${{ matrix.python-version }} --keep-going conda: strategy: fail-fast: false @@ -75,7 +75,7 @@ jobs: miniforge-variant: Mambaforge miniforge-version: latest channel-priority: strict - activate-environment: slumba + activate-environment: numbsql python-version: ${{ matrix.python-version }} environment-file: environment.yaml diff --git a/README.md b/README.md index 7cacf53c..ee113fb5 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ These are almost the same as decorating a Python function with `numba.jit`. ```python from typing import Optional -from slumba import sqlite_udf +from numbsql import sqlite_udf @sqlite_udf @@ -44,9 +44,9 @@ def add_one(x: Optional[int]) -> Optional[int]: ### Aggregate Functions These follow the API of the Python standard library's -`sqlite3.Connection.create_aggregate` method. The difference with slumba +`sqlite3.Connection.create_aggregate` method. The difference with numbsql aggregates is that they require two decorators: `numba.experimental.jit_class` and -`slumba.sqlite_udaf`. Let's define the `avg` (arithmetic mean) function for +`numbsql.sqlite_udaf`. Let's define the `avg` (arithmetic mean) function for 64-bit floating point numbers. ```python @@ -54,7 +54,7 @@ from typing import Optional from numba.experimental import jitclass -from slumba import sqlite_udaf +from numbsql import sqlite_udaf @sqlite_udaf @@ -87,7 +87,7 @@ from typing import Optional from numba.experimental import jitclass -from slumba import sqlite_udaf +from numbsql import sqlite_udaf @sqlite_udaf @@ -126,7 +126,7 @@ Similar to scalar functions, we register the function with a `sqlite3.Connection ```python >>> import sqlite3 ->>> from slumba import create_aggregate, create_function +>>> from numbsql import create_aggregate, create_function >>> con = sqlite3.connect(":memory:") >>> create_function(con, "add_one", 1, add_one) >>> con.execute("SELECT add_one(1)").fetchall() diff --git a/default.nix b/default.nix index 741d5976..c98e406a 100644 --- a/default.nix +++ b/default.nix @@ -32,11 +32,8 @@ let pytest --benchmark-disable --numprocesses=$(min $(nproc) 8) runHook postCheck ''; - # pytestCheckHook fails due to colliding versions of pytest and its - # transitive dependencies - pytestFlags = [ "--benchmark-disable" ]; - pythonImportsCheck = [ "slumba" ]; + pythonImportsCheck = [ "numbsql" ]; }; in pkgs.callPackage drv { diff --git a/examples/aggregate.py b/examples/aggregate.py index f362c1ff..58e1c198 100644 --- a/examples/aggregate.py +++ b/examples/aggregate.py @@ -8,7 +8,7 @@ from numba.experimental import jitclass from numba.types import ClassType -from slumba import create_aggregate, sqlite_udaf +from numbsql import create_aggregate, sqlite_udaf @sqlite_udaf diff --git a/examples/scalar.py b/examples/scalar.py index 09b410eb..1009b0b2 100644 --- a/examples/scalar.py +++ b/examples/scalar.py @@ -4,7 +4,7 @@ from math import exp, pi, sqrt from typing import List, Optional, Tuple -from slumba import create_function, sqlite_udf +from numbsql import create_function, sqlite_udf @sqlite_udf # type: ignore[misc] diff --git a/notebooks/sqlite-window.ipynb b/notebooks/sqlite-window.ipynb index 879e0092..40c794ab 100644 --- a/notebooks/sqlite-window.ipynb +++ b/notebooks/sqlite-window.ipynb @@ -14,7 +14,7 @@ "from typing import Optional\n", "\n", "from numba.experimental import jitclass\n", - "from slumba import sqlite_udaf, create_aggregate" + "from numbsql import sqlite_udaf, create_aggregate" ] }, { diff --git a/slumba/__init__.py b/numbsql/__init__.py similarity index 98% rename from slumba/__init__.py rename to numbsql/__init__.py index b1528772..bd1ecf23 100644 --- a/slumba/__init__.py +++ b/numbsql/__init__.py @@ -73,13 +73,13 @@ def create_function( Examples -------- >>> import sqlite3 - >>> from slumba import sqlite_udf + >>> from numbsql import sqlite_udf >>> from typing import Optional >>> @sqlite_udf ... def add_one(value: Optional[int]) -> Optional[int]: ... return value + 1 if value is not None else None ... - >>> from slumba import create_aggregate, create_function + >>> from numbsql import create_aggregate, create_function >>> con = sqlite3.connect(":memory:") >>> create_function(con, "add_one", 1, add_one) >>> con.execute("SELECT add_one(1)").fetchall() diff --git a/slumba/aggregate.py b/numbsql/aggregate.py similarity index 100% rename from slumba/aggregate.py rename to numbsql/aggregate.py diff --git a/slumba/exceptions.py b/numbsql/exceptions.py similarity index 100% rename from slumba/exceptions.py rename to numbsql/exceptions.py diff --git a/slumba/numbaext.py b/numbsql/numbaext.py similarity index 100% rename from slumba/numbaext.py rename to numbsql/numbaext.py diff --git a/slumba/scalar.py b/numbsql/scalar.py similarity index 98% rename from slumba/scalar.py rename to numbsql/scalar.py index 7163ae07..8130a6cf 100644 --- a/slumba/scalar.py +++ b/numbsql/scalar.py @@ -30,7 +30,7 @@ def sqlite_udf( Examples -------- >>> import sqlite3 - >>> from slumba import sqlite_udf + >>> from numbsql import sqlite_udf >>> from typing import Optional >>> @sqlite_udf ... def add_one(value: Optional[int]) -> Optional[int]: diff --git a/slumba/sqlite.py b/numbsql/sqlite.py similarity index 100% rename from slumba/sqlite.py rename to numbsql/sqlite.py diff --git a/slumba/tests/conftest.py b/numbsql/tests/conftest.py similarity index 100% rename from slumba/tests/conftest.py rename to numbsql/tests/conftest.py diff --git a/slumba/tests/test_aggregate.py b/numbsql/tests/test_aggregate.py similarity index 98% rename from slumba/tests/test_aggregate.py rename to numbsql/tests/test_aggregate.py index 57e5a403..5bd42412 100644 --- a/slumba/tests/test_aggregate.py +++ b/numbsql/tests/test_aggregate.py @@ -10,9 +10,9 @@ from testbook import testbook from testbook.client import TestbookNotebookClient -from slumba import create_aggregate, sqlite_udaf -from slumba.exceptions import UnsupportedAggregateTypeError -from slumba.sqlite import SQLITE_VERSION +from numbsql import create_aggregate, sqlite_udaf +from numbsql.exceptions import UnsupportedAggregateTypeError +from numbsql.sqlite import SQLITE_VERSION @sqlite_udaf diff --git a/slumba/tests/test_numbaext.py b/numbsql/tests/test_numbaext.py similarity index 92% rename from slumba/tests/test_numbaext.py rename to numbsql/tests/test_numbaext.py index f42ec93c..fd312aa0 100644 --- a/slumba/tests/test_numbaext.py +++ b/numbsql/tests/test_numbaext.py @@ -1,7 +1,7 @@ import pytest from numba import TypingError, boolean, int64, njit -from slumba.numbaext import is_not_null_pointer, sizeof, unsafe_cast +from numbsql.numbaext import is_not_null_pointer, sizeof, unsafe_cast def test_sizeof_invalid() -> None: diff --git a/slumba/tests/test_scalar.py b/numbsql/tests/test_scalar.py similarity index 99% rename from slumba/tests/test_scalar.py rename to numbsql/tests/test_scalar.py index 20372eaf..cab2d9b5 100644 --- a/slumba/tests/test_scalar.py +++ b/numbsql/tests/test_scalar.py @@ -4,7 +4,7 @@ import pytest from pytest_benchmark.fixture import BenchmarkFixture -from slumba import create_function, sqlite_udf +from numbsql import create_function, sqlite_udf def add_one_python(x: float) -> float: diff --git a/pyproject.toml b/pyproject.toml index 5409915f..9345bb0e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [tool.poetry] -name = "slumba" -packages = [{ include = "slumba" }] -homepage = "https://github.com/cpcloud/slumba" -repository = "https://github.com/cpcloud/slumba" +name = "numbsql" +packages = [{ include = "numbsql" }] +homepage = "https://github.com/cpcloud/numbsql" +repository = "https://github.com/cpcloud/numbsql" version = "3.1.0" description = "JITted SQLite user-defined functions and aggregates" readme = "README.md" @@ -51,14 +51,14 @@ addopts = [ norecursedirs = ["site-packages", "dist-packages"] [tool.poetry2conda] -name = "slumba" +name = "numbsql" [tool.poetry2conda.dependencies] pytest-randomly = { channel = "pip" } [tool.semantic_release] version_toml = "pyproject.toml:tool.poetry.version" -version_variable = "slumba/__init__.py:__version__" +version_variable = "numbsql/__init__.py:__version__" branch = "master" upload_to_pypi = true upload_to_release = true @@ -76,7 +76,7 @@ profile = "black" [tool.pydocstyle] convention = "numpy" add_ignore = ["D105", "D213", "D203"] -match-dir = "slumba" +match-dir = "numbsql" [build-system] requires = ["poetry>=0.12"] diff --git a/shell.nix b/shell.nix index 1cdd0ce5..fcf88235 100644 --- a/shell.nix +++ b/shell.nix @@ -14,7 +14,7 @@ let } ); editablePackageSources = { - slumba = ./slumba; + numbsql = ./numbsql; }; }; shellHook = '' @@ -28,12 +28,14 @@ let poetry prettier sqlite + cachix + commitizen ]; pythonVersions = [ "3.7" "3.8" "3.9" ]; in { dev = pkgs.mkShell { - name = "slumba-build"; + name = "numbsql-build"; inherit shellHook; buildInputs = commonBuildInputs; }; @@ -42,7 +44,7 @@ in (name: { inherit name; value = pkgs.mkShell { - name = "slumba-${name}"; + name = "numbsql-${name}"; inherit shellHook; PYTHONPATH = builtins.toPath ./.; buildInputs = commonBuildInputs ++ [