Skip to content

Commit 1afec34

Browse files
committed
Merge branch 'main' into fix/semantic-search-truncation-state
- keep the query-continue-offset truncation check from this branch - emit its two messages through _logger, as main now does - convert the semantic_search tests to caplog assertions - drop the assertion on the removed "requested limit of N" text
2 parents 8c0e3d0 + 9351f6b commit 1afec34

40 files changed

Lines changed: 2897 additions & 1101 deletions

‎CHANGELOG.md‎

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,80 @@
1010
1111
<!-- version list -->
1212

13+
## v2.5.1 (2026-09-21)
14+
15+
### Bug Fixes
16+
17+
- **wtsite**: Copy the jsonld context before rewriting it
18+
([`ea0cddf`](https://github.com/OpenSemanticLab/osw-python/commit/ea0cddfa85a0025560dda49f78ff99577a86f526))
19+
20+
21+
## v2.5.0 (2026-09-21)
22+
23+
### Bug Fixes
24+
25+
- Read the uuid from a file page title with suffixes
26+
([`79a645b`](https://github.com/OpenSemanticLab/osw-python/commit/79a645b3cb5a67e9b769c76270be7297220cde98))
27+
28+
- **file**: Verify the upload before storing the file entity
29+
([`4a09bf5`](https://github.com/OpenSemanticLab/osw-python/commit/4a09bf541a3ea404dcd2e1cd41ea36b8c53ce141))
30+
31+
- **file**: Write the metadata onto the page the upload created
32+
([`eb9e0e1`](https://github.com/OpenSemanticLab/osw-python/commit/eb9e0e112e8b75128c8a3fe5c8d5943531c16d6a))
33+
34+
### Features
35+
36+
- **file**: Report a rejected file extension clearly on upload
37+
([`bb49392`](https://github.com/OpenSemanticLab/osw-python/commit/bb49392a4fc81801d3662613faae96944dd8ed91))
38+
39+
### Performance Improvements
40+
41+
- **file**: Cache the wiki's allowed file extensions for 24 h
42+
([`3a7b6eb`](https://github.com/OpenSemanticLab/osw-python/commit/3a7b6eb3f5bbb14d3369c52f0bac7cb256d85f78))
43+
44+
### Refactoring
45+
46+
- Match the OSW-ID as the 32 hex characters it is
47+
([`186e9e3`](https://github.com/OpenSemanticLab/osw-python/commit/186e9e32042efdc8c8aabe374923d9cd99fa1bd7))
48+
49+
50+
## v2.4.0 (2026-09-21)
51+
52+
53+
## v2.3.5 (2026-09-21)
54+
55+
### Bug Fixes
56+
57+
- **core**: Report dropped entities and restore the cache on error
58+
([`870adb8`](https://github.com/OpenSemanticLab/osw-python/commit/870adb876b890c8df97d6545fe2ff113940d4b5b))
59+
60+
### Documentation
61+
62+
- **core**: State that a failed key is not always a page title
63+
([`7297ca6`](https://github.com/OpenSemanticLab/osw-python/commit/7297ca6250292493697cbf8746b492f9a97e188e))
64+
65+
### Testing
66+
67+
- **core**: Cover a raise inside the load_entity page loop
68+
([`88be481`](https://github.com/OpenSemanticLab/osw-python/commit/88be4810807db103af965d9f812952875c4589c7))
69+
70+
71+
## v2.3.4 (2026-09-21)
72+
73+
### Bug Fixes
74+
75+
- **core**: Confirm a missing page before reporting a failed store
76+
([`5756436`](https://github.com/OpenSemanticLab/osw-python/commit/5756436e08ba95be3e177c6a78c424bfdba756c8))
77+
78+
- **core**: Verify that store_entity actually created the page
79+
([`f84a529`](https://github.com/OpenSemanticLab/osw-python/commit/f84a5297c605fc458783e5497edeb1f97113053b))
80+
81+
### Chores
82+
83+
- Relicense to Apache-2.0 ([#173](https://github.com/OpenSemanticLab/osw-python/pull/173),
84+
[`848615c`](https://github.com/OpenSemanticLab/osw-python/commit/848615cbd1e06401922eda88231a51028440a242))
85+
86+
1387
## v2.3.3 (2026-09-08)
1488

1589
### Bug Fixes

‎CITATION.cff‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ message: "If you use this software, please cite it as below."
33
type: software
44
title: "OpenSemanticWorld Python Package (osw-python)"
55
# Managed by python-semantic-release (version_variables). Do not edit by hand.
6-
version: 2.3.3
6+
version: 2.5.1
77
abstract: "Python toolset for data processing, queries, wikicode generation and page manipulation within OpenSemanticLab: work with OpenSemanticLab instances as typed pydantic entities, query with semantic search, generate models from wiki schemas, and write changes back."
88
repository-code: "https://github.com/OpenSemanticLab/osw-python"
99
url: "https://opensemanticlab.github.io/osw-python/"

‎LICENSE.txt‎

Lines changed: 176 additions & 619 deletions
Large diffs are not rendered by default.

‎NOTICE‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
osw-python
2+
Copyright 2022-2026 Simon Stier and contributors

‎README.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ More runnable scripts live in [examples/](examples/), and the
3939
[Basics tutorial](docs/tutorials/basics.ipynb) walks through the
4040
OpenSemanticLab data model.
4141

42+
## Logging
43+
44+
osw reports what it is doing on the `osw` logger at INFO by default. Levels,
45+
the `OSW_LOG_LEVEL` environment variable and how to collect the records in your
46+
own logging setup are described in the
47+
[Get Started guide](https://opensemanticlab.github.io/osw-python/get-started/#logging).
48+
4249
## Contributing
4350

4451
Contributions are welcome, see [CONTRIBUTING.md](CONTRIBUTING.md).

‎docs/get-started.md‎

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,69 @@ Credentials are resolved from the environment variables `OSW_USERNAME` /
6464
credentials file, or via an interactive prompt - and are held in memory
6565
only, never written to disk; see [Authentication](api/auth.md).
6666

67+
## Logging
68+
69+
osw reports what it is doing through the standard `logging` module, on the
70+
`osw` logger, at INFO by default:
71+
72+
```python
73+
import osw
74+
75+
osw.set_log_level("WARNING") # see less
76+
osw.set_log_level("DEBUG") # see more
77+
osw.disable_logging() # detach the handler osw attached
78+
```
79+
80+
Problems that osw can work around are WARNING records on the same logger, not
81+
Python `warnings`. A truncated query result and a page that does not exist are
82+
examples. A `warnings` filter or the `-W` option therefore has no effect on
83+
them. A message that repeats is also written out every time, where the warnings
84+
machinery would have shown it once. Use `set_log_level` to control them.
85+
86+
The records go to `stderr`, which leaves `stdout` free for your program's own
87+
output. That matters for anything speaking a protocol over `stdout`, such as an
88+
MCP stdio server. Pass `osw.enable_logging(stream=...)` to send them elsewhere.
89+
90+
Set `OSW_LOG_LEVEL` to a level name, a level number, or `OFF` to choose the
91+
level before the package is imported. `OFF` silences osw everywhere, including
92+
in your own handlers.
93+
94+
### Collecting osw's records in your application
95+
96+
Configure logging the way you normally would and osw's records arrive there,
97+
once:
98+
99+
```python
100+
import logging
101+
import osw
102+
103+
logging.basicConfig(level=logging.INFO, filename="app.log")
104+
```
105+
106+
The `osw` logger propagates at all times, so the records reach your handlers
107+
whatever else happens. osw's own handler notices that something above it is
108+
listening, detaches itself so nothing is written twice, and gives back the
109+
level it had picked, so your level applies from then on. It makes no difference
110+
whether you configure logging before or after importing osw.
111+
112+
A level you asked for is kept across that hand-over, so `set_log_level("DEBUG")`
113+
or `OSW_LOG_LEVEL=DEBUG` is how you pull osw's debug records into an aggregated
114+
setup while the rest of your application stays quieter.
115+
116+
One case osw cannot detect is a handler added to the `osw` logger itself, since
117+
that is indistinguishable from one of its own. Call `disable_logging()` first if
118+
you do that.
119+
120+
### Output from parallel batches
121+
122+
Several osw calls process their input in parallel. What such a task prints, as
123+
opposed to logs, is collected while the batch runs and replayed afterwards, so
124+
that concurrent writing cannot garble the progress bar. That text arrives on the
125+
`osw.parallel.output` logger, one record per line, at INFO. Give that logger its
126+
own level or handler to keep the output of third-party code apart from osw's own
127+
records. Most osw calls replay it only when you pass `debug=True`; `copy_pages`
128+
always replays.
129+
67130
## Examples and tutorials
68131

69132
- Runnable scripts in

‎pyproject.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ name = "osw"
33
description = "Python toolset for data processing, queries, wikicode generation and page manipulation"
44
authors = [{ name = "OpenSemanticWorld", email = "team@opensemantic.world" }]
55
readme = "README.md"
6-
license = "AGPL-3.0-or-later"
6+
license = "Apache-2.0"
77
license-files = ["LICENSE.txt"]
88
requires-python = ">=3.10,<3.14"
99
# Managed by python-semantic-release (see [tool.semantic_release]). Do not
1010
# edit by hand; it is bumped automatically on merge to main.
11-
version = "2.3.3"
11+
version = "2.5.1"
1212
classifiers = [
1313
"Development Status :: 3 - Alpha",
1414
"Intended Audience :: Developers",

0 commit comments

Comments
 (0)