Skip to content

Commit

Permalink
Merge branch '20-release-v0-6-0' into 'dev'
Browse files Browse the repository at this point in the history
Resolve "Release v0.6.0"

See merge request objectbox/objectbox-python!14
  • Loading branch information
dan-obx committed Feb 19, 2024
2 parents 629c330 + d9a3d3a commit 5ba5274
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
fail-fast: false # To see all versions that fail.
matrix:
os: ["ubuntu", "windows", "macos"]
python: ["3.7", "3.8", "3.9", "3.10"] # https://devguide.python.org/versions/#versions
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] # https://devguide.python.org/versions/#versions

runs-on: ${{ matrix.os }}-latest

Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ test:linux:x64:
matrix:
# Note: Docker images will have an arbitrary minor version due to "if-not-present" pull policy.
# If this becomes a problem, we could e.g. specify a minor version explicitly.
- PYTHON_VERSION: [ '3.7', '3.8', '3.9', '3.10', '3.11']
- PYTHON_VERSION: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']

test:linux:armv7hf:
extends: .test
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ Some features
* Linux x86-64 (64-bit)
* Linux ARMv6hf (e.g. Raspberry PI Zero)
* Linux ARMv7hf (e.g. Raspberry PI 3; available only on request)
* Linux ARMv8 (e.g. Raspberry PI 4)
* MacOS x86-64 and arm64 (Intel 64-bit and Apple Silicon)
* Windows x86-64 (64-bit)

Expand Down Expand Up @@ -151,7 +152,7 @@ License
-------

```text
Copyright 2019-2023 ObjectBox Ltd. All rights reserved.
Copyright 2019-2024 ObjectBox Ltd. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion download-c-lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# 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 = "v0.18.1" # see objectbox/c.py required_version
version = "v0.21.0" # see objectbox/c.py required_version
variant = 'objectbox' # or 'objectbox-sync'

base_url = "https://github.com/objectbox/objectbox-c/releases/download/"
Expand Down
2 changes: 1 addition & 1 deletion objectbox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
]

# Python binding version
version = Version(0, 5, 0)
version = Version(0, 6, 0)


def version_info():
Expand Down
2 changes: 1 addition & 1 deletion objectbox/c.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

# Version of the library used by the binding. This version is checked at runtime to ensure binary compatibility.
# Don't forget to update download-c-lib.py when upgrading to a newer version.
required_version = "0.18.1"
required_version = "0.21.0"


def shlib_name(library: str) -> str:
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pip
setuptools
wheel
flatbuffers==23.5.26
pytest>=4.4.1
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: C",
"Programming Language :: C++",

Expand Down
5 changes: 1 addition & 4 deletions tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,14 @@ def autocleanup():
remove_test_dir()


def load_empty_test_objectbox(name: str = "") -> objectbox.ObjectBox:
def load_empty_test_objectbox(db_name: str = test_dir) -> objectbox.ObjectBox:
model = objectbox.Model()
from objectbox.model import IdUid
model.entity(TestEntity, last_property_id=IdUid(27, 1027))
model.last_entity_id = IdUid(2, 2)

db_name = test_dir if len(name) == 0 else test_dir + "/" + name

return objectbox.Builder().model(model).directory(db_name).build()


def load_empty_test_datetime(name: str = "") -> objectbox.ObjectBox:
model = objectbox.Model()
from objectbox.model import IdUid
Expand Down
4 changes: 2 additions & 2 deletions tests/test_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

def test_version():
assert objectbox.version.major == 0 # update for major version changes
assert objectbox.version.minor >= 5
assert objectbox.version.minor >= 6

assert objectbox.version_core.major == 0 # update for major version changes
assert objectbox.version_core.minor >= 18
assert objectbox.version_core.minor >= 21

info = objectbox.version_info()
print("\nVersion found:", info)
Expand Down
29 changes: 29 additions & 0 deletions tests/test_inmemory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import objectbox
from tests.common import load_empty_test_objectbox
from tests.model import TestEntity
import os.path
import shutil

def test_inmemory():
# Expect path for persistent store
db_name = "testdata_persistent"
ob = load_empty_test_objectbox(db_name)
box = objectbox.Box(ob, TestEntity)
object = TestEntity()
id = box.put(object)
assert id == 1
assert id == object.id
assert os.path.exists(db_name)
del box
ob.close()
shutil.rmtree(db_name)

# Expect no path for in-memory store
db_name = "memory:testdata"
ob = load_empty_test_objectbox(db_name)
box = objectbox.Box(ob, TestEntity)
object = TestEntity()
id = box.put(object)
assert id == 1
assert id == object.id
assert not os.path.exists(db_name)

0 comments on commit 5ba5274

Please sign in to comment.