Skip to content
Commits on Source (5)
[bumpversion]
current_version = 0.3.2
current_version = 1.0.0
commit = True
tag = True
......
image: "python:3.6"
image: "python:3.7"
before_script:
- pip install .
- pip install -r requirements-dev.txt
- pip install pipenv
- pipenv install -d --system
stages:
- test
- upload
check-code:
lint-code:
stage: test
script: make check
script: make lint
inspect-code:
stage: test
script: make inspect
run-test-3.6:
image: "python:3.6"
stage: test
script: pytest
run-test-3.7:
stage: test
script: pytest
upload-to-pypi:
stage: upload
before_script:
- pip install twine
script:
- python setup.py bdist_wheel
- twine upload dist/*
......
......@@ -22,7 +22,7 @@ jobs=4
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=pylint_common
load-plugins=
# Pickle collected data for later comparisons.
persistent=yes
......
......@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [1.0.0] - 2019-03-03
### Changed
- Migrate to `rethinkdb>=2.4.0`
## [0.3.1] - 2018-05-30
### Added
......@@ -19,5 +25,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Cleanup thread
[1.0.0]: hthttps://gitlab.com/AnjiProject/repool-forked/compare/v0.3.1...v1.0.0
[0.3.1]: hthttps://gitlab.com/AnjiProject/repool-forked/compare/v0.3.0...v0.3.1
\ No newline at end of file
check:
lint:
pylint repool_forked
pycodestyle repool_forked
mypy --ignore-missing-imports repool_forked
inspect:
pipenv check
bandit -r repool_forked
pytest:
pytest tests
\ No newline at end of file
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
pylint = ">=2.1.1"
mypy = ">=0.641"
pycodestyle = ">=2.4.0"
pytest = "~=3.7.1"
pytest-cov = "~=2.5.1"
pytest-sugar = "~=0.9.1"
ipdb = '*'
ipython = '*'
pytest-profiling = '*'
bandit = "*"
[packages]
repool-forked = {path = "."}
[requires]
# python_version = "3.7"
This diff is collapsed.
......@@ -4,7 +4,7 @@ __author__ = "Bogdan Gladyshev"
__copyright__ = "Copyright 2017, Bogdan Gladyshev"
__credits__ = ["Bogdan Gladyshev"]
__license__ = "MIT"
__version__ = "0.3.2"
__version__ = "1.0.0"
__maintainer__ = "Bogdan Gladyshev"
__email__ = "siredvin.dark@gmail.com"
__status__ = "Production"
......@@ -4,20 +4,21 @@ from threading import Lock
from typing import Optional, Any, Dict, Union
from queue import Queue
import rethinkdb as R
import rethinkdb
from tenacity import retry, retry_if_exception_type, stop_after_attempt, wait_exponential
__author__ = "Bogdan Gladyshev"
__copyright__ = "Copyright 2017, Bogdan Gladyshev"
__credits__ = ["Bogdan Gladyshev"]
__license__ = "MIT"
__version__ = "0.3.2"
__version__ = "1.0.0"
__maintainer__ = "Bogdan Gladyshev"
__email__ = "siredvin.dark@gmail.com"
__status__ = "Production"
__all__ = ['PoolException', 'ConnectionPool']
__all__ = ['PoolException', 'ConnectionPool', 'R']
_log = logging.getLogger(__name__)
R = rethinkdb.RethinkDB()
RethinkDBConnection = Any # pylint: disable=invalid-name
RETRY_ATTEMPTS = 20
......@@ -26,7 +27,7 @@ class PoolException(Exception):
pass
class ConnectionWrapper(object):
class ConnectionWrapper:
def __init__(
self, pool: 'ConnectionPool',
conn: Optional[RethinkDBConnection] = None, **kwargs) -> None:
......@@ -73,7 +74,7 @@ class ConnectionContextManager:
self.pool.release(self.conn)
class ConnectionPool(object):
class ConnectionPool:
"""A rethinkDB connection pool
>>> pool = ConnectionPool()
>>> with pool.acquire() as conn:
......
pylint>=1.7.4
pylint-common>=0.2.5
mypy>=0.550
pycodestyle>=2.3.1
pytest>=3.3.1
pytest-sugar
twine>=1.9.1
\ No newline at end of file
......@@ -20,7 +20,7 @@ from setuptools import setup, find_packages
setup(
name="repool_forked",
version="0.3.2",
version="1.0.0",
description="Connection pool for rethinkdb",
author="Bogdan Gladyshev",
author_email='siredivn.dark@gmail.com',
......@@ -28,8 +28,8 @@ setup(
license='GPLv3',
packages=find_packages(exclude=['tests']),
install_requires=[
'rethinkdb',
'tenacity'
'rethinkdb>=2.4.0',
'tenacity>=5.0.0'
],
classifiers=[
'Development Status :: 5 - Production/Stable',
......