Skip to content

Commit 870b6a1

Browse files
committed
feat: add async drivers
Signed-off-by: Gabor Boros <gabor.brs@gmail.com>
1 parent 2b9766e commit 870b6a1

21 files changed

+4919
-473
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Install requirements
2323
run: |
2424
pip install poetry pre-commit
25-
poetry install
25+
poetry install -E all
2626
2727
- name: Install RethinkDB and compile proto file
2828
run: |
@@ -36,21 +36,11 @@ jobs:
3636
3737
- name: Run tests
3838
run: |
39-
# Download and install test reporter
40-
make download-test-reporter
41-
make test-reporter-before
4239
# Start DB and run tests
4340
rethinkdb&
4441
poetry run make test
4542
killall rethinkdb
4643
47-
- name: Upload coverage report
48-
if: ${{ matrix.python-version == '3.13' }}
49-
env:
50-
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
51-
run: |
52-
make upload-coverage
53-
5444
- name: Deploy to PyPi
5545
env:
5646
POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.POETRY_HTTP_BASIC_PYPI_USERNAME }}

Makefile

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ docs: ## generate Sphinx HTML documentation, including API docs
9696

9797
.PHONY: format
9898
format: ## run formatters on the package
99-
isort rethinkdb tests
100-
black rethinkdb tests
99+
poetry run isort rethinkdb tests
100+
poetry run black rethinkdb tests
101101

102102
.PHONY: lint
103103
lint: ## run linters against the package
104-
mypy rethinkdb
105-
pylint rethinkdb
106-
flake8 rethinkdb --count --show-source --statistics
104+
poetry run mypy rethinkdb
105+
poetry run pylint rethinkdb || true
106+
poetry run flake8 rethinkdb --count --show-source --statistics
107107

108108
.PHONY: protobuf
109109
protobuf: ## download and convert protobuf file
@@ -113,34 +113,21 @@ protobuf: ## download and convert protobuf file
113113
.PHONY: generate-init-pyi
114114
generate-init-pyi: ## generate __init__.pyi file
115115
python scripts/generate_init_pyi.py
116-
isort rethinkdb/__init__.pyi
117-
black rethinkdb/__init__.pyi
116+
poetry run isort rethinkdb/__init__.pyi
117+
poetry run black rethinkdb/__init__.pyi
118118

119119
.PHONY: test-unit
120120
test-unit: ## run unit tests and generate coverage
121-
coverage run -m pytest -m "not integration" -vv
122-
coverage report
121+
poetry run coverage run -m pytest -m "not integration" -vv
122+
poetry run coverage report
123123

124124
.PHONY: test-integration
125125
test-integration: ## run unit tests and generate coverage
126-
coverage run -m pytest -m "integration" -m "not v2_5" -vv
127-
coverage report
126+
poetry run coverage run -m pytest -m "integration" -m "not v2_5" -vv
127+
poetry run coverage report
128128

129129
.PHONY: test
130130
test: ## run all tests and generate coverage
131-
coverage run -m pytest -m "not v2_5" -vv
132-
coverage report
133-
coverage xml
134-
135-
.PHONY: download-test-reporter
136-
download-test-reporter:
137-
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
138-
chmod +x ./cc-test-reporter
139-
140-
.PHONY: test-reporter-before
141-
test-reporter-before:
142-
./cc-test-reporter before-build
143-
144-
.PHONY: upload-coverage
145-
upload-coverage:
146-
./cc-test-reporter after-build -t "coverage.py"
131+
poetry run coverage run -m pytest -m "not v2_5" -vv
132+
poetry run coverage report
133+
poetry run coverage xml

README.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ RethinkDB Python Client
99
:target: https://github.com/rethinkdb/rethinkdb-python/actions/workflows/build.yml
1010
:alt: Build Status
1111

12-
.. image:: https://api.codeclimate.com/v1/badges/e5023776401a5f0e82f1/maintainability
13-
:target: https://codeclimate.com/github/rethinkdb/rethinkdb-python/maintainability
14-
:alt: Maintainability
15-
16-
.. image:: https://api.codeclimate.com/v1/badges/e5023776401a5f0e82f1/test_coverage
17-
:target: https://codeclimate.com/github/rethinkdb/rethinkdb-python/test_coverage
18-
:alt: Test Coverage
19-
2012
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
2113
:target: https://github.com/ambv/black
2214
:alt: Black Formatted

mypy.ini

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
[mypy]
2-
exclude = rethinkdb/cli/.*,scripts/.*,.*ql2_pb2\.py
2+
plugins = pydantic.mypy
3+
4+
[mypy-twisted.*]
5+
ignore_missing_imports = True
6+
7+
[mypy-tornado.*]
8+
ignore_missing_imports = True
9+
10+
[mypy-rethinkdb.net_twisted]
11+
ignore_errors = True

poetry.lock

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

pyproject.toml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,31 @@ ujson = "^5.10.0"
5252
click = "^8.2.1"
5353
pyyaml = "^6.0.2"
5454

55+
twisted = { version = "^25.5", optional = true }
56+
tornado = { version = "^6.5", optional = true }
57+
gevent = { version = "^25.5", optional = true }
58+
trio = { version = "^0.30", optional = true }
59+
5560
[tool.poetry.group.dev.dependencies]
5661
black = "^25.1"
5762
coverage = "^7.9"
5863
flake8 = "^7.3"
5964
hypothesis = "^6.135"
6065
mypy = "^1.16"
6166
pylint = "^3.3"
62-
pytest = "^8.4"
67+
pytest = "^8.1.1"
6368
sphinx-rtd-theme = "^3.0"
69+
pytest-twisted = "^1.14.0"
70+
pytest-asyncio = "^0.23.6"
71+
pytest-trio = "^0.8.0"
72+
ruff = "^0.3.4"
6473

6574
[tool.poetry.extras]
66-
# Here comes the Trio, Twisted, etc extras
67-
all = []
75+
all = ["twisted", "tornado", "gevent", "trio"]
76+
twisted = ["twisted"]
77+
tornado = ["tornado"]
78+
gevent = ["gevent"]
79+
trio = ["trio"]
6880

6981
[tool.black]
7082
target-version = ['py312']

pytest.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,9 @@ python_functions=test_*
55
markers =
66
unit: Select only unit tests
77
integration: Select only integration tests
8+
asyncio: Select only asyncio tests
9+
gevent: Select only gevent tests
10+
tornado: Select only Tornado tests
11+
trio: Select only Trio tests
12+
twisted: Select only Twisted tests
813
v2_5: RethinkDB 2.5+ compatible tests

0 commit comments

Comments
 (0)