Skip to content

Commit 06ab8c9

Browse files
authored
Merge branch 'main' into dependabot/pip/certifi-2024.7.4
2 parents c755cb8 + 6ee3d98 commit 06ab8c9

37 files changed

+4437
-70
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 10.2.6
2+
current_version = 11.1.0
33
commit = True
44
tag = True
55

.github/workflows/python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
runs-on: ubuntu-latest
2929
strategy:
3030
matrix:
31-
python-version: ["3.8", "3.9", "3.10", "3.11"]
31+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
3232

3333
steps:
3434
- uses: actions/checkout@v3

README.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,28 @@
1212
[![downloads](https://img.shields.io/pypi/dm/terminusdb-client.svg?logo=pypi)](https://pypi.python.org/pypi/terminusdb-client/)
1313

1414
[![build status](https://img.shields.io/github/workflow/status/terminusdb/terminusdb-client-python/Python%20package?logo=github)](https://github.com/terminusdb/terminusdb-client-python/actions)
15-
[![documentation](https://img.shields.io/github/deployments/terminusdb/terminusdb-client-python/github-pages?label=documentation&logo=github)](https://terminusdb.com/docs/python)
15+
[![documentation](https://img.shields.io/github/deployments/terminusdb/terminusdb-client-python/github-pages?label=documentation&logo=github)](https://terminusdb.org/docs/python)
1616
[![code coverage](https://codecov.io/gh/terminusdb/terminusdb-client-python/branch/main/graph/badge.svg?token=BclAUaOPnQ)](https://codecov.io/gh/terminusdb/terminusdb-client-python)
1717
[![license](https://img.shields.io/github/license/terminusdb/terminusdb-client-python?color=pink&logo=apache)](https://github.com/terminusdb/terminusdb-client-python/blob/main/LICENSE)
1818

1919
> Python client for TerminusDB and TerminusCMS.
2020
2121
[**TerminusDB**][terminusdb] is an [open-source][terminusdb-repo] graph database
2222
and document store. It allows you to link JSON documents in a powerful knowledge
23-
graph all through a simple document API.
23+
graph all through a simple document API, with full git-for-data version control.
2424

25-
[terminusdb]: https://terminusdb.com/
26-
[terminusdb-docs]: https://terminusdb.com/docs/
25+
[terminusdb]: https://terminusdb.org/
26+
[terminusdb-docs]: https://terminusdb.org/docs/
2727
[terminusdb-repo]: https://github.com/terminusdb/terminusdb
2828

29-
[**TerminusCMS**](https://terminusdb.com/terminuscms/) is a hosted headless content management system. It is built upon TerminusDB and is a developer-focused data management platform for complex data and content infrastructure. [Sign up and clone a demo project to see how it works][dashboard].
30-
31-
[dashboard]: https://dashboard.terminusdb.com/
32-
3329
## Requirements
3430

35-
- [TerminusDB v10.0](https://github.com/terminusdb/terminusdb-server)
31+
- [TerminusDB v11.1](https://github.com/terminusdb/terminusdb-server)
3632
- [Python >=3.8](https://www.python.org/downloads)
3733

3834
## Release Notes and Previous Versions
3935

40-
TerminusDB Client v10.0 works with TerminusDB v10.0 and TerminusCMS. Please check the [Release Notes](RELEASE_NOTES.md) to find out what has changed.
36+
TerminusDB Client v11.1 works with TerminusDB v11.1 and the [DFRNT cloud service](https://dfrnt.com). Please check the [Release Notes](RELEASE_NOTES.md) to find out what has changed.
4137

4238
## Installation
4339
- TerminusDB Client can be downloaded from PyPI using pip:
@@ -76,16 +72,16 @@ client = Client("http://127.0.0.1:6363/")
7672
client.connect()
7773
```
7874

79-
Connect to TerminusCMS
75+
Connect to TerminusDB in the cloud
8076

81-
*check the documentation for TerminusCMS about how to add the [API token](https://terminusdb.com/docs/how-to-connect-terminuscms) to the environment variable*
77+
*check the documentation on the DFRNT support page about how to add your [API token](https://support.dfrnt.com/portal/en/kb/articles/api) to the environment variable*
8278

8379

8480
```Python
8581
from terminusdb_client import Client
8682

8783
team="MyTeam"
88-
client = Client(f"https://dashboard.terminusdb.com/{team}/")
84+
client = Client(f"https://studio.dfrnt.com/api/hosted/{team}/")
8985
client.connect(team="MyTeam", use_token=True)
9086
```
9187

@@ -185,11 +181,11 @@ Do you want to delete 'mydb'? WARNING: This operation is non-reversible. [y/N]:
185181
mydb deleted.
186182
```
187183

188-
### Please check the [full Documentation](https://terminusdb.com/docs/python) for more information.
184+
### Please check the [full Documentation](https://terminusdb.org/docs/python) for more information.
189185

190186
## Guides & Tutorials
191187

192-
Visit our documentation for a range of short how-to guides, [how-to use the Python Client](https://terminusdb.com/docs/use-the-python-client) and [how to use the collaboration features with the Python Client](https://terminusdb.com/docs/collaboration-with-python-client). Alternatively, undertake the [Getting Started with the Python Client Tutorial Series.](https://github.com/terminusdb/terminusdb-tutorials/blob/main/getting_started/python-client/README.md).
188+
Visit our documentation for a range of short how-to guides, [how-to use the Python Client](https://terminusdb.org/docs/use-the-python-client) and [how to use the collaboration features with the Python Client](https://terminusdb.org/docs/collaboration-with-python-client). Alternatively, undertake the [Getting Started with the Python Client Tutorial Series.](https://github.com/terminusdb/terminusdb-tutorials/blob/main/getting_started/python-client/README.md).
193189

194190
## Testing
195191

RELEASE_NOTES.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# TerminusDB Python Client Release Notes
22

3+
## v11.1.0
4+
5+
- Add support for python 3.12
6+
- Aligned with TerminusDB 11.1 overall and general preparation for v11.2.0
7+
8+
### Bug fixes
9+
10+
- Fix schema parameter to database construction
11+
312
## v10.2.6
413

514
### Bug fixes

docs/release_steps.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Release Steps
2+
3+
## Quick Release
4+
5+
1. Update release notes (`RELEASE_NOTES.md`)
6+
2. Bump version (bumpversion [patch|minor|major])
7+
3. Push new tag (`git push origin main --tags`)
8+
9+
### Bump version (updates files + creates tag)
10+
11+
To not create a tag, use `--no-tag`.
12+
13+
```bash
14+
bumpversion [patch|minor|major]
15+
```
16+
17+
### Create and push tag (triggers automated PyPI deployment)
18+
19+
```bash
20+
git push origin main --tags
21+
```
22+
23+
**Monitor**: https://github.com/terminusdb/terminusdb-client-python/actions
24+
25+
## Details
26+
27+
### What bumpversion updates
28+
- `terminusdb_client/__version__.py`
29+
- `pyproject.toml`
30+
- `.bumpversion.cfg`
31+
32+
### Automated deployment
33+
Pushing a tag triggers GitHub Actions to:
34+
- Run tests (Python 3.8-3.12)
35+
- Build with Poetry
36+
- Publish to PyPI
37+
38+
### Manual deployment (if needed)
39+
```bash
40+
poetry build
41+
poetry publish
42+
```
43+
44+
### Troubleshooting
45+
46+
**Version conflicts:** Never delete published PyPI versions. Create a new patch release instead.
47+
48+
## Prerequisites
49+
50+
- Install: `pip install bumpversion`
51+
- PyPI publishing handled via `PYPI_API_TOKEN` secret in GitHub Actions

poetry.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[tool.poetry]
22
name = "terminusdb-client"
3-
version = "10.2.6"
3+
version = "11.1.0"
44
description = "Python client for Terminus DB"
55
authors = ["TerminusDB group"]
66
license = "Apache Software License"
77
readme = "README.md"
88

99
[tool.poetry.dependencies]
10-
python = ">=3.8.0,<3.12"
10+
python = ">=3.8.0,<3.13"
1111
requests = "^2.31.0"
1212
numpy = ">= 1.13.0"
1313
numpydoc = "*"

terminusdb_client/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
__title__ = "terminusdb-client"
22
__description__ = "TerminusDB client library for accessing the Terminus DB API"
33
__url__ = ""
4-
__version__ = "10.2.6"
4+
__version__ = "11.1.0"
55
__build__ = 00
66
__author__ = "TerminusDB group"
77
__author_email__ = "team@terminusdb.com"

terminusdb_client/tests/integration_tests/conftest.py

Lines changed: 69 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,38 @@
55
import pytest
66
import requests
77

8-
MAX_CONTAINER_STARTUP_TIME = 30
8+
MAX_CONTAINER_STARTUP_TIME = 120 # Increased from 30 to 120 seconds for slower systems
9+
10+
11+
# Check if a local TerminusDB test server is already running
12+
def is_local_server_running():
13+
"""Check if local TerminusDB server is running at http://127.0.0.1:6363"""
14+
try:
15+
response = requests.get("http://127.0.0.1:6363", timeout=2)
16+
# Server responds with 404 for root path, which means it's running
17+
return response.status_code in [200, 404]
18+
except (requests.exceptions.ConnectionError, requests.exceptions.Timeout):
19+
return False
20+
21+
22+
def is_docker_server_running():
23+
"""Check if Docker TerminusDB server is already running at http://127.0.0.1:6366"""
24+
try:
25+
response = requests.get("http://127.0.0.1:6366", timeout=2)
26+
# Server responds with 404 for root path, which means it's running
27+
return response.status_code in [200, 404]
28+
except (requests.exceptions.ConnectionError, requests.exceptions.Timeout):
29+
return False
30+
31+
32+
def is_jwt_server_running():
33+
"""Check if JWT Docker TerminusDB server is already running at http://127.0.0.1:6367"""
34+
try:
35+
response = requests.get("http://127.0.0.1:6367", timeout=2)
36+
# Server responds with 404 for root path, which means it's running
37+
return response.status_code in [200, 404]
38+
except (requests.exceptions.ConnectionError, requests.exceptions.Timeout):
39+
return False
940

1041

1142
def is_docker_installed():
@@ -39,6 +70,13 @@ def docker_url_jwt(pytestconfig):
3970
# we are using subprocess in case we need to access some of the outputs
4071
# most likely
4172
jwt_token = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InRlc3RrZXkifQ.eyJodHRwOi8vdGVybWludXNkYi5jb20vc2NoZW1hL3N5c3RlbSNhZ2VudF9uYW1lIjoiYWRtaW4iLCJodHRwOi8vdGVybWludXNkYi5jb20vc2NoZW1hL3N5c3RlbSN1c2VyX2lkZW50aWZpZXIiOiJhZG1pbkB1c2VyLmNvbSIsImlzcyI6Imh0dHBzOi8vdGVybWludXNodWIuZXUuYXV0aDAuY29tLyIsInN1YiI6ImFkbWluIiwiYXVkIjpbImh0dHBzOi8vdGVybWludXNodWIvcmVnaXN0ZXJVc2VyIiwiaHR0cHM6Ly90ZXJtaW51c2h1Yi5ldS5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNTkzNzY5MTgzLCJhenAiOiJNSkpuZEdwMHpVZE03bzNQT1RRUG1SSkltWTJobzBhaSIsInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgZW1haWwifQ.Ru03Bi6vSIQ57bC41n6fClSdxlb61m0xX6Q34Yh91gql0_CyfYRWTuqzqPMFoCefe53hPC5E-eoSFdID_u6w1ih_pH-lTTqus9OWgi07Qou3QNs8UZBLiM4pgLqcBKs0N058jfg4y6h9GjIBGVhX9Ni2ez3JGNcz1_U45BhnreE"
73+
74+
# Check if JWT server is already running (port 6367)
75+
if is_jwt_server_running():
76+
print("\n✓ Using existing JWT Docker TerminusDB server at http://127.0.0.1:6367")
77+
yield ("http://127.0.0.1:6367", jwt_token)
78+
return # Don't clean up - server was already running
79+
4280
pytestconfig.getoption("docker_compose")
4381
output = subprocess.run(
4482
[
@@ -79,7 +117,8 @@ def docker_url_jwt(pytestconfig):
79117
if service.stdout == b"terminusdb-server\n":
80118
try:
81119
response = requests.get(test_url)
82-
assert response.status_code == 200
120+
# Server responds with 404 for root path, which means it's running
121+
assert response.status_code in [200, 404]
83122
break
84123
except (requests.exceptions.ConnectionError, AssertionError):
85124
pass
@@ -89,16 +128,37 @@ def docker_url_jwt(pytestconfig):
89128

90129
if seconds_waited > MAX_CONTAINER_STARTUP_TIME:
91130
clean_up_container()
92-
raise RuntimeError("Container was to slow to startup")
131+
raise RuntimeError(f"JWT Container was too slow to startup (waited {MAX_CONTAINER_STARTUP_TIME}s)")
93132

94133
yield (test_url, jwt_token)
95134
clean_up_container()
96135

97136

98137
@pytest.fixture(scope="module")
99138
def docker_url(pytestconfig):
100-
# we are using subprocess in case we need to access some of the outputs
101-
# most likely
139+
"""
140+
Provides a TerminusDB server URL for integration tests.
141+
Prefers local test server if running, otherwise starts Docker container.
142+
143+
NOTE: This fixture returns just the URL. Tests expect AUTOLOGIN mode (no authentication).
144+
If using local server with authentication, use TERMINUSDB_AUTOLOGIN=true when starting it.
145+
"""
146+
# Check if local test server is already running (port 6363)
147+
if is_local_server_running():
148+
print("\n✓ Using existing local TerminusDB test server at http://127.0.0.1:6363")
149+
print("⚠️ WARNING: Local server should be started with TERMINUSDB_AUTOLOGIN=true")
150+
print(" Or use: TERMINUSDB_SERVER_AUTOLOGIN=true ./tests/terminusdb-test-server.sh restart")
151+
yield "http://127.0.0.1:6363"
152+
return # Don't clean up - server was already running
153+
154+
# Check if Docker container is already running (port 6366)
155+
if is_docker_server_running():
156+
print("\n✓ Using existing Docker TerminusDB server at http://127.0.0.1:6366")
157+
yield "http://127.0.0.1:6366"
158+
return # Don't clean up - server was already running
159+
160+
# No server found, start Docker container
161+
print("\n⚠ No server found, starting Docker container with AUTOLOGIN...")
102162
pytestconfig.getoption("docker_compose")
103163
output = subprocess.run(
104164
[
@@ -138,7 +198,9 @@ def docker_url(pytestconfig):
138198
if service.stdout == b"terminusdb-server\n":
139199
try:
140200
response = requests.get(test_url)
141-
assert response.status_code == 200
201+
# Server responds with 404 for root path, which means it's running
202+
assert response.status_code in [200, 404]
203+
print(f"✓ Docker container started successfully after {seconds_waited}s")
142204
break
143205
except (requests.exceptions.ConnectionError, AssertionError):
144206
pass
@@ -148,7 +210,7 @@ def docker_url(pytestconfig):
148210

149211
if seconds_waited > MAX_CONTAINER_STARTUP_TIME:
150212
clean_up_container()
151-
raise RuntimeError("Container was to slow to startup")
213+
raise RuntimeError(f"Container was too slow to startup (waited {MAX_CONTAINER_STARTUP_TIME}s)")
152214

153215
yield test_url
154216
clean_up_container()

terminusdb_client/tests/integration_tests/test-docker-compose-jwt.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3"
2-
31
volumes:
42
terminusdb_storage:
53

0 commit comments

Comments
 (0)