Skip to content

Commit 6f72b82

Browse files
committed
Merge pull request #1 from tarantool/master
master rebase
2 parents 04f3760 + aa06e75 commit 6f72b82

18 files changed

+309
-265
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ before_script:
1919
- sudo apt-get update
2020

2121
script:
22-
- sudo apt-get -y install tarantool python-yaml
22+
- sudo apt-get -y install tarantool
23+
- pip install -r requirements.txt
2324
- python setup.py test

README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ This package is a pure-python client library for `Tarantool`_.
1111
.. _`GitHub`: https://github.com/tarantool/tarantool-python
1212
.. _`Issue tracker`: https://github.com/tarantool/tarantool-python/issues
1313

14+
.. image:: https://travis-ci.org/tarantool/tarantool-python.svg?branch=master
15+
:target: https://travis-ci.org/tarantool/tarantool-python
16+
1417
Download and Install
1518
--------------------
1619

debian/changelog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
tarantool-python (0.5.1-1) unstable; urgency=medium
2+
3+
* Fix minor bugs
4+
* Add eval tarantool command
5+
* Add autogenerated sync to package header
6+
7+
-- Eugine Blikh <bigbes@gmail.com> Wed, 24 Mar 2015 13:46:33 +0300
8+
19
tarantool-python (0.5.0-1) unstable; urgency=low
210

311
* source package automatically created by stdeb 0.6.0+git

debian/control

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,5 @@ Package: tarantool-python
99
Architecture: any
1010
Depends: ${misc:Depends}, python-all (>= 2.6.6-3), python-yaml, python-msgpack | msgpack-python
1111
Description: Python client library for Tarantool Database
12-
Python driver for Tarantool 1.6
13-
===============================
14-
.
15-
This package is a pure-python client library for `Tarantool`_.
16-
.
17-
`Documentation`_ | `Downloads`_ | `PyPI`_ | `GitHub`_ | `Issue tracker`_
18-
.
19-
.. _`Documentation`: http://tarantool-python.readthedocs.org/en/latest/
20-
.. _`Downloads`: http://pypi.python.org/pypi/tarantool#downloads
21-
.. _`PyPI`: http://pypi.python.org/pypi/tarantool
22-
.. _`GitHub`: https://github.com/tarantool/tarantool-python
23-
.. _`Issue tracker`: https://github.com/tarantool/tarantool-python/issues
24-
.
25-
Download and Install
26-
--------------------
27-
.
28-
The recommended way to install ``tarantool`` package is using PIP
29-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30-
.
31-
For Tarantool version < 1.6.0 you must get ``0.3.*`` connector version::
12+
Python driver for Tarantool 1.6
13+
This package is a pure-python client library for Tarantool.

doc/guide.en.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ method should be used.
184184

185185
Example::
186186

187-
>>> user.update(1001, [(1, '=', 'John'), (2, '=', 'Smith')])
187+
>>> user.update(1001, [('=', 1, 'John'), ('=', 2, 'Smith')])
188188

189189
In this example new values for fields ``1`` and ``2`` are assigned.
190190

@@ -286,4 +286,4 @@ Example::
286286

287287
.. seealso::
288288

289-
Tarantool/Box User Guide » `Writing stored procedures in Lua <http://tarantool.org/tarantool_user_guide.html#stored-programs>`_
289+
Tarantool/Box User Guide » `Writing stored procedures in Lua <http://tarantool.org/tarantool_user_guide.html#stored-programs>`_

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
msgpack-python>=0.4.0
2+
pyyaml>=3.10

setup.py

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3+
import codecs
4+
import os
5+
import re
36

47
try:
58
from setuptools import setup
69
except ImportError:
710
from distutils.core import setup
811

9-
import os
10-
11-
os.chdir(os.path.abspath(os.path.dirname(__file__)))
12-
13-
# Read package version without importing it
14-
for line in open(os.path.join("tarantool", "__init__.py")):
15-
if line.startswith("__version__"):
16-
exec line
17-
break
18-
1912
# Extra commands for documentation management
2013
cmdclass = {}
2114
command_options = {}
@@ -37,7 +30,7 @@
3730
from sphinx_pypi_upload import UploadDoc
3831
cmdclass["upload_sphinx"] = UploadDoc
3932
command_options["upload_sphinx"] = {
40-
'upload_dir': ('setup.py', os.path.join("build", "sphinx", "html"))
33+
'upload_dir': ('setup.py', os.path.join("build", "sphinx", "html"))
4134
}
4235
except ImportError:
4336
pass
@@ -51,28 +44,44 @@
5144
except ImportError:
5245
pass
5346

47+
48+
def read(*parts):
49+
filename = os.path.join(os.path.dirname(__file__), *parts)
50+
with codecs.open(filename, encoding='utf-8') as fp:
51+
return fp.read()
52+
53+
54+
def find_version(*file_paths):
55+
version_file = read(*file_paths)
56+
version_match = re.search(r"""^__version__\s*=\s*(['"])(.+)\1""",
57+
version_file, re.M)
58+
if version_match:
59+
return version_match.group(2)
60+
raise RuntimeError("Unable to find version string.")
61+
62+
5463
setup(
55-
name = "tarantool",
56-
packages = ["tarantool"],
57-
package_dir = {"tarantool": os.path.join("tarantool")},
58-
version = __version__,
59-
platforms = ["all"],
60-
author = "Konstantin Cherkasoff",
61-
author_email = "k.cherkasoff@gmail.com",
62-
url = "https://github.com/coxx/tarantool-python",
63-
license = "BSD",
64-
description = "Python client library for Tarantool Database",
65-
long_description = open("README.rst").read(),
66-
classifiers = [
64+
name="tarantool",
65+
packages=["tarantool"],
66+
package_dir={"tarantool": os.path.join("tarantool")},
67+
version=find_version('tarantool', '__init__.py'),
68+
platforms=["all"],
69+
author="Konstantin Cherkasoff",
70+
author_email="k.cherkasoff@gmail.com",
71+
url="https://github.com/tarantool/tarantool-python",
72+
license="BSD",
73+
description="Python client library for Tarantool Database",
74+
long_description=read('README.rst'),
75+
classifiers=[
6776
"Intended Audience :: Developers",
6877
"License :: OSI Approved :: BSD License",
6978
"Operating System :: OS Independent",
7079
"Programming Language :: Python",
7180
"Topic :: Database :: Front-Ends"
7281
],
73-
cmdclass = cmdclass,
74-
command_options = command_options,
75-
install_requires = [
82+
cmdclass=cmdclass,
83+
command_options=command_options,
84+
install_requires=[
7685
'msgpack-python>=0.4',
7786
]
7887
)

tarantool/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# pylint: disable=C0301,W0105,W0401,W0614
33

4-
__version__ = "0.5.0"
4+
__version__ = "0.5.1"
55

66
from tarantool.connection import Connection
77
from tarantool.const import (
@@ -19,12 +19,12 @@
1919
)
2020

2121
from tarantool.schema import (
22-
Schema,
23-
SchemaError
22+
Schema,
23+
SchemaError
2424
)
2525

2626

27-
def connect(host="localhost", port=33013):
27+
def connect(host="localhost", port=33013, user=None, password=None):
2828
'''\
2929
Create a connection to the Tarantool server.
3030
@@ -37,6 +37,8 @@ def connect(host="localhost", port=33013):
3737
'''
3838

3939
return Connection(host, port,
40+
user=user,
41+
password=password,
4042
socket_timeout=SOCKET_TIMEOUT,
4143
reconnect_max_attempts=RECONNECT_MAX_ATTEMPTS,
4244
reconnect_delay=RECONNECT_DELAY,

0 commit comments

Comments
 (0)