From d9c0e51e2abae705d1ef3abb4bce147085c813b2 Mon Sep 17 00:00:00 2001 From: igorcoding Date: Tue, 14 Feb 2017 21:17:37 +0300 Subject: [PATCH] setting up releases --- .ci/travis-before-install.sh | 1 + .ci/travis-release.sh | 13 ++++ .travis.yml | 134 ++++++++++++++++++----------------- LICENSE => LICENSE.txt | 0 MANIFEST.in | 4 ++ README.md | 4 +- asynctnt/__init__.py | 2 +- requirements.txt | 7 +- setup.cfg | 2 + setup.py | 15 +++- temp/bench.py | 1 - 11 files changed, 108 insertions(+), 75 deletions(-) create mode 100755 .ci/travis-release.sh rename LICENSE => LICENSE.txt (100%) create mode 100644 MANIFEST.in create mode 100644 setup.cfg diff --git a/.ci/travis-before-install.sh b/.ci/travis-before-install.sh index 4a068ce..8e1d533 100755 --- a/.ci/travis-before-install.sh +++ b/.ci/travis-before-install.sh @@ -12,6 +12,7 @@ if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo apt-get -qq update sudo apt-get -y install tarantool sudo tarantoolctl stop example || exit 0 + sudo apt-get install pandoc elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then if [[ "${TARANTOOL_VERSION}" == "1_7" ]]; then brew install tarantool --HEAD diff --git a/.ci/travis-release.sh b/.ci/travis-release.sh new file mode 100755 index 0000000..7edf8bb --- /dev/null +++ b/.ci/travis-release.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -e -x + + +if [ -z "${TRAVIS_TAG}" ]; then + # Not a release + exit 0 +fi + + +python setup.py sdist +twine upload dist/* diff --git a/.travis.yml b/.travis.yml index 0c81f2c..337fdfa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,78 +1,82 @@ language: python - matrix: fast_finish: true include: - # osx - - os: osx - language: generic - env: BUILD=tests PYTHON_VERSION=3.5.2 TARANTOOL_VERSION=1_6 - - - os: osx - language: generic - env: BUILD=tests PYTHON_VERSION=3.6.0 TARANTOOL_VERSION=1_6 - - - os: osx - language: generic - env: BUILD=tests PYTHON_VERSION=3.5.2 TARANTOOL_VERSION=1_7 - - - os: osx - language: generic - env: BUILD=tests PYTHON_VERSION=3.6.0 TARANTOOL_VERSION=1_7 - - # precise - - os: linux - dist: precise - sudo: required - language: python - python: "3.5" - env: BUILD=quicktests TARANTOOL_VERSION=1_6 - - - os: linux - dist: precise - sudo: required - language: python - python: "3.5" - env: BUILD=quicktests TARANTOOL_VERSION=1_7 - - # trusty - - os: linux - dist: trusty - sudo: required - language: python - python: "3.5" - env: BUILD=quicktests TARANTOOL_VERSION=1_6 - - - os: linux - dist: trusty - sudo: required - language: python - python: "3.5" - env: BUILD=quicktests TARANTOOL_VERSION=1_7 - - # latest tarantool - - os: linux - dist: trusty - sudo: required - language: python - python: "3.5" - env: BUILD=tests TARANTOOL_VERSION=1_7 - - - os: linux - dist: trusty - sudo: required - language: python - python: "3.6" - env: BUILD=tests TARANTOOL_VERSION=1_7 + - os: osx + language: generic + env: BUILD=tests PYTHON_VERSION=3.5.2 TARANTOOL_VERSION=1_6 + - os: osx + language: generic + env: BUILD=tests PYTHON_VERSION=3.6.0 TARANTOOL_VERSION=1_6 + - os: osx + language: generic + env: BUILD=tests PYTHON_VERSION=3.5.2 TARANTOOL_VERSION=1_7 + - os: osx + language: generic + env: BUILD=tests PYTHON_VERSION=3.6.0 TARANTOOL_VERSION=1_7 + - os: linux + dist: precise + sudo: required + language: python + python: '3.5' + env: BUILD=quicktests TARANTOOL_VERSION=1_6 + - os: linux + dist: precise + sudo: required + language: python + python: '3.5' + env: BUILD=quicktests TARANTOOL_VERSION=1_7 + - os: linux + dist: trusty + sudo: required + language: python + python: '3.5' + env: BUILD=quicktests TARANTOOL_VERSION=1_6 + - os: linux + dist: trusty + sudo: required + language: python + python: '3.5' + env: BUILD=quicktests TARANTOOL_VERSION=1_7 + - os: linux + dist: trusty + sudo: required + language: python + python: '3.5' + env: BUILD=tests TARANTOOL_VERSION=1_7 + - os: linux + dist: trusty + sudo: required + language: python + python: '3.6' + env: BUILD=tests,release TARANTOOL_VERSION=1_7 cache: - pip before_install: - - .ci/travis-before-install.sh + - ".ci/travis-before-install.sh" install: - - .ci/travis-install.sh + - ".ci/travis-install.sh" script: - - .ci/travis-tests.sh + - ".ci/travis-tests.sh" + +deploy: + - provider: releases + skip_cleanup: true + api_key: + secure: QldT0BfRC5AiavTIQqB9TkRK30J0UVd0yfLll2UjgJIB615jSbr/9NLLjI50x3TXyyeD80I9N+EvyGWl0sX1aWZE/sFYalbfCPFWfbpZ3XnsvNxgbzAhKrWbW0F7Vyb2hccq8fBuCo7m9WaTfFfTFe3ziEpFLDtZqkWKvv3GPqQxqrDW4tgq2dcyqZKTDX2XTN/SQNsHFZtaIvSyNRYCd1Z4ZrnOEnRZH7nxNKWR5lQ25o2Z9u4lukaq//M5rlphQQU74y3O8oYq/FiR6PzmSoH2+AKzJ2MiLqdbH/VhmAU+nsMwLPbSM8YnIICJh4lRVw7Ug5YNUogXHWyiCg6ztOQhPAL8v4/TTMteGT/8oMt7kc/w1EENaaMRhyfaLOC9glkJWcamnGBsJ2OJR1ogqNzmJvvWbSMHZB8fi/xWjWJ5YonGbR+MSh5h5q7h0yr7uO6M4PUVdpqKgQCfvowwyJPC5udgtGnBR3GE9g85jquVPdK+oCHZsJFBKB96Hci6AejlM0eRWV/RZI2fzv5/2UUkwQnnpF8pejtw9y3cG6kyJABdQSQjb/2illv8HXZe5m9orcSvjS2t6zpPYPWvqBJn2PTRwnq4Djl1Wo8PcwBLgjtN8JhM2NhXl3JrN7aLUtcBUqlmBgA5LWPHvaQtq6MA466rOV8x+pVNfEo0sL4= + file_glob: true + file: dist/asynctnt*.tar.gz + on: + repo: igorcoding/asynctnt + tags: true + condition: '"${BUILD}" == *release*' + + - provider: script + script: .ci/travis-release.sh + on: + tags: true + condition: '"${BUILD}" == *release*' diff --git a/LICENSE b/LICENSE.txt similarity index 100% rename from LICENSE rename to LICENSE.txt diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..34c7574 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,4 @@ +recursive-include tests *.py +recursive-include asynctnt *.pyx *.pxd *.pxi *.py *.c *.h +recursive-include third_party * +include LICENSE.txt README.md Makefile diff --git a/README.md b/README.md index 969abc6..6077dd4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # asynctnt -[![Build Status](https://travis-ci.com/igorcoding/asynctnt.svg?token=rFNDyy6cdNgiTQaxXzt8&branch=master)](https://travis-ci.com/igorcoding/asynctnt) - asynctnt is a high-performance [Tarantool](https://tarantool.org/) database connector library for Python/asyncio. It was highly inspired by [asyncpg](https://github.com/MagicStack/asyncpg) module. @@ -48,6 +46,7 @@ RPS on running 200k requests in 300 parallel coroutines (no `uvloop`): Let's enable uvloop. This is where asynctnt shines. RPS on running 200k requests in 300 parallel coroutines (with `uvloop`): + | Request | aiotarantool | asynctnt | | ------------- |:-------------:| ---------:| | ping | 30050.55 | 131317.35 | @@ -56,6 +55,7 @@ RPS on running 200k requests in 300 parallel coroutines (with `uvloop`): | select | 22346.14 | 88748.47 | | insert | 25811.84 | 82526.94 | | update | 21914.15 | 80865.00 | + ## Roadmap diff --git a/asynctnt/__init__.py b/asynctnt/__init__.py index 3dd1874..241f0ad 100644 --- a/asynctnt/__init__.py +++ b/asynctnt/__init__.py @@ -1,4 +1,4 @@ from .connection import Connection, connect from .iproto.protocol import Iterator, Response -__version__ = '0.0.1' +__version__ = '0.0.6' diff --git a/requirements.txt b/requirements.txt index b59082b..1f0610c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ -psutil==5.0.1 +PyYAML>=3.12 +uvloop>=0.6.7 cython==0.25.2 pep8==1.7.0 flake8==3.2.1 -PyYAML>=3.12 -uvloop>=0.6.7 +pypandoc +twine diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..b88034e --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[metadata] +description-file = README.md diff --git a/setup.py b/setup.py index b42c70c..bd67d23 100644 --- a/setup.py +++ b/setup.py @@ -14,6 +14,13 @@ CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) +description = "A fast Tarantool Database connector for Python/asyncio." +try: + import pypandoc + long_description = pypandoc.convert('README.md', 'rst') +except (IOError, ImportError): + long_description = description + def find_version(): for line in open("asynctnt/__init__.py"): @@ -176,8 +183,10 @@ def _patch_cfile(self, cfile): version=find_version(), author="igorcoding", author_email="igorcoding@gmail.com", + url='https://github.com/igorcoding/asynctnt', + license='Apache Software License', classifiers=[ - "Programming Language :: Python :: Only", + "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Intended Audience :: Developers", @@ -188,7 +197,7 @@ def _patch_cfile(self, cfile): install_requires=[ 'PyYAML>=3.12' ], - description="A fast Tarantool Database connector for Python/asyncio.", - long_description=open("README.md").read(), + description=description, + long_description=long_description, test_suite='run_tests.discover_tests' ) diff --git a/temp/bench.py b/temp/bench.py index 21b7894..cc1acaf 100644 --- a/temp/bench.py +++ b/temp/bench.py @@ -58,7 +58,6 @@ async def bench_asynctnt(n, b, loop=None): async def bulk_f(): for _ in range(n_requests_per_bulk): - await getattr(conn, method)(*args) await conn.ping() # await conn.call('test') # await conn.eval('return "hello"')