Skip to content

Commit caa67d2

Browse files
authored
Preparing for release (#43)
* Full matrix * PyPI upload * Config files * 3.11 exception
1 parent dff167f commit caa67d2

File tree

5 files changed

+81
-6
lines changed

5 files changed

+81
-6
lines changed

.circleci/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ workflows:
1818
name: Python (<< matrix.python_version >>) - ArangoDB (<< matrix.arangodb_license >>, << matrix.arangodb_version >> << matrix.arangodb_config >>)
1919
matrix:
2020
parameters:
21-
python_version: ["3.10"]
21+
python_version: ["3.10", "3.11", "3.12"]
2222
arangodb_config: ["single", "cluster"]
2323
arangodb_license: ["community", "enterprise"]
24-
arangodb_version: ["3.12"]
24+
arangodb_version: ["3.11", "3.12"]
2525

2626
jobs:
2727
lint:

.github/workflows/pypi.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Upload to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
upload:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- uses: actions/setup-python@v4
15+
with:
16+
python-version: "3.12"
17+
18+
- name: Install build dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install build twine
22+
23+
- name: Build package
24+
run: python -m build
25+
26+
- name: Publish to PyPI Test
27+
env:
28+
TWINE_USERNAME: __token__
29+
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN }}
30+
run: twine upload --repository testpypi dist/*
31+
32+
- name: Publish to PyPI
33+
env:
34+
TWINE_USERNAME: __token__
35+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
36+
run: twine upload --repository pypi dist/*

tests/static/cluster-3.11.conf

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[starter]
2+
mode = cluster
3+
local = true
4+
address = 0.0.0.0
5+
port = 8528
6+
7+
[auth]
8+
jwt-secret = /tests/static/keyfile
9+
10+
[args]
11+
all.database.password = passwd
12+
all.database.extended-names = true
13+
all.log.api-enabled = true
14+
all.javascript.allow-admin-execute = true

tests/static/single-3.11.conf

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[starter]
2+
mode = single
3+
address = 0.0.0.0
4+
port = 8528
5+
6+
[auth]
7+
jwt-secret = /tests/static/keyfile
8+
9+
[args]
10+
all.database.password = passwd
11+
all.database.extended-names = true
12+
all.javascript.allow-admin-execute = true

tests/test_document.py

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import asyncio
22

33
import pytest
4+
from packaging import version
45

56
from arangoasync.exceptions import (
67
DocumentDeleteError,
@@ -306,7 +307,7 @@ async def test_document_find(doc_col, bad_col, docs):
306307

307308

308309
@pytest.mark.asyncio
309-
async def test_document_insert_many(doc_col, bad_col, docs):
310+
async def test_document_insert_many(cluster, db_version, doc_col, bad_col, docs):
310311
# Check errors
311312
with pytest.raises(DocumentInsertError):
312313
await bad_col.insert_many(docs)
@@ -328,6 +329,9 @@ async def test_document_insert_many(doc_col, bad_col, docs):
328329
assert "error" in res
329330

330331
# Silent mode
332+
if cluster and db_version < version.parse("3.12.0"):
333+
pytest.skip("Skipping silent option")
334+
331335
result = await doc_col.insert_many(docs, silent=True)
332336
assert len(result) == len(docs)
333337
for res in result:
@@ -338,7 +342,7 @@ async def test_document_insert_many(doc_col, bad_col, docs):
338342

339343

340344
@pytest.mark.asyncio
341-
async def test_document_replace_many(doc_col, bad_col, docs):
345+
async def test_document_replace_many(cluster, db_version, doc_col, bad_col, docs):
342346
# Check errors
343347
with pytest.raises(DocumentReplaceError):
344348
await bad_col.replace_many(docs)
@@ -365,6 +369,9 @@ async def test_document_replace_many(doc_col, bad_col, docs):
365369
assert "text" not in doc["new"]
366370

367371
# Silent mode
372+
if cluster and db_version < version.parse("3.12.0"):
373+
pytest.skip("Skipping silent option")
374+
368375
result = await doc_col.replace_many(docs, silent=True)
369376
assert len(result) == 0
370377
await doc_col.truncate()
@@ -375,7 +382,7 @@ async def test_document_replace_many(doc_col, bad_col, docs):
375382

376383

377384
@pytest.mark.asyncio
378-
async def test_document_update_many(doc_col, bad_col, docs):
385+
async def test_document_update_many(db_version, cluster, doc_col, bad_col, docs):
379386
# Check errors
380387
with pytest.raises(DocumentUpdateError):
381388
await bad_col.update_many(docs)
@@ -402,6 +409,9 @@ async def test_document_update_many(doc_col, bad_col, docs):
402409
assert "text" in doc["new"]
403410

404411
# Silent mode
412+
if cluster and db_version < version.parse("3.12.0"):
413+
pytest.skip("Skipping silent option")
414+
405415
result = await doc_col.update_many(docs, silent=True)
406416
assert len(result) == 0
407417
await doc_col.truncate()
@@ -412,7 +422,7 @@ async def test_document_update_many(doc_col, bad_col, docs):
412422

413423

414424
@pytest.mark.asyncio
415-
async def test_document_delete_many(doc_col, bad_col, docs):
425+
async def test_document_delete_many(db_version, cluster, doc_col, bad_col, docs):
416426
# Check errors
417427
with pytest.raises(DocumentDeleteError):
418428
await bad_col.delete_many(docs)
@@ -444,6 +454,9 @@ async def test_document_delete_many(doc_col, bad_col, docs):
444454
assert "error" in result[1]
445455

446456
# Silent mode
457+
if cluster and db_version < version.parse("3.12.0"):
458+
pytest.skip("Skipping silent option")
459+
447460
await doc_col.truncate()
448461
_ = await doc_col.insert_many(docs)
449462
result = await doc_col.delete_many(docs, silent=True)

0 commit comments

Comments
 (0)