Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a9edd55
start implement sync client
Dec 22, 2025
bf41581
Fix type error, add obx_sync_state call in SyncClient
Dec 23, 2025
dabc331
Upgrade to OBX 5.0.0, download Sync version of C library only (tempor…
Dec 23, 2025
50d3cb0
Add login, connection and error listeners
Dec 24, 2025
7b86cfc
Add methods for filter variables
Dec 25, 2025
9a0d951
Add method for outgoing message count
Dec 25, 2025
7bf29d4
Add method for setting multiple credentials
Dec 25, 2025
7aacc1a
Remove credentials for SyncClient constructor in test_sync_client_states
Dec 25, 2025
5a3bf3e
Notify Sync client when underlying Store is closed
Dec 25, 2025
978a9a9
Add Sync class with static factory methods to construct SyncClient
Dec 25, 2025
b75bb85
Remove .values() from Store.py when invoking store close listeners
Dec 25, 2025
b59e786
Check Sync available when constructing SyncClient instance
Dec 25, 2025
04d5a36
Add filter variables when creating an instance of SyncClient
Dec 25, 2025
7be070b
Add requestUpdates() and cancelUpdates() methods
Dec 28, 2025
66f708b
add pre-check for sync client ptr not null
Dec 28, 2025
e70fa2e
Allow building different package for OBX Sync
Dec 30, 2025
8d6023c
Set version to 5.0.0 in package's __init__.py
Dec 30, 2025
1ba8f16
Allow adding entity flags for Sync
Dec 31, 2025
ea8db2e
Document C functions in c.py
Dec 31, 2025
baf6d9c
Document classes/methods in sync.py
Dec 31, 2025
37bee34
Add change listener to notify client on incoming changes
Jan 1, 2026
0d165b6
Add new method enable_sync() in _Entity
Jan 4, 2026
58a7fa0
Override SyncClient's destructor to call close(), to avoid resource l…
Jan 4, 2026
0bce2d8
Suffix listener function types with '_t' to indicate that they are 't…
Jan 4, 2026
810c5e9
Increment versions in test_basics.py to make sure test_version() pass…
Jan 15, 2026
98ba442
Test with live Sync server
Jan 17, 2026
fcc159c
Enable Sync testing in GitLab CI
Jan 17, 2026
ff008ee
Skip test_entity_attribute_methods_nameclash_check test
Jan 17, 2026
0fc7774
Use typing.Union to avoid build failures in Python version < 3.10
Jan 17, 2026
873f639
Use typing.Union to avoid build failures in Python version < 3.10
Jan 17, 2026
198be4f
Fix action for --runsync flag
Jan 17, 2026
e07a05e
Avoid using os.getuid() for Windows
Jan 17, 2026
c93a93a
Remove unnecessary sync_client.close() in test_sync_listener
Jan 25, 2026
330fc74
Write lastRelationId to model JSON
Jan 25, 2026
3fd1e91
Get more output from pytest
Jan 25, 2026
e1b5cc4
Download Sync server executable from artifacts
Jan 25, 2026
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
66 changes: 64 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,30 @@ build:
paths:
- dist/*.whl

# Build the Sync version of the package
build-sync:
tags: [ x64, docker, linux ]
image: python:latest
stage: build
script:
- python -m pip install --upgrade pip
# Using released C library (Sync version)
- make depend-sync
- make test
- make build-sync
artifacts:
expire_in: 1 days
paths:
- dist/*.whl

# Next, test the packaged wheel built by "build"
.test:
stage: test
script:
- pip3 install --user pytest
- rm -r objectbox # todo this is ugly; let's copy required files in a sub-folder instead?
- pip3 install --user --force-reinstall dist/*.whl # Artifacts from the previous stage (downloaded by default)
- ${PYTHON} -m pytest
- ${PYTHON} -m pytest -s
variables:
PYTHON: "python3"

Expand Down Expand Up @@ -64,11 +80,57 @@ test:mac:x64:
- python3 -m pip install pytest
- rm -r objectbox # todo this is ugly; let's copy required files in a sub-folder instead?
- pip3 install --force-reinstall dist/*.whl # Artifacts from the previous stage (downloaded by default)
- python -m pytest
- python -m pytest -s
tags: [mac, x64, shell, python3]

test:windows:x64:
extends: .test
tags: [windows, x64, python]
variables:
PYTHON: "python.exe"

# Sync version test jobs
.test-sync:
stage: test
needs: [ build-sync ]
script:
- pip3 install --user pytest
- rm -r objectbox # todo this is ugly; let's copy required files in a sub-folder instead?
- pip3 install --user --force-reinstall dist/*.whl # Artifacts from build-sync
- ${PYTHON} -m pytest -s --runsync
variables:
PYTHON: "python3"

test-sync:linux:x64:
extends: .test-sync
tags: [ x64, docker, linux ]
image: python:$PYTHON_VERSION
parallel:
matrix:
- PYTHON_VERSION: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12' ]

#test-sync:linux:armv7hf:
# extends: .test-sync
# tags: [ armv7hf, shell, linux, python3 ]

test-sync:linux:aarch64:
extends: .test-sync
tags: [ aarch64, shell, linux, python3 ]

test-sync:mac:arm64:
extends: .test-sync
script:
- python3 -m venv .venv
- source .venv/bin/activate
- python3 -m pip install pytest
- rm -r objectbox # todo this is ugly; let's copy required files in a sub-folder instead?
- pip3 install --force-reinstall dist/*.whl # Artifacts from build-sync
- python -m pytest -s --runsync
tags: [ mac, arm64, shell, python3 ]

#test-sync:windows:x64:
# extends: .test-sync
# tags: [ windows, x64, python ]
# variables:
# PYTHON: "python.exe"

9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ build: ${VENV} clean ## Clean and build
${PYTHON} setup.py bdist_wheel ; \
ls -lh dist

build-sync: ${VENV} clean ## Clean and build
set -e ; \
OBX_BUILD_SYNC=1 ${PYTHON} setup.py bdist_wheel ; \
ls -lh dist

${VENV}: ${VENVBIN}/activate

venv-init:
Expand All @@ -49,6 +54,10 @@ depend: ${VENV} ## Prepare dependencies
set -e ; \
${PYTHON} download-c-lib.py

depend-sync: ${VENV} ## Prepare dependencies
set -e ; \
${PYTHON} download-c-lib.py --sync

test: ${VENV} ## Test all targets
set -e ; \
${PYTHON} -m pytest --capture=no --verbose
Expand Down
7 changes: 5 additions & 2 deletions download-c-lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
import tarfile
import zipfile
import os
import sys

# Script used to download objectbox-c shared libraries for all supported platforms. Execute by running `make get-lib`
# on first checkout of this repo and any time after changing the objectbox-c lib version.

version = "v4.0.0" # see objectbox/c.py required_version
version = "v5.0.0" # see objectbox/c.py required_version
variant = 'objectbox' # or 'objectbox-sync'
if len(sys.argv) > 1 and sys.argv[1] == '--sync':
variant = 'objectbox-sync'

base_url = "https://github.com/objectbox/objectbox-c/releases/download/"

Expand All @@ -21,7 +24,7 @@
"x86_64/libobjectbox.so": "linux-x64.tar.gz",
"aarch64/libobjectbox.so": "linux-aarch64.tar.gz",
"armv7l/libobjectbox.so": "linux-armv7hf.tar.gz",
"armv6l/libobjectbox.so": "linux-armv6hf.tar.gz",
#"armv6l/libobjectbox.so": "linux-armv6hf.tar.gz",

# mac
"macos-universal/libobjectbox.dylib": "macos-universal.zip",
Expand Down
7 changes: 4 additions & 3 deletions objectbox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from objectbox.store import Store
from objectbox.box import Box
from objectbox.model.entity import Entity
from objectbox.model.entity import Entity, SyncEntity
from objectbox.model.properties import Id, String, Index, Bool, Int8, Int16, Int32, Int64, Float32, Float64, Bytes, BoolVector, Int8Vector, Int16Vector, Int32Vector, Int64Vector, Float32Vector, Float64Vector, CharVector, BoolList, Int8List, Int16List, Int32List, Int64List, Float32List, Float64List, CharList, Date, DateNano, Flex, HnswIndex, VectorDistanceType, HnswFlags
from objectbox.model.model import Model
from objectbox.c import version_core, DebugFlags
Expand Down Expand Up @@ -74,11 +74,12 @@
'PropertyQueryCondition',
'HnswFlags',
'Query',
'QueryBuilder'
'QueryBuilder',
'SyncEntity'
]

# Python binding version
version = Version(4, 0, 0)
version = Version(5, 0, 0)
"""ObjectBox Python package version"""

def version_info():
Expand Down
Loading
Loading