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
18 changes: 9 additions & 9 deletions .github/workflows/wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- os: windows-2022
cibw: "cp310*"
cibw_skip: "*-win32"
- os: macos-13
- os: macos-15-intel
cibw: "cp310*"
cibw_skip: ""
- os: macos-latest
Expand Down Expand Up @@ -59,9 +59,9 @@ jobs:
CIBW_BUILD_FRONTEND: build # pip backend doesn't seem including our dynamic libraries
CIBW_BUILD: ${{ matrix.config.cibw }}
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=13.0 SYSTEM_VERSION_COMPAT=0 # Shitty arm macOS
CIBW_BEFORE_BUILD_LINUX: pip install ninja && git fetch --tags
CIBW_BEFORE_BUILD_WINDOWS: choco install ninja git && cd libmdbx && git fetch --tags
CIBW_BEFORE_BUILD_MACOS: brew install ninja git && cd libmdbx && git fetch --tags
CIBW_BEFORE_BUILD_LINUX: pip install ninja
CIBW_BEFORE_BUILD_WINDOWS: choco install ninja git
CIBW_BEFORE_BUILD_MACOS: brew install ninja git
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest {package}/tests
CIBW_SKIP: ${{ matrix.config.cibw_skip }}
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
- os: windows-2022
cibw: "{cp312*,cp313*}"
cibw_skip: "*-win32"
- os: macos-13
- os: macos-15-intel
cibw: "{cp311*,cp312*,cp313*}"
cibw_skip: ""
- os: macos-latest
Expand Down Expand Up @@ -136,9 +136,9 @@ jobs:
CIBW_BUILD_FRONTEND: build # pip backend doesn't seem including our dynamic libraries
CIBW_BUILD: ${{ matrix.config.cibw }}
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=13.0 SYSTEM_VERSION_COMPAT=0 # Shitty arm macOS
CIBW_BEFORE_BUILD_LINUX: pip install ninja && git fetch --tags
CIBW_BEFORE_BUILD_WINDOWS: choco install ninja cmake git && cd libmdbx && git fetch --tags
CIBW_BEFORE_BUILD_MACOS: brew install ninja git && cd libmdbx && git fetch --tags
CIBW_BEFORE_BUILD_LINUX: pip install ninja
CIBW_BEFORE_BUILD_WINDOWS: choco install ninja cmake git
CIBW_BEFORE_BUILD_MACOS: brew install ninja git
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest {package}/tests
CIBW_SKIP: ${{ matrix.config.cibw_skip }}
Expand All @@ -162,7 +162,7 @@ jobs:
- name: Build SDist
run: |
sudo apt update && sudo apt install ninja-build git build-essential -y
cd libmdbx && git fetch --tags && make V=1 && cd ..
cd libmdbx && make V=1 && cd ..
python3 -m pip install -U pip build
python3 -m build --sdist

Expand Down
5 changes: 4 additions & 1 deletion build_mdbx.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ def build(setup_kws: dict):
plat = 'Win32' if platform.architecture()[0] == '32bit' else 'x64'
cmake_gen += [
"-G", "Visual Studio 17 2022",
"-A", plat
"-A", plat,
# CMake >= 4.4 reports c_std_23 for MSVC, so libmdbx would pick
# /std:clatest, where MSVC chokes on the C23 attributes in mdbx.c.
"-DCMAKE_C_STANDARD=11"
]

cmake_gen += [
Expand Down
16 changes: 10 additions & 6 deletions tests/test_mdbx.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,21 @@ def test_db_readitem_writeitem(self) -> None:
def test_db_iter(self) -> None:
MDBX_TEST_DB_DIR = "%s/%s" % (MDBX_TEST_DIR, inspect.stack()[0][3])
db = mdbx.Env(MDBX_TEST_DB_DIR, maxdbs=1024)
db_pairs: dict[str, list[tuple[str, str]]] = {}
db_pairs: dict[str, dict[str, str]] = {}
txn = db.start_transaction()
for i in range(15):
name = id_generator()
dbi = txn.create_map(name)
db_pairs[name] = []
db_pairs[name] = {}
ref = db_pairs[name]

for i in range(1024):
pair = (id_generator(), id_generator())
db_pairs[name].append(pair)
dbi.put(txn, pair[0].encode("utf-8"), pair[1].encode("utf-8"))
key, val = id_generator(), id_generator()
# A repeated key overwrites the previous value, so only the
# last one can be asserted afterwards.
if key not in ref:
ref[key] = val
dbi.put(txn, key.encode("utf-8"), val.encode("utf-8"))
txn.commit()
del txn
dbi.close()
Expand All @@ -97,7 +101,7 @@ def test_db_iter(self) -> None:
txn = db.start_transaction(flags=mdbx.MDBXTXNFlags.MDBX_TXN_RDONLY)
for db_name, pairs in db_pairs.items():
dbi = txn.open_map(db_name)
for key, val in pairs:
for key, val in pairs.items():
self.assertEqual(dbi.get(txn, key.encode("utf-8")).decode("utf-8"), val)
db.close()

Expand Down
Loading