Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Extract python driver #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Jul 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2018 RebirthDB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

root = true

[*]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
end_of_line = lf

[LICENSE]
insert_final_newline = false

[Makefile]
indent_style = tab
74 changes: 72 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,73 @@
dist
rethinkdb.egg-info
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# pyenv
.python-version

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
virtualenv/

# RebirthDB
rethinkdb/ql2_pb2.py
rethinkdb/*.proto

# Editors
.vscode/
.idea/
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sudo: false
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"

before_script: make prepare
script: tox
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2018 RebirthDB

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
65 changes: 61 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,63 @@
# Copyright 2014 RethinkDB, all rights reserved.
# Copyright 2018 RebirthDB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

OVERRIDE_GOALS := clean=py-clean publish=py-publish sdist=py-sdist bdist=py-bdist install=py-install default-goal=py-driver
.PHONY: default help clean prepare package publish

PACKAGE_NAME = rethinkdb

BUILD_DIR = ./build
PACKAGE_DIR = ${BUILD_DIR}/package

PROTO_FILE_NAME = ql2.proto
PROTO_FILE_URL = https://raw.githubusercontent.com/RebirthDB/rebirthdb/next/src/rdb_protocol/${PROTO_FILE_NAME}
TARGET_PROTO_FILE = ${PACKAGE_NAME}/${PROTO_FILE_NAME}

FILE_CONVERTER_NAME = convert_protofile.py
FILE_CONVERTER_URL = https://raw.githubusercontent.com/RebirthDB/rebirthdb/next/scripts/${FILE_CONVERTER_NAME}

CONVERTED_PROTO_FILE_NAME = ql2_pb2.py
TARGET_CONVERTED_PROTO_FILE = ${PACKAGE_NAME}/${CONVERTED_PROTO_FILE_NAME}


default: help

help:
@echo "Usage:"
@echo
@echo " make help Print this help message"
@echo " make test Run unit tests"
@echo " make clean Cleanup source directory"
@echo " make prepare Prepare ${PACKAGE_NAME} for build"
@echo " make package Build ${PACKAGE_NAME} package"
@echo " make publish Publish ${PACKAGE_NAME} package on PyPi"

clean:
@rm -rf \
${TARGET_PROTO_FILE} \
${TARGET_CONVERTED_PROTO_FILE} \
${BUILD_DIR}

prepare:
curl -qo ${TARGET_PROTO_FILE} ${PROTO_FILE_URL}
curl -qo ${FILE_CONVERTER_NAME} ${FILE_CONVERTER_URL}
python ./${FILE_CONVERTER_NAME} -l python -i ${TARGET_PROTO_FILE} -o ${TARGET_CONVERTED_PROTO_FILE}
rsync -av ./ ${BUILD_DIR} --filter=':- .gitignore'
cp ${TARGET_PROTO_FILE} ${BUILD_DIR}/${PACKAGE_NAME}

package: prepare
cd ${BUILD_DIR} && python ./setup.py sdist --dist-dir=$(abspath ${PACKAGE_DIR})

publish:
cd ${BUILD_DIR} && python ./setup.py register upload

TOP := ../..
include $(TOP)/Makefile
63 changes: 0 additions & 63 deletions build.mk

This file was deleted.

6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# CI requirements
tox-travis==0.10

# Test requirements
pytest==3.6.3
tox==3.1.1
2 changes: 0 additions & 2 deletions rethinkdb/.gitignore

This file was deleted.

19 changes: 18 additions & 1 deletion rethinkdb/version.py
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
version = '2.3.0.post3'
# Copyright 2018 RebirthDB
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an 'AS IS' BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This file incorporates work covered by the following copyright:
# Copyright 2010-2016 RethinkDB, all rights reserved.

version = '2.3.1'
23 changes: 23 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2018 RebirthDB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


[bdist_wheel]
universal = 1

[aliases]
test = pytest

[tool:pytest]
collect_ignore = ['setup.py']
Loading