From eb4bc41d2c786f24c51af6897c6a86b214dfa8fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Thu, 12 Jul 2018 13:07:40 +0200 Subject: [PATCH 01/24] Adding editor config --- .editorconfig | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..d4a2c440 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,21 @@ +# http://editorconfig.org + +root = true + +[*] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true +insert_final_newline = true +charset = utf-8 +end_of_line = lf + +[*.bat] +indent_style = tab +end_of_line = crlf + +[LICENSE] +insert_final_newline = false + +[Makefile] +indent_style = tab From 12f3c0beb3114f9f628485a0f5be00e553b25d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Thu, 12 Jul 2018 13:08:09 +0200 Subject: [PATCH 02/24] Extend gitignore --- .gitignore | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e21c3d1f..63e6fa9f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,67 @@ -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/ + +# RebirthDB rethinkdb/ql2_pb2.py From eb8966a28c5157e8775d8051e2f47b9837fb9d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Thu, 12 Jul 2018 13:08:27 +0200 Subject: [PATCH 03/24] Adding test requirements file --- requirements-test.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 requirements-test.txt diff --git a/requirements-test.txt b/requirements-test.txt new file mode 100644 index 00000000..47407120 --- /dev/null +++ b/requirements-test.txt @@ -0,0 +1,2 @@ +pytest==3.6.3 +tox==3.1.1 From 4ed593fa6d8025da4785fc2a0a375152ae70655c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Thu, 12 Jul 2018 13:09:50 +0200 Subject: [PATCH 04/24] Adding tox and pytest configuration. Also extend setup.py --- setup.cfg | 21 +++++++++++++++++++++ setup.py | 24 +++++++++++++++++++++++- tox.ini | 27 +++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 setup.cfg create mode 100644 tox.ini diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..ffa02ea9 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,21 @@ +[bumpversion] +current_version = {{ cookiecutter.version }} +commit = True +tag = True + +[bumpversion:file:setup.py] +search = version='{current_version}' +replace = version='{new_version}' + +[bumpversion:file:rethinkdb/__init__.py] +search = __version__ = '{current_version}' +replace = __version__ = '{new_version}' + +[bdist_wheel] +universal = 1 + +[aliases] +test = pytest + +[tool:pytest] +collect_ignore = ['setup.py'] diff --git a/setup.py b/setup.py index 1c6f47b6..2e7680c9 100644 --- a/setup.py +++ b/setup.py @@ -24,6 +24,15 @@ conditionalPackages = ['rethinkdb.asyncio_net'] except ImportError: pass +setup_requirements = [ + 'pytest-runner' +] + +test_requirements = [ + 'pytest' +] + + setuptools.setup( name="rethinkdb", zip_safe=True, @@ -33,6 +42,16 @@ url="http://rethinkdb.com", maintainer="RethinkDB Inc.", maintainer_email="bugs@rethinkdb.com", + classifiers=[ + 'Intended Audience :: Developers', + 'Natural Language :: English', + "Programming Language :: Python :: 2", + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + ], packages=[ 'rethinkdb', 'rethinkdb.tornado_net', @@ -52,5 +71,8 @@ 'rethinkdb-index-rebuild = rethinkdb._index_rebuild:main', 'rethinkdb-repl = rethinkdb.__main__:startInterpreter' ] - } + }, + setup_requires=setup_requirements, + test_suite='tests', + tests_require=test_requirements ) diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..066f378d --- /dev/null +++ b/tox.ini @@ -0,0 +1,27 @@ +[tox] +envlist = py27, py33, py34, py35, py36, flake8 +skipsdist = {env:TOXBUILD:false} + +[flake8] +max-line-length = 121 +import-order-style = google +exclude = + .git, + __pycache__, + build, + dist + +[testenv] +passenv = LANG +setenv = + PYTHONPATH = {toxinidir} +deps = + -r{toxinidir}/requirements-test.txt +commands = {env:TOXBUILD:pytest} + +[testenv:flake8] +basepython = python +deps = + flake8 + flake8-import-order +commands = flake8 rethinkdb From 44965acd3a566b43fcd47ad5a97fc369a1bb84db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Thu, 12 Jul 2018 13:10:18 +0200 Subject: [PATCH 05/24] Adding dummy test to be able to run unit tests --- tests/__init__.py | 0 tests/test_dummy.py | 9 +++++++++ 2 files changed, 9 insertions(+) create mode 100644 tests/__init__.py create mode 100644 tests/test_dummy.py diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/test_dummy.py b/tests/test_dummy.py new file mode 100644 index 00000000..8c281116 --- /dev/null +++ b/tests/test_dummy.py @@ -0,0 +1,9 @@ +class TestDummy(object): + def setup_method(self, test_method): + pass + + def teardown_method(self, test_method): + pass + + def test_true(self): + assert True From 90dee9504abb834675567d0af33afb171edc65c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Thu, 12 Jul 2018 13:11:00 +0200 Subject: [PATCH 06/24] Extend gitignore to exclude virtualenv --- .circleci/config.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..ca714e15 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,10 @@ +version: 2 + +jobs: + build: + working_directory: ~/repo + docker: + - image: themattrix/tox + steps: + - checkout + - run: tox From ba72e1d8dfc18b95b9c5783e9cb384c47128261f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Thu, 12 Jul 2018 13:11:43 +0200 Subject: [PATCH 07/24] Revert "Extend gitignore to exclude virtualenv" This reverts commit 90dee9504abb834675567d0af33afb171edc65c8. --- .circleci/config.yml | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index ca714e15..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,10 +0,0 @@ -version: 2 - -jobs: - build: - working_directory: ~/repo - docker: - - image: themattrix/tox - steps: - - checkout - - run: tox From dc09bc83d169d7555912496881ace3d2ff768300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Thu, 12 Jul 2018 13:12:26 +0200 Subject: [PATCH 08/24] Extend gitignore to exclude virtualenv --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 63e6fa9f..809b3178 100644 --- a/.gitignore +++ b/.gitignore @@ -62,6 +62,7 @@ venv/ ENV/ env.bak/ venv.bak/ +virtualenv/ # RebirthDB rethinkdb/ql2_pb2.py From 2c0309e4a86f251a8ba3cbabf86e872b5f2c85aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Thu, 12 Jul 2018 13:46:38 +0200 Subject: [PATCH 09/24] remove boilerplate from setup.cfg --- setup.cfg | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/setup.cfg b/setup.cfg index ffa02ea9..1ad91ccc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,16 +1,3 @@ -[bumpversion] -current_version = {{ cookiecutter.version }} -commit = True -tag = True - -[bumpversion:file:setup.py] -search = version='{current_version}' -replace = version='{new_version}' - -[bumpversion:file:rethinkdb/__init__.py] -search = __version__ = '{current_version}' -replace = __version__ = '{new_version}' - [bdist_wheel] universal = 1 From 90df23b48499020ec19f29d9f64c6ae67cef0d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Thu, 12 Jul 2018 13:47:15 +0200 Subject: [PATCH 10/24] Adding circleci config --- .circleci/config.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..83402213 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,33 @@ +version: 2 + +jobs: + checkout: + working_directory: ~/rebirthdb-python + docker: + - image: themattrix/tox + steps: + - checkout + - save_cache: + key: repo-{{ .Environment.CIRCLE_SHA1 }} + paths: + - ~/rebirthdb-python + + unit_test: + working_directory: ~/rebirthdb-python + docker: + - image: themattrix/tox + steps: + - restore_cache: + keys: + - repo-{{ .Environment.CIRCLE_SHA1 }} + - run: tox + + +workflows: + version: 2 + pull_request_test: + jobs: + - checkout_code + - unit_test: + requires: + - checkout_code From d0df4bfc0640dad7eda46fec2304dcb6dd915d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Thu, 12 Jul 2018 13:52:08 +0200 Subject: [PATCH 11/24] Ignore to run pull_request_test on master --- .circleci/config.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 83402213..ea72a9c7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,7 +27,13 @@ workflows: version: 2 pull_request_test: jobs: - - checkout_code + - checkout_code: + filters: + branches: + ignore: master - unit_test: + filters: + branches: + ignore: master requires: - checkout_code From 1b7dc13ab418b66485d5c15c1bfbda9fa3a79994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Mon, 16 Jul 2018 09:46:31 +0200 Subject: [PATCH 12/24] Remove cirtcleCI configuration --- .circleci/config.yml | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index ea72a9c7..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,39 +0,0 @@ -version: 2 - -jobs: - checkout: - working_directory: ~/rebirthdb-python - docker: - - image: themattrix/tox - steps: - - checkout - - save_cache: - key: repo-{{ .Environment.CIRCLE_SHA1 }} - paths: - - ~/rebirthdb-python - - unit_test: - working_directory: ~/rebirthdb-python - docker: - - image: themattrix/tox - steps: - - restore_cache: - keys: - - repo-{{ .Environment.CIRCLE_SHA1 }} - - run: tox - - -workflows: - version: 2 - pull_request_test: - jobs: - - checkout_code: - filters: - branches: - ignore: master - - unit_test: - filters: - branches: - ignore: master - requires: - - checkout_code From a3ece581bc1427b130741806e5b1a01e4c978801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Mon, 16 Jul 2018 09:46:55 +0200 Subject: [PATCH 13/24] Rename requirements.txt --- requirements-test.txt | 2 -- requirements.txt | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) delete mode 100644 requirements-test.txt create mode 100644 requirements.txt diff --git a/requirements-test.txt b/requirements-test.txt deleted file mode 100644 index 47407120..00000000 --- a/requirements-test.txt +++ /dev/null @@ -1,2 +0,0 @@ -pytest==3.6.3 -tox==3.1.1 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..cfe5bbd3 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +# CI requirements +tox-travis==0.10 + +# Test requirements +pytest==3.6.3 +tox==3.1.1 From 8f286a71c5f22490582221c7a19f2b8266a20b84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Mon, 16 Jul 2018 09:47:15 +0200 Subject: [PATCH 14/24] Add Copyright to editorconfig --- .editorconfig | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.editorconfig b/.editorconfig index d4a2c440..e41cc6f2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,16 @@ -# http://editorconfig.org +# 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 @@ -10,10 +22,6 @@ insert_final_newline = true charset = utf-8 end_of_line = lf -[*.bat] -indent_style = tab -end_of_line = crlf - [LICENSE] insert_final_newline = false From 11ed635a7d28ee75fbc02eb359bd16fda5d65acd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Mon, 16 Jul 2018 09:47:28 +0200 Subject: [PATCH 15/24] Create travisCI configuration --- .travis.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..4e59089a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +sudo: false +language: python +python: + - "2.7" + - "3.3" + - "3.4" + - "3.5" + - "3.6" + +install: pip install -r requirements.txt +script: tox From bd2ba2ff72dfe3941f174acbf21fa7ebc7bf7c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Mon, 16 Jul 2018 09:49:42 +0200 Subject: [PATCH 16/24] Adding license notes and bump package version --- LICENSE | 13 +++++++++++++ rethinkdb/version.py | 19 ++++++++++++++++++- setup.cfg | 15 +++++++++++++++ tests/__init__.py | 13 +++++++++++++ tox.ini | 14 ++++++++++++++ 5 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..c17a2c5e --- /dev/null +++ b/LICENSE @@ -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. diff --git a/rethinkdb/version.py b/rethinkdb/version.py index 071546be..5654875d 100644 --- a/rethinkdb/version.py +++ b/rethinkdb/version.py @@ -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.4' diff --git a/setup.cfg b/setup.cfg index 1ad91ccc..da415b1c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,18 @@ +# 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 diff --git a/tests/__init__.py b/tests/__init__.py index e69de29b..e9c525c7 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -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. diff --git a/tox.ini b/tox.ini index 066f378d..ca3f1005 100644 --- a/tox.ini +++ b/tox.ini @@ -1,3 +1,17 @@ +# 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. + [tox] envlist = py27, py33, py34, py35, py36, flake8 skipsdist = {env:TOXBUILD:false} From 19efe69e10c24accd507f04f4b99b0ca7a1e9e7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Mon, 16 Jul 2018 09:51:24 +0200 Subject: [PATCH 17/24] Add Makefile to easily manage the package --- Makefile | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- build.mk | 63 ------------------------------------------------------ 2 files changed, 61 insertions(+), 67 deletions(-) delete mode 100644 build.mk diff --git a/Makefile b/Makefile index e11a5858..7ae5204b 100644 --- a/Makefile +++ b/Makefile @@ -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}.py -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 diff --git a/build.mk b/build.mk deleted file mode 100644 index 7bdfea97..00000000 --- a/build.mk +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2014 RethinkDB, all rights reserved. - -PY_SRC_DIR = $(TOP)/drivers/python -PY_BUILD_DIR = $(TOP)/build/drivers/python -PY_PKG_DIR = $(TOP)/build/packages/python - -PY_PROTO_FILE_NAME = ql2_pb2.py - -PY_PROTO_BUILD_FILE := $(PY_BUILD_DIR)/rethinkdb/$(PY_PROTO_FILE_NAME) -# convenience file for driver development -PY_PROTO_DEV_FILE := $(PY_SRC_DIR)/rethinkdb/$(PY_PROTO_FILE_NAME) - -PY_SRC_FILES := $(filter-out $(PY_SRC_DIR)/rethinkdb/$(PY_PROTO_FILE_NAME),$(shell find $(PY_SRC_DIR)/rethinkdb/ -type f ! -iname '*.pyc')) -PY_BUILD_FILES := $(patsubst $(PY_SRC_DIR)/rethinkdb/%,$(PY_BUILD_DIR)/rethinkdb/%,$(PY_SRC_FILES)) $(PY_PROTO_BUILD_FILE) - -.PHONY: py-driver -py-driver: $(PY_BUILD_FILES) $(PY_PROTO_DEV_FILE) | $(PY_BUILD_DIR)/. - -$(PY_BUILD_DIR)/rethinkdb/%: $(PY_SRC_DIR)/rethinkdb/% py_build_files - mkdir -p $(@D) - cp $< $@ - -.INTERMEDIATE: py_build_files -py_build_files: - $P CP $(PY_BUILD_DIR)/rethinkdb/ - -$(PY_PROTO_DEV_FILE) $(PY_PROTO_BUILD_FILE): $(PROTO_FILE_SRC) - $P CONVERT_PROTOFILE - mkdir -p $(dir $@) - $(PYTHON) $(TOP)/drivers/convert_protofile --language python --input-file $(PROTO_FILE_SRC) --output-file $@ - -$(PY_BUILD_DIR)/setup.py: $(PY_SRC_DIR)/setup.py | $(PY_BUILD_DIR) - $P CP - cp $< $@ - -.PHONY: py-clean -py-clean: - $P RM $(PY_BUILD_DIR) - rm -rf $(PY_BUILD_DIR) - $P RM $(PY_PKG_DIR) - rm -rf $(PY_PKG_DIR) - $P RM $(PY_PROTO_DEV_FILE) - rm -f $(PY_PROTO_DEV_FILE) - -.PHONY: py-sdist -py-sdist: py-driver $(PY_BUILD_DIR)/setup.py | $(PY_PKG_DIR)/. - $P SDIST - cd $(PY_BUILD_DIR) && $(PYTHON) setup.py sdist --dist-dir=$(abspath $(PY_PKG_DIR)) - -.PHONY: py-bdist -py-bdist: py-driver $(PY_BUILD_DIR)/setup.py | $(PY_PKG_DIR)/. - $P BDIST_EGG - cd $(PY_BUILD_DIR) && $(PYTHON) setup.py bdist_egg --dist-dir=$(abspath $(PY_PKG_DIR)) - -.PHONY: py-publish -py-publish: py-driver $(PY_BUILD_DIR)/setup.py | $(PY_PKG_DIR)/. - $P REGISTER SDIST - cd $(PY_BUILD_DIR) && $(PYTHON) setup.py register sdist --dist-dir=$(abspath $(PY_PKG_DIR)) upload - -.PHONY: py-install -py-install: py-driver $(PY_BUILD_DIR)/setup.py | $(PY_PKG_DIR)/. - $P INSTALL - cd $(PY_BUILD_DIR) && $(PYTHON) setup.py install From 641b685e749117566c051be6286a75098de2e6a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Mon, 16 Jul 2018 09:54:53 +0200 Subject: [PATCH 18/24] Add license notes and update setup py. New classifiers, name and testing --- setup.py | 72 +++++++++++++++++++++++++++----------------------------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/setup.py b/setup.py index 2e7680c9..b0ebd1a9 100644 --- a/setup.py +++ b/setup.py @@ -1,53 +1,51 @@ -# Copyright 2010-2015 RethinkDB, all rights reserved. -""" -Please see the following links for more information:: +# 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. -- `Python API documentation `_ -- `GitHub Project `_ -- `Python Driver Source `_ +''' -""" +''' -import os, setuptools, sys +import setuptools -modulePath = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'rethinkdb') -sys.path.insert(0, modulePath) -from version import version -sys.path.remove(modulePath) +try: + import asyncio + conditional_packages = ['rethinkdb.asyncio_net'] +except ImportError: + conditional_packages = [] -conditionalPackages = [] -if 'upload' in sys.argv: # ensure that uplodas always have everything while uploading to pypi - conditionalPackages = ['rethinkdb.asyncio_net'] -else: - try: # only add asyncio when it is supported per #4702 - import asyncio - conditionalPackages = ['rethinkdb.asyncio_net'] - except ImportError: pass - -setup_requirements = [ - 'pytest-runner' -] - -test_requirements = [ - 'pytest' -] +from rethinkdb.version import version setuptools.setup( - name="rethinkdb", + name='rebirthdb', zip_safe=True, version=version, - description="Python driver library for the RethinkDB database server.", + description='Python driver library for the RethinkDB database server.', long_description=__doc__, - url="http://rethinkdb.com", - maintainer="RethinkDB Inc.", - maintainer_email="bugs@rethinkdb.com", + url='https://github.com/RebirthDB/rebirthdb-python', + maintainer='RebirthDB.', + maintainer_email='bugs@rethinkdb.com', classifiers=[ 'Intended Audience :: Developers', 'Natural Language :: English', - "Programming Language :: Python :: 2", + 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', @@ -59,7 +57,7 @@ 'rethinkdb.gevent_net', 'rethinkdb.backports', 'rethinkdb.backports.ssl_match_hostname' - ] + conditionalPackages, + ] + conditional_packages, package_dir={'rethinkdb':'rethinkdb'}, package_data={ 'rethinkdb':['backports/ssl_match_hostname/*.txt'] }, entry_points={ @@ -72,7 +70,7 @@ 'rethinkdb-repl = rethinkdb.__main__:startInterpreter' ] }, - setup_requires=setup_requirements, + setup_requires=['pytest-runner'], test_suite='tests', - tests_require=test_requirements + tests_require=['pytest'] ) From 5fd03a1a5393e53bbf9864bf0d85c49a7e55338a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Mon, 16 Jul 2018 09:55:58 +0200 Subject: [PATCH 19/24] Remove unused gitignore and update the relevant one --- .gitignore | 4 ++++ rethinkdb/.gitignore | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) delete mode 100644 rethinkdb/.gitignore diff --git a/.gitignore b/.gitignore index 809b3178..ff58b3fc 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,7 @@ virtualenv/ # RebirthDB rethinkdb/ql2_pb2.py + +# Editors +.vscode/ +.idea/ diff --git a/rethinkdb/.gitignore b/rethinkdb/.gitignore deleted file mode 100644 index 4f67eee8..00000000 --- a/rethinkdb/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -ql2.proto - From 40dbb36e876f05f96d41af8d9ab131d8291fc95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Mon, 16 Jul 2018 10:02:40 +0200 Subject: [PATCH 20/24] Add proto files to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ff58b3fc..300d5763 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,7 @@ virtualenv/ # RebirthDB rethinkdb/ql2_pb2.py +rethinkdb/*.proto # Editors .vscode/ From c91c6af926f60ad7316b7eac55a28b8565cc0d63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Mon, 16 Jul 2018 10:11:38 +0200 Subject: [PATCH 21/24] Bump to the right version --- rethinkdb/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rethinkdb/version.py b/rethinkdb/version.py index 5654875d..f92fdbf4 100644 --- a/rethinkdb/version.py +++ b/rethinkdb/version.py @@ -15,4 +15,4 @@ # This file incorporates work covered by the following copyright: # Copyright 2010-2016 RethinkDB, all rights reserved. -version = '2.4' +version = '2.3.1' From 9d2bb8e813cc317d913ad77ecb5b944d12646b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Mon, 16 Jul 2018 10:23:16 +0200 Subject: [PATCH 22/24] Bump to the right version --- .travis.yml | 2 +- setup.py | 2 +- tox.ini | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4e59089a..f15cc9c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,5 +7,5 @@ python: - "3.5" - "3.6" -install: pip install -r requirements.txt +before_script: make prepare script: tox diff --git a/setup.py b/setup.py index b0ebd1a9..78f3ed4f 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ setuptools.setup( - name='rebirthdb', + name='rethinkdb', zip_safe=True, version=version, description='Python driver library for the RethinkDB database server.', diff --git a/tox.ini b/tox.ini index ca3f1005..e03485ce 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,7 @@ envlist = py27, py33, py34, py35, py36, flake8 skipsdist = {env:TOXBUILD:false} [flake8] -max-line-length = 121 +max-line-length = 120 import-order-style = google exclude = .git, @@ -30,7 +30,7 @@ passenv = LANG setenv = PYTHONPATH = {toxinidir} deps = - -r{toxinidir}/requirements-test.txt + -r{toxinidir}/requirements.txt commands = {env:TOXBUILD:pytest} [testenv:flake8] From 3a13a81666e38796bc626303ea0fef3cf156308a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Mon, 16 Jul 2018 18:16:33 +0200 Subject: [PATCH 23/24] Fix typo in makefile and disable flake8 temporarly --- Makefile | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7ae5204b..e10758f0 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ clean: prepare: curl -qo ${TARGET_PROTO_FILE} ${PROTO_FILE_URL} curl -qo ${FILE_CONVERTER_NAME} ${FILE_CONVERTER_URL} - python ./${FILE_CONVERTER_NAME}.py -l python -i ${TARGET_PROTO_FILE} -o ${TARGET_CONVERTED_PROTO_FILE} + 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} diff --git a/tox.ini b/tox.ini index e03485ce..66a41e57 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ # limitations under the License. [tox] -envlist = py27, py33, py34, py35, py36, flake8 +envlist = py27, py33, py34, py35, py36 #, flake8 skipsdist = {env:TOXBUILD:false} [flake8] From bd96594d439d04d56734cb990b9026495d0ff037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boros=20G=C3=A1bor?= Date: Mon, 16 Jul 2018 19:15:23 +0200 Subject: [PATCH 24/24] Remove Python 3.3 --- .travis.yml | 1 - setup.py | 1 - tox.ini | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f15cc9c4..1a3de248 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ sudo: false language: python python: - "2.7" - - "3.3" - "3.4" - "3.5" - "3.6" diff --git a/setup.py b/setup.py index 78f3ed4f..84a003f7 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,6 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', diff --git a/tox.ini b/tox.ini index 66a41e57..bbb9ef63 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ # limitations under the License. [tox] -envlist = py27, py33, py34, py35, py36 #, flake8 +envlist = py27, py34, py35, py36 #, flake8 skipsdist = {env:TOXBUILD:false} [flake8]