Skip to content
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
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ before_script:
- sudo apt-get update

script:
- sudo apt-get -y install tarantool python-yaml
- sudo apt-get -y install tarantool
- pip install -r requirements.txt
- python setup.py test
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ This package is a pure-python client library for `Tarantool`_.
.. _`GitHub`: https://github.com/tarantool/tarantool-python
.. _`Issue tracker`: https://github.com/tarantool/tarantool-python/issues

.. image:: https://travis-ci.org/tarantool/tarantool-python.svg?branch=master
:target: https://travis-ci.org/tarantool/tarantool-python

Download and Install
--------------------

Expand Down
8 changes: 8 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
tarantool-python (0.5.1-1) unstable; urgency=medium

* Fix minor bugs
* Add eval tarantool command
* Add autogenerated sync to package header

-- Eugine Blikh <[email protected]> Wed, 24 Mar 2015 13:46:33 +0300

tarantool-python (0.5.0-1) unstable; urgency=low

* source package automatically created by stdeb 0.6.0+git
Expand Down
22 changes: 2 additions & 20 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,5 @@ Package: tarantool-python
Architecture: any
Depends: ${misc:Depends}, python-all (>= 2.6.6-3), python-yaml, python-msgpack | msgpack-python
Description: Python client library for Tarantool Database
Python driver for Tarantool 1.6
===============================
.
This package is a pure-python client library for `Tarantool`_.
.
`Documentation`_ | `Downloads`_ | `PyPI`_ | `GitHub`_ | `Issue tracker`_
.
.. _`Documentation`: http://tarantool-python.readthedocs.org/en/latest/
.. _`Downloads`: http://pypi.python.org/pypi/tarantool#downloads
.. _`PyPI`: http://pypi.python.org/pypi/tarantool
.. _`GitHub`: https://github.com/tarantool/tarantool-python
.. _`Issue tracker`: https://github.com/tarantool/tarantool-python/issues
.
Download and Install
--------------------
.
The recommended way to install ``tarantool`` package is using PIP
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.
For Tarantool version < 1.6.0 you must get ``0.3.*`` connector version::
Python driver for Tarantool 1.6
This package is a pure-python client library for Tarantool.
4 changes: 2 additions & 2 deletions doc/guide.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ method should be used.

Example::

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

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

Expand Down Expand Up @@ -286,4 +286,4 @@ Example::

.. seealso::

Tarantool/Box User Guide » `Writing stored procedures in Lua <http://tarantool.org/tarantool_user_guide.html#stored-programs>`_
Tarantool/Box User Guide » `Writing stored procedures in Lua <http://tarantool.org/tarantool_user_guide.html#stored-programs>`_
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
msgpack-python>=0.4.0
pyyaml>=3.10
61 changes: 35 additions & 26 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import os
import re

try:
from setuptools import setup
except ImportError:
from distutils.core import setup

import os

os.chdir(os.path.abspath(os.path.dirname(__file__)))

# Read package version without importing it
for line in open(os.path.join("tarantool", "__init__.py")):
if line.startswith("__version__"):
exec line
break

# Extra commands for documentation management
cmdclass = {}
command_options = {}
Expand All @@ -37,7 +30,7 @@
from sphinx_pypi_upload import UploadDoc
cmdclass["upload_sphinx"] = UploadDoc
command_options["upload_sphinx"] = {
'upload_dir': ('setup.py', os.path.join("build", "sphinx", "html"))
'upload_dir': ('setup.py', os.path.join("build", "sphinx", "html"))
}
except ImportError:
pass
Expand All @@ -51,28 +44,44 @@
except ImportError:
pass


def read(*parts):
filename = os.path.join(os.path.dirname(__file__), *parts)
with codecs.open(filename, encoding='utf-8') as fp:
return fp.read()


def find_version(*file_paths):
version_file = read(*file_paths)
version_match = re.search(r"""^__version__\s*=\s*(['"])(.+)\1""",
version_file, re.M)
if version_match:
return version_match.group(2)
raise RuntimeError("Unable to find version string.")


setup(
name = "tarantool",
packages = ["tarantool"],
package_dir = {"tarantool": os.path.join("tarantool")},
version = __version__,
platforms = ["all"],
author = "Konstantin Cherkasoff",
author_email = "[email protected]",
url = "https://github.com/coxx/tarantool-python",
license = "BSD",
description = "Python client library for Tarantool Database",
long_description = open("README.rst").read(),
classifiers = [
name="tarantool",
packages=["tarantool"],
package_dir={"tarantool": os.path.join("tarantool")},
version=find_version('tarantool', '__init__.py'),
platforms=["all"],
author="Konstantin Cherkasoff",
author_email="[email protected]",
url="https://github.com/tarantool/tarantool-python",
license="BSD",
description="Python client library for Tarantool Database",
long_description=read('README.rst'),
classifiers=[
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Database :: Front-Ends"
],
cmdclass = cmdclass,
command_options = command_options,
install_requires = [
cmdclass=cmdclass,
command_options=command_options,
install_requires=[
'msgpack-python>=0.4',
]
)
10 changes: 6 additions & 4 deletions tarantool/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# pylint: disable=C0301,W0105,W0401,W0614

__version__ = "0.5.0"
__version__ = "0.5.1"

from tarantool.connection import Connection
from tarantool.const import (
Expand All @@ -19,12 +19,12 @@
)

from tarantool.schema import (
Schema,
SchemaError
Schema,
SchemaError
)


def connect(host="localhost", port=33013):
def connect(host="localhost", port=33013, user=None, password=None):
'''\
Create a connection to the Tarantool server.

Expand All @@ -37,6 +37,8 @@ def connect(host="localhost", port=33013):
'''

return Connection(host, port,
user=user,
password=password,
socket_timeout=SOCKET_TIMEOUT,
reconnect_max_attempts=RECONNECT_MAX_ATTEMPTS,
reconnect_delay=RECONNECT_DELAY,
Expand Down
Loading