Skip to content

Commit 4154f76

Browse files
gabor-boroslsabi
andcommitted
refactor!: port the driver to Python 3
This commit brings a major refactoring that affects every piece of the driver, mostly, in a backward-incompatible way. For the extensive list of changes, please refer to the CHANGELOG.rst. Co-authored-by: lsabi <[email protected]> Signed-off-by: Gabor Boros <[email protected]>
1 parent bc1a75a commit 4154f76

File tree

108 files changed

+10730
-11890
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+10730
-11890
lines changed

.bandit

-2
This file was deleted.

.coveragerc

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
[run]
2-
include = rethinkdb/*
2+
source = rethinkdb
3+
branch = True
4+
omit = *tests*
5+
*__init__*
6+
rethinkdb/ql2_pb2.py
37

48
[report]
5-
exclude_lines =
6-
pragma: no cover
7-
8-
def __unicode__
9-
def __repr__
10-
11-
omit =
12-
rethinkdb/version.py
13-
14-
show_missing = True
9+
sort = cover
10+
fail_under = 72
11+
exclude_lines = pragma: no cover
12+
if __name__ == .__main__.:

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# These are supported funding model platforms
23

34
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]

.github/PULL_REQUEST_TEMPLATE.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
**Reason for the change**
2+
23
If applicable, link the related issue/bug report or write down in few sentences the motivation.
34

45
**Description**
6+
57
A clear and concise description of what did you changed and why.
68

79
**Code examples**
10+
811
If applicable, add code examples to help explain your changes.
912

1013
**Checklist**
14+
15+
- [ ] Unit tests created/updated
16+
- [ ] Documentation extended/updated
1117
- [ ] I have read and agreed to the [RethinkDB Contributor License Agreement](http://rethinkdb.com/community/cla/)
1218

1319
**References**
20+
1421
Anything else related to the change e.g. documentations, RFCs, etc.

.github/dependabot.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
version: 2
3+
updates:
4+
- package-ecosystem: pip
5+
directory: /
6+
schedule:
7+
interval: daily

.github/workflows/build.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
name: Build
3+
4+
on: [push, release]
5+
6+
jobs:
7+
build:
8+
name: Test Python ${{ matrix.python-version }}
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python-version: ['3.8']
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v3
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Install requirements
23+
run: |
24+
pip install poetry pre-commit
25+
poetry install
26+
27+
- name: Install RethinkDB and compile proto file
28+
run: |
29+
./scripts/install-db.sh
30+
make ql2.proto
31+
32+
- name: Run linters
33+
run: |
34+
pre-commit run --all-files
35+
poetry run make lint
36+
37+
- name: Run tests
38+
run: |
39+
# Download and install test reporter
40+
make download-test-reporter
41+
make test-reporter-before
42+
# Start DB and run tests
43+
rethinkdb&
44+
poetry run make test
45+
killall rethinkdb
46+
47+
- name: Upload coverage report
48+
if: ${{ matrix.python-version == '3.8' }}
49+
env:
50+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
51+
run: |
52+
make upload-coverage
53+
54+
- name: Deploy to PyPi
55+
env:
56+
POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.POETRY_HTTP_BASIC_PYPI_USERNAME }}
57+
POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.POETRY_HTTP_BASIC_PYPI_PASSWORD }}
58+
if: ${{ github.event_name == 'release' && matrix.python-version == '3.8' }}
59+
run: poetry publish --build

.github/workflows/codeql-analysis.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
# For most projects, this workflow file will not need changing; you simply need
3+
# to commit it to your repository.
4+
#
5+
# You may wish to alter this file to override the set of languages analyzed,
6+
# or to provide custom queries or build logic.
7+
#
8+
# ******** NOTE ********
9+
# We have attempted to detect the languages in your repository. Please check
10+
# the `language` matrix defined below to confirm you have the correct set of
11+
# supported CodeQL languages.
12+
#
13+
name: CodeQL
14+
15+
on:
16+
push:
17+
branches: [master]
18+
pull_request:
19+
# The branches below must be a subset of the branches above
20+
branches: [master]
21+
schedule:
22+
- cron: 28 8 * * 0
23+
24+
jobs:
25+
analyze:
26+
name: Analyze
27+
runs-on: ubuntu-latest
28+
permissions:
29+
actions: read
30+
contents: read
31+
security-events: write
32+
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
language: [python]
37+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
38+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
39+
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@v3
43+
44+
# Initializes the CodeQL tools for scanning.
45+
- name: Initialize CodeQL
46+
uses: github/codeql-action/init@v2
47+
with:
48+
languages: ${{ matrix.language }}
49+
# If you wish to specify custom queries, you can do so here or in a config file.
50+
# By default, queries listed here will override any specified in a config file.
51+
# Prefix the list here with "+" to use these queries and those in the config file.
52+
53+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
54+
# queries: security-extended,security-and-quality
55+
56+
57+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
58+
# If this step fails, then you should remove it and run the build manually (see below)
59+
- name: Autobuild
60+
uses: github/codeql-action/autobuild@v2
61+
62+
# ℹ️ Command-line programs to run using the OS shell.
63+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
64+
65+
# If the Autobuild fails above, remove it and uncomment the following three lines.
66+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
67+
68+
# - run: |
69+
# echo "Run, Build Application using script"
70+
# ./location_of_script_within_repo/buildscript.sh
71+
72+
- name: Perform CodeQL Analysis
73+
uses: github/codeql-action/analyze@v2

.gitignore

+34-15
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ __pycache__/
88

99
# Distribution / packaging
1010
.Python
11+
env/
1112
build/
1213
develop-eggs/
1314
dist/
@@ -23,7 +24,6 @@ wheels/
2324
*.egg-info/
2425
.installed.cfg
2526
*.egg
26-
MANIFEST
2727

2828
# PyInstaller
2929
# Usually these files are written by a python script from a template
@@ -47,30 +47,49 @@ coverage.xml
4747
.hypothesis/
4848
.pytest_cache/
4949

50-
# Translations
51-
*.mo
52-
*.pot
50+
# Sphinx documentation
51+
docs/_build/
52+
53+
# PyBuilder
54+
target/
55+
56+
# Jupyter Notebook
57+
.ipynb_checkpoints
5358

5459
# pyenv
5560
.python-version
5661

57-
# Environments
58-
*.pid
62+
# dotenv
5963
.env
64+
65+
# virtualenv
6066
.venv
61-
env/
6267
venv/
63-
ENV/
64-
env.bak/
65-
venv.bak/
6668
virtualenv/
69+
ENV/
6770

68-
# RethinkDB
69-
rethinkdb/ql2_pb2.py
70-
rethinkdb/*.proto
71-
rethinkdb_data/
72-
rebirthdb_data/
71+
# Rope project settings
72+
.ropeproject
73+
74+
# mkdocs documentation
75+
/site
76+
77+
# mypy
78+
.mypy_cache/
7379

7480
# Editors
7581
.vscode/
7682
.idea/
83+
84+
# Misc
85+
.DS_Store
86+
TODO
87+
88+
# rethinkdb
89+
examples/
90+
rethinkdb_data/
91+
rethinkdb/ql2_pb2.py
92+
ql2.proto
93+
94+
# test reporter
95+
cc-test-reporter

.pre-commit-config.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
# See https://pre-commit.com for more information
3+
# See https://pre-commit.com/hooks.html for more hooks
4+
5+
default_stages: [commit, push]
6+
fail_fast: false
7+
repos:
8+
- repo: https://github.com/pre-commit/pre-commit-hooks
9+
rev: v4.2.0
10+
hooks:
11+
- id: trailing-whitespace
12+
- id: end-of-file-fixer
13+
- id: check-toml
14+
- id: check-json
15+
- id: pretty-format-json
16+
- id: check-merge-conflict
17+
- id: check-added-large-files
18+
19+
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt.git
20+
rev: 0.2.1
21+
hooks:
22+
- id: yamlfmt

.travis.yml

-38
This file was deleted.

AUTHORS.rst

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
=======
2+
Credits
3+
=======
4+
5+
Contributors
6+
------------
7+
8+
Check the whole list of contributors here_.
9+
10+
.. _here: https://github.com/rethinkdb/rethinkdb-python/graphs/contributors

0 commit comments

Comments
 (0)