Skip to content

Commit e29f2f0

Browse files
committed
chore: fix docs generation and regen docs
Signed-off-by: Gabor Boros <gabor.brs@gmail.com>
1 parent 7e2dd6e commit e29f2f0

File tree

10 files changed

+771
-634
lines changed

10 files changed

+771
-634
lines changed

CHANGELOG.rst

Lines changed: 97 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,118 @@ The format is based on `Keep a Changelog`_, and this project adheres to
1616
Unreleased_
1717
-----------
1818

19+
This is a major release that brings significant improvements including Python 3 support, async drivers, enhanced CLI tools, and comprehensive modernization of the codebase. This release is **NOT backward compatible** with 2.4.x.
20+
1921
Added
2022
~~~~~
2123

22-
* `ValueError` raised by `ReqlTimeoutError` and `ReqlAuthError` if only host or port set
23-
* New error type for invalid handshake state: `InvalidHandshakeStateError`
24+
* **Python 3 Support**: Full Python 3 compatibility with support for Python 3.10+
25+
* **Async Drivers**: Ported async/await support for multiple event loop implementations:
26+
* `rethinkdb.net_asyncio` - Native asyncio support with async/await syntax and `Connection` API
27+
* `rethinkdb.net_gevent` - Gevent-based async support with `Connection` API
28+
* `rethinkdb.net_tornado` - Tornado integration using `IOLoop` and `Connection` API
29+
* `rethinkdb.net_trio` - Trio support with `Connection` API
30+
* `rethinkdb.net_twisted` - Twisted integration with `inlineCallbacks` and `Connection` API
31+
* **CLI Tools (Click-based)**:
32+
* `rethinkdb dump`, `export`, `import`, `index-rebuild`, `repl`, `restore`
33+
* All commands accept common flags/options: `-q/--quiet`, `--debug`, `-c/--connect`, `--driver-port`, `--host-name`, `-u/--user`, `-p/--password`, `--password-file`, `--tls-cert`
34+
* `export` supports `--format json|csv|ndjson|jsongz`, `--delimiter` (CSV), `--compression-level` (jsongz), `--fields`, `--clients`, `--read-outdated`
35+
* **Type Hints**: Extensive typing across modules
36+
* **Modern Build/Packaging**: `pyproject.toml` + Poetry
37+
* **Tests**: New integration tests for each async driver: `tests/integration/test_net_{asyncio,gevent,tornado,trio,twisted}.py`
38+
* **Documentation**: Sphinx docs under `docs/` with API, history, and vulnerabilities
39+
* **CI/CD**: GitHub Actions workflows; pre-commit hooks for linting/formatting
40+
* **Protocol Buffer**: `rethinkdb/ql2_pb2.py` now tracked in VCS
2441

2542
Changed
2643
~~~~~~~
2744

28-
* QueryPrinter's `print_query` became a property and renamed to `query`
29-
* QueryPrinter's `print_carrots` became a property and renamed to `carrots`
30-
* Renamed `ReqlAvailabilityError` to `ReqlOperationError`
31-
* Extract REPL helper class to a separate file
32-
* `HandshakeV1_0` is waiting `bytes` for `username` and `password` attributes instead of `str`
33-
* `HandshakeV1_0` defines `username` and `password` attributes as protected attributes
34-
* `HandshakeV1_0` has a hardcoded `JSONEncoder` and `JSONDecoder` from now on
35-
* `HandshakeV1_0` raises `InvalidHandshakeStateError` when an unrecognized state called in `next_message`
36-
* Moved `ReQLEncoder`, `ReQLDecoder`, `recursively_make_hashable` to `encoder` module
37-
* Moved `T` to `utilities` to module and renamed to `EnhancedTuple`
38-
* Renamed `EnhancedTuple`/`T`'s `intsp` parameter to `int_separator`
39-
* Renamed `recursively_make_hashable` to `make_hashable`
40-
* Renamed `optargs` to `kwargs` in `ast` module
41-
* Renamed internal `_continue` method of connection to `resume` to make it public
42-
* Internal `_stop`, `_continue` methods of `Connection` became public
43-
* Renamed internal `_error` to `raise_error`
44-
* Internal `_extend`, `_error` of `Cursor` became public
45-
* Renamed `Rql*` to `Reql*`
45+
API and behavior changes (including breaking changes) compared to 2.4.x:
46+
47+
* **Namespace and Entry Point**:
48+
* The `r` entry point is now a `SimpleNamespace` exposing query helpers in `rethinkdb/__init__.py`
49+
* A lightweight `Client` wrapper is provided to manage connection loop types via `set_loop_type()`
50+
* **Exceptions and Error Handling**:
51+
* Renamed `Rql*` to `Reql*` across the codebase; removed `Rql*` aliases
52+
* Introduced `InvalidHandshakeStateError` for invalid handshake transitions
53+
* `ReqlAuthError` raises `ValueError` if only host or only port is provided; includes host:port in message if both are provided
54+
* `ReqlTimeoutError` now subclasses `TimeoutError` and mirrors `ReqlAuthError` host/port validation and messaging
55+
* **QueryPrinter (errors.QueryPrinter)**:
56+
* `print_query` -> property `query`
57+
* `print_carrots` -> property `carets`
58+
* Error messages now embed composed query and caret markers
59+
* **Handshake (`rethinkdb.handshake.HandshakeV1_0`)**:
60+
* Uses protected attributes for credentials: `__username`, `__password`
61+
* Username is escaped as per RFC (`,` => `=2C`, `=` => `=3D`)
62+
* Accepts optional `json_encoder`/`json_decoder` (defaults to `json.JSONEncoder`/`json.JSONDecoder`)
63+
* Raises `ReqlAuthError` for auth failures (error_code 10..20), `ReqlDriverError` for other handshake errors
64+
* Raises `InvalidHandshakeStateError` on unexpected/unknown state and on invalid transitions in `next_message`
65+
* Validates server protocol version range and server signature per SCRAM-SHA-256
66+
* **Encoder/Decoder (`rethinkdb.encoder`)**:
67+
* Introduced `ReqlEncoder` and `ReqlDecoder` classes
68+
* Moved pseudo-type conversions here (TIME, BINARY, GROUPED_DATA)
69+
* Renamed utility `recursively_make_hashable` -> `make_hashable`
70+
* **Utilities**:
71+
* Moved `T` to `rethinkdb.utils.EnhancedTuple` and renamed parameter `intsp` -> `int_separator`
72+
* `utilities.py` renamed/moved to `utils.py`
73+
* **AST (`rethinkdb.ast`)**:
74+
* Renamed internal `optargs` to `kwargs` consistently across query node implementations
75+
* Query operators improved for infix precedence; better error hints for misuse (e.g., `a < b | b < c`)
76+
* `__str__` of queries now uses `QueryPrinter(self).query`
77+
* **Cursor/Connection (`rethinkdb.net`)**:
78+
* `Connection.resume(cursor)` replaces `_continue` (now public)
79+
* `Connection.stop(cursor)` replaces `_stop` (now public)
80+
* `Cursor.extend(...)` made public (from `_extend`)
81+
* `Cursor.raise_error(...)` replaces `_error` (now public)
82+
* Improved wait/timeout behavior and state tracking
83+
* **CLI**:
84+
* Subcommand name standardized to `index-rebuild` (was `index_rebuild`)
85+
* Logging unified; progress reporting moved to logger-based updates
86+
* **Build/Tooling**:
87+
* Replaced `setup.py`/`requirements.txt` with Poetry; consistent formatting (black) and linting (flake8, pylint)
88+
* Updated supported Python versions; CI matrix adjusted
4689

4790
Fixed
4891
~~~~~
4992

50-
* Fixed a potential "no-member" error of `RqlBoolOperatorQuery`
51-
* Fixed variety of quality issues in `ast` module
93+
* Binary response parsing in network layer (`encoder.py`, `net.py`)
94+
* Numerous linter and mypy findings across `ast`, `net`, and CLI modules
95+
* Circular import issues and import path clean-ups
96+
* Error propagation and context in async operations
97+
* Potential memory leaks in connection handling and cursors
5298

5399
Removed
54100
~~~~~~~
55101

56-
* Errors are not re-exported as `__all__` for `rethinkdb`
57-
* Removed `Rql*` aliases for `Reql*` exceptions
58-
* Removed `auth_key` in favor of `password` in connection params
102+
* Python 2 support dropped completely
103+
* Legacy CLI scripts removed; replaced by Click-based `rethinkdb/cli/*`
104+
* Deprecated modules removed:
105+
* `rethinkdb/backports/*` (SSL hostname matching backports)
106+
* `rethinkdb/logger.py`, `rethinkdb/helpers.py`, `rethinkdb/docs.py`
107+
* Old dependencies and tooling removed (bandit, legacy CI scripts)
108+
* Travis CI replaced with GitHub Actions
109+
* `setup.py` and `requirements.txt` removed in favor of `pyproject.toml` and Poetry lockfile
110+
* Top-level re-export of errors via package `__all__` removed; import from `rethinkdb.errors` instead
111+
* `auth_key` parameter removed in favor of `password` for connections
112+
* `Rql*` exception aliases removed (use `Reql*`)
113+
114+
Deprecated
115+
~~~~~~~~~~
116+
117+
* `ReqlQuery.to_json_string()` is an alias for `to_json()` and will be removed in a future release
118+
119+
Migration Guide
120+
~~~~~~~~~~~~~~
121+
122+
For users upgrading from 2.4.x to 2.5.0:
123+
124+
1. **Python**: Use Python 3.7+.
125+
2. **Imports**: Update imports for moved modules (e.g., utilities now in `rethinkdb.utils`).
126+
3. **Exceptions**: Replace `Rql*` with `Reql*`. Adjust error handling for `ReqlAuthError`/`ReqlTimeoutError` host/port validation.
127+
4. **Handshake**: If customizing JSON encoding/decoding during handshake, pass `json_encoder`/`json_decoder` to `HandshakeV1_0`.
128+
5. **CLI**: Use `index-rebuild` (hyphen), and the standardized flags listed above.
129+
6. **Connection/Cursor**: Use public `Connection.resume`, `Connection.stop`, `Cursor.extend`, and `Cursor.raise_error`.
130+
7. **Queries**: If relying on `optargs`, update to `kwargs`. Prefer `to_json()` over `to_json_string()`.
59131

60132
.. EXAMPLE CHANGELOG ENTRY
61133

CONTRIBUTING.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Get Started!
6565

6666
Ready to contribute? Here's how to set up `rethinkdb`'s Python client for local development.
6767

68-
As `step 0` make sure you have python 3.7+, [https://python-poetry.org/](poetry) and [https://pre-commit.com/](pre-commit) installed.
68+
As `step 0` make sure you have python 3.10+, [https://python-poetry.org/](poetry) and [https://pre-commit.com/](pre-commit) installed.
6969

7070
1. Fork the `rethinkdb-python` repo on GitHub.
7171
2. Clone your fork locally::
@@ -116,7 +116,7 @@ Before you submit a pull request, check that it meets these guidelines:
116116
2. If the pull request adds functionality, the docs should be updated. Put
117117
your new functionality into a function with a docstring, and add the
118118
feature to the list in README.rst.
119-
3. The pull request should work for Python 3.7 and 3.8.
119+
3. The pull request should work for Python 3.10+.
120120

121121
Releasing
122122
---------

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ clean-test: ## remove test and coverage artifacts
8888
docs: ## generate Sphinx HTML documentation, including API docs
8989
rm -f docs/rethinkdb.rst
9090
rm -f docs/modules.rst
91-
poetry export --E all --dev -f requirements.txt > docs/requirements.txt
92-
sphinx-apidoc -o docs/ rethinkdb
93-
$(MAKE) -C docs clean
94-
$(MAKE) -C docs html
91+
poetry export -E all --dev -f requirements.txt > docs/requirements.txt
92+
poetry run sphinx-apidoc -o docs/ rethinkdb
93+
poetry run $(MAKE) -C docs clean
94+
poetry run $(MAKE) -C docs html
9595
$(BROWSER) docs/_build/html/index.html
9696

9797
.PHONY: format

README.rst

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,25 @@ can tell the database to continuously push updated query results to applications
1919
RethinkDB allows developers to build scalable realtime apps in a fraction of the time with
2020
less effort.
2121

22-
Utility Tools
23-
============
24-
If you came here looking for an utility tool, this functionality has been dropped during the porting from python 2 to 3.
25-
Instead, you should look (and we suggest to use) https://github.com/BOOMfinity-Developers/GoThink
26-
22+
Utility Scripts
23+
===============
24+
RethinkDB Python Client prodvices a set of utility scripts to help you manage your RethinkDB
25+
database.
26+
27+
* `rethinkdb dump` / `rethinkdb-dump` - Dump a database to a file
28+
* `rethinkdb export` / `rethinkdb-export` - Export a table to a file
29+
* `rethinkdb import` / `rethinkdb-import` - Import a table from a file
30+
* `rethinkdb index-rebuild` / `rethinkdb-index-rebuild` - Rebuild all indexes
31+
* `rethinkdb repl` / `rethinkdb-repl` - Start a REPL session
32+
* `rethinkdb restore` / `rethinkdb-restore` - Restore a database from a file
2733

2834
Installation
2935
============
3036

3137
RethinkDB's Python Client can be installed by running ``pip install rethinkdb`` and it requires
32-
Python 3.7.0+ to run. This is the preferred method to install RethinkDB Python client, as it
33-
will always install the most recent stable release. If you don't have `pip`_
34-
installed, this `Python installation guide`_ can guide
35-
you through the process.
38+
Python 3.10+ to run. This is the preferred method to install RethinkDB Python client, as it will
39+
always install the most recent stable release. If you don't have `pip`_ installed, this
40+
`Python installation guide`_ can guide you through the process.
3641

3742
.. _pip: https://pip.pypa.io
3843
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/

0 commit comments

Comments
 (0)