Skip to content
Merged
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
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ concurrency:
cancel-in-progress: true

env:
PYTHON_VERSION: '3.13.14'
PYTHON_VERSION: '3.14.6'
CIBW_VERSION: '3.4.1'
CIBW_BUILD: 'cp313-* cp313t-*'
CIBW_ENABLE: 'cpython-freethreading'
CIBW_BUILD: 'cp314-* cp314t-*'
CIBW_SKIP: '*-musllinux_*'
CIBW_BUILD_VERBOSITY: 1
CIBW_BUILD_FRONTEND: 'build[uv]'
CIBW_TEST_COMMAND: 'python {project}/tests/test_rsqlite.py'
SQLITE_VERSION: '3.46.1'

jobs:
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
- name: Upload macOS wheels
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: wheel-macos-${{ matrix.os.arch }}-cp313-cp313t
name: wheel-macos-${{ matrix.os.arch }}-cp314-cp314t
path: dist/*.whl

build_wheels_linux:
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
- name: Upload Linux wheel
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: wheel-linux-${{ matrix.arch.name }}-cp313-cp313t
name: wheel-linux-${{ matrix.arch.name }}-cp314-cp314t
path: dist/*.whl

build_wheels_windows:
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
- name: Upload Windows wheel
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: wheel-windows-cp313-cp313t
name: wheel-windows-cp314-cp314t
path: dist/*.whl

build_sdist:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# rsqlite3

A Python 3.13 SQLite3 extension module with static SQLite build support.
A Python 3.14 SQLite3 extension module with static SQLite build support.

The release workflow builds wheels for both standard (`cp313`) and
free-threaded (`cp313t`) Python 3.13 interpreters.
The release workflow builds wheels for both standard (`cp314`) and
free-threaded (`cp314t`) Python 3.14 interpreters.

## Building

Expand Down
28 changes: 18 additions & 10 deletions _sqlite/blob.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include "clinic/blob.c.h"
#undef clinic_state

#define _pysqlite_Blob_CAST(op) ((pysqlite_Blob *)(op))

/*[clinic input]
module _sqlite3
class _sqlite3.Blob "pysqlite_Blob *" "clinic_state()->BlobType"
Expand All @@ -30,30 +32,33 @@ close_blob(pysqlite_Blob *self)
}

static int
blob_traverse(pysqlite_Blob *self, visitproc visit, void *arg)
blob_traverse(PyObject *op, visitproc visit, void *arg)
{
pysqlite_Blob *self = _pysqlite_Blob_CAST(op);
Py_VISIT(Py_TYPE(self));
Py_VISIT(self->connection);
return 0;
}

static int
blob_clear(pysqlite_Blob *self)
blob_clear(PyObject *op)
{
pysqlite_Blob *self = _pysqlite_Blob_CAST(op);
Py_CLEAR(self->connection);
return 0;
}

static void
blob_dealloc(pysqlite_Blob *self)
blob_dealloc(PyObject *op)
{
pysqlite_Blob *self = _pysqlite_Blob_CAST(op);
PyTypeObject *tp = Py_TYPE(self);
PyObject_GC_UnTrack(self);

close_blob(self);

FT_CLEAR_WEAKREFS((PyObject*)self, self->in_weakreflist);
tp->tp_clear((PyObject *)self);
FT_CLEAR_WEAKREFS(op, self->in_weakreflist);
(void)tp->tp_clear(op);
tp->tp_free(self);
Py_DECREF(tp);
}
Expand Down Expand Up @@ -98,7 +103,7 @@ blob_close_impl(pysqlite_Blob *self)
void
pysqlite_close_all_blobs(pysqlite_Connection *self)
{
for (int i = 0; i < PyList_GET_SIZE(self->blobs); i++) {
for (Py_ssize_t i = 0; i < PyList_GET_SIZE(self->blobs); i++) {
PyObject *weakref = PyList_GET_ITEM(self->blobs, i);
PyObject *blob;
if (!PyWeakref_GetRef(weakref, &blob)) {
Expand All @@ -113,7 +118,7 @@ static void
blob_seterror(pysqlite_Blob *self, int rc)
{
assert(self->connection != NULL);
_pysqlite_seterror(self->connection->state, self->connection->db);
set_error_from_db(self->connection->state, self->connection->db);
}

static PyObject *
Expand Down Expand Up @@ -373,8 +378,9 @@ blob_exit_impl(pysqlite_Blob *self, PyObject *type, PyObject *val,
}

static Py_ssize_t
blob_length(pysqlite_Blob *self)
blob_length(PyObject *op)
{
pysqlite_Blob *self = _pysqlite_Blob_CAST(op);
if (!check_blob(self)) {
return -1;
}
Expand Down Expand Up @@ -453,8 +459,9 @@ subscript_slice(pysqlite_Blob *self, PyObject *item)
}

static PyObject *
blob_subscript(pysqlite_Blob *self, PyObject *item)
blob_subscript(PyObject *op, PyObject *item)
{
pysqlite_Blob *self = _pysqlite_Blob_CAST(op);
if (!check_blob(self)) {
return NULL;
}
Expand Down Expand Up @@ -554,8 +561,9 @@ ass_subscript_slice(pysqlite_Blob *self, PyObject *item, PyObject *value)
}

static int
blob_ass_subscript(pysqlite_Blob *self, PyObject *item, PyObject *value)
blob_ass_subscript(PyObject *op, PyObject *item, PyObject *value)
{
pysqlite_Blob *self = _pysqlite_Blob_CAST(op);
if (!check_blob(self)) {
return -1;
}
Expand Down
30 changes: 15 additions & 15 deletions _sqlite/clinic/blob.c.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ static PyObject *
blob_close_impl(pysqlite_Blob *self);

static PyObject *
blob_close(pysqlite_Blob *self, PyObject *Py_UNUSED(ignored))
blob_close(PyObject *self, PyObject *Py_UNUSED(ignored))
{
return blob_close_impl(self);
return blob_close_impl((pysqlite_Blob *)self);
}

PyDoc_STRVAR(blob_read__doc__,
Expand All @@ -42,7 +42,7 @@ static PyObject *
blob_read_impl(pysqlite_Blob *self, int length);

static PyObject *
blob_read(pysqlite_Blob *self, PyObject *const *args, Py_ssize_t nargs)
blob_read(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
{
PyObject *return_value = NULL;
int length = -1;
Expand All @@ -58,7 +58,7 @@ blob_read(pysqlite_Blob *self, PyObject *const *args, Py_ssize_t nargs)
goto exit;
}
skip_optional:
return_value = blob_read_impl(self, length);
return_value = blob_read_impl((pysqlite_Blob *)self, length);

exit:
return return_value;
Expand All @@ -80,15 +80,15 @@ static PyObject *
blob_write_impl(pysqlite_Blob *self, Py_buffer *data);

static PyObject *
blob_write(pysqlite_Blob *self, PyObject *arg)
blob_write(PyObject *self, PyObject *arg)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};

if (PyObject_GetBuffer(arg, &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
return_value = blob_write_impl(self, &data);
return_value = blob_write_impl((pysqlite_Blob *)self, &data);

exit:
/* Cleanup for data */
Expand Down Expand Up @@ -117,7 +117,7 @@ static PyObject *
blob_seek_impl(pysqlite_Blob *self, int offset, int origin);

static PyObject *
blob_seek(pysqlite_Blob *self, PyObject *const *args, Py_ssize_t nargs)
blob_seek(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
{
PyObject *return_value = NULL;
int offset;
Expand All @@ -138,7 +138,7 @@ blob_seek(pysqlite_Blob *self, PyObject *const *args, Py_ssize_t nargs)
goto exit;
}
skip_optional:
return_value = blob_seek_impl(self, offset, origin);
return_value = blob_seek_impl((pysqlite_Blob *)self, offset, origin);

exit:
return return_value;
Expand All @@ -157,9 +157,9 @@ static PyObject *
blob_tell_impl(pysqlite_Blob *self);

static PyObject *
blob_tell(pysqlite_Blob *self, PyObject *Py_UNUSED(ignored))
blob_tell(PyObject *self, PyObject *Py_UNUSED(ignored))
{
return blob_tell_impl(self);
return blob_tell_impl((pysqlite_Blob *)self);
}

PyDoc_STRVAR(blob_enter__doc__,
Expand All @@ -175,9 +175,9 @@ static PyObject *
blob_enter_impl(pysqlite_Blob *self);

static PyObject *
blob_enter(pysqlite_Blob *self, PyObject *Py_UNUSED(ignored))
blob_enter(PyObject *self, PyObject *Py_UNUSED(ignored))
{
return blob_enter_impl(self);
return blob_enter_impl((pysqlite_Blob *)self);
}

PyDoc_STRVAR(blob_exit__doc__,
Expand All @@ -194,7 +194,7 @@ blob_exit_impl(pysqlite_Blob *self, PyObject *type, PyObject *val,
PyObject *tb);

static PyObject *
blob_exit(pysqlite_Blob *self, PyObject *const *args, Py_ssize_t nargs)
blob_exit(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
{
PyObject *return_value = NULL;
PyObject *type;
Expand All @@ -207,9 +207,9 @@ blob_exit(pysqlite_Blob *self, PyObject *const *args, Py_ssize_t nargs)
type = args[0];
val = args[1];
tb = args[2];
return_value = blob_exit_impl(self, type, val, tb);
return_value = blob_exit_impl((pysqlite_Blob *)self, type, val, tb);

exit:
return return_value;
}
/*[clinic end generated code: output=45168bcaeea61140 input=a9049054013a1b77]*/
/*[clinic end generated code: output=b0e3d38063739b17 input=a9049054013a1b77]*/
Loading