Skip to content

Commit 0f9d99e

Browse files
committed
Many feature squashed commit:
Add Tarantool/Box starter/stopper for tests Add tests into tarantool-python: * Authentication tests * DML tests * SP tests * Schema tests * Add Makefile for popular tasks * Remove unneeded code (from schema.py - field_defs, default_type and e.t.c) * Redo select request. * Make use of index_id, where specification allows it. * Make use of multi-part key in some requests. * Some bugfixes * Remove old tests * Pretty output for test-runner * Greate journey of files: * `\src\tarantool` -> `\tarantool` * `\tests\tarantool` -> `\tests\suites` * Test search was moved to loader.discovery() method * Some documentation refactoring * Path fixes, chdir to main dir in the beggining of `setup.py` Add schema to msgpack branch. Features: * You may use space names instead of id's. * You may use index names instead of id's * Getting schema on demand. * If space/index doesn't exists on first demand - it'll throw SchemaError(child of DatabaseError) * You may flush Schema from time to time, if your tarantool's schema may alter. Some minor organization improvements. Also a little of pylint'ing.
1 parent fcb5287 commit 0f9d99e

26 files changed

+921
-913
lines changed

Diff for: Makefile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
test:
2+
python setup.py test
3+
coverage:
4+
python -m coverage run -p --source=. setup.py test
5+
cov-html:
6+
python -m coverage html -i
7+
cov-report:
8+
python -m coverage report
9+
dist:
10+
python setup.py sdist --format=gztar,bztar,zip
11+
dist-upload:
12+
python setup.py sdist --format=gztar,bztar,zip upload
13+
docs:
14+
python setup.py build_sphinx
15+
docs-upload: docs
16+
python setup.py upload_sphinx

Diff for: doc/api/class-schema.rst

-9
This file was deleted.

Diff for: doc/conf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
# If extensions (or modules to document with autodoc) are in another directory,
1717
# add these directories to sys.path here. If the directory is relative to the
1818
# documentation root, use os.path.abspath to make it absolute, like shown here.
19-
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath('.')), "src"))
19+
# sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath('.')), "src"))
2020

2121
# Read package version without importing it
22-
for line in open(os.path.join(os.path.dirname(os.path.abspath('.')), "src", "tarantool", "__init__.py")):
22+
for line in open(os.path.join(os.path.dirname(os.path.abspath('.')), "tarantool", "__init__.py")):
2323
if line.startswith("__version__"):
2424
exec line
2525
break
@@ -254,4 +254,4 @@
254254
intersphinx_mapping = {'python':('http://docs.python.org/', None)}
255255

256256

257-
autoclass_content = "both"
257+
autoclass_content = "both"

Diff for: doc/index.rst

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ API Reference
4040

4141
api/module-tarantool.rst
4242
api/class-connection.rst
43-
api/class-schema.rst
4443
api/class-space.rst
4544
api/class-response.rst
4645

Diff for: doc/index.ru.rst

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040

4141
api/module-tarantool.rst
4242
api/class-connection.rst
43-
api/class-schema.rst
4443
api/class-space.rst
4544
api/class-response.rst
4645

Diff for: doc/quick-start.en.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Creating a space instance
1616
Instance of :class:`~tarantool.space.Space` is a named object to access
1717
the key space.
1818

19-
Create `` demo `` object which will be used to access the space `` 0 ``::
19+
Create `` demo `` object which will be used to access the space `` 0 `` ::
2020

2121
>>> demo = server.space(0)
2222

Diff for: setup.py

100644100755
+12-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
#!/usr/bin/env python
12
# -*- coding: utf-8 -*-
2-
from distutils.core import setup
3-
import os.path
43

4+
try:
5+
from setuptools import setup
6+
except ImportError:
7+
from distutils.core import setup
8+
9+
import os
10+
11+
os.chdir(os.path.abspath(os.path.dirname(__file__)))
512

613
# Read package version without importing it
7-
for line in open(os.path.join(os.path.dirname(__file__), "src", "tarantool", "__init__.py")):
14+
for line in open(os.path.join("tarantool", "__init__.py")):
815
if line.startswith("__version__"):
916
exec line
1017
break
@@ -30,7 +37,7 @@
3037
from sphinx_pypi_upload import UploadDoc
3138
cmdclass["upload_sphinx"] = UploadDoc
3239
command_options["upload_sphinx"] = {
33-
'upload_dir': ('setup.py', os.path.join(os.path.dirname(__file__), "build", "sphinx", "html"))
40+
'upload_dir': ('setup.py', os.path.join("build", "sphinx", "html"))
3441
}
3542
except ImportError:
3643
pass
@@ -47,7 +54,7 @@
4754
setup(
4855
name = "tarantool",
4956
packages = ["tarantool"],
50-
package_dir = {"tarantool": os.path.join("src", "tarantool")},
57+
package_dir = {"tarantool": os.path.join("tarantool")},
5158
version = __version__,
5259
platforms = ["all"],
5360
author = "Konstantin Cherkasoff",

Diff for: src/tarantool/schema.py

-193
This file was deleted.

Diff for: src/tarantool/utils.py

-7
This file was deleted.

Diff for: src/tarantool/__init__.py renamed to tarantool/__init__.py

+9-15
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@
1010
RECONNECT_DELAY
1111
)
1212

13-
from tarantool.schema import (
14-
Schema,
15-
RAW,
16-
STR,
17-
NUM,
18-
NUM64
19-
)
2013
from tarantool.error import (
2114
Error,
2215
DatabaseError,
@@ -25,28 +18,29 @@
2518
RetryWarning
2619
)
2720

21+
from tarantool.schema import (
22+
Schema,
23+
SchemaError
24+
)
25+
2826

29-
def connect(host="localhost", port=33013, schema=None):
27+
def connect(host="localhost", port=33013):
3028
'''\
3129
Create a connection to the Tarantool server.
3230
3331
:param str host: Server hostname or IP-address
3432
:param int port: Server port
35-
:param schema: Data schema (see Developer guide
36-
and :class:`~tarantool.schema.Schema`)
37-
:type schema: :class:`~tarantool.schema.Schema` or dict
3833
3934
:rtype: :class:`~tarantool.connection.Connection`
35+
4036
:raise: `NetworkError`
4137
'''
4238

4339
return Connection(host, port,
4440
socket_timeout=SOCKET_TIMEOUT,
4541
reconnect_max_attempts=RECONNECT_MAX_ATTEMPTS,
4642
reconnect_delay=RECONNECT_DELAY,
47-
connect_now=True,
48-
schema=schema)
43+
connect_now=True)
4944

5045
__all__ = ['connect', 'Connection', 'Schema', 'Error', 'DatabaseError',
51-
'NetworkError', 'NetworkWarning', 'RetryWarning', 'RAW', 'STR',
52-
'NUM', 'NUM64']
46+
'NetworkError', 'NetworkWarning', 'RetryWarning', 'SchemaError']

0 commit comments

Comments
 (0)