Search is not available for this dataset
id stringlengths 1 8 | text stringlengths 72 9.81M | addition_count int64 0 10k | commit_subject stringlengths 0 3.7k | deletion_count int64 0 8.43k | file_extension stringlengths 0 32 | lang stringlengths 1 94 | license stringclasses 10
values | repo_name stringlengths 9 59 |
|---|---|---|---|---|---|---|---|---|
1300 | <NME> bootstrap
<BEF> #!/bin/sh
# vim: set ts=2 sts=2 sw=2 et:
test -n "$SHELLDEBUG" && set -x
if test -e /var/run/docker.sock
then
DOCKER_IP=127.0.0.1
else
echo "Docker environment not detected."
exit 1
fi
set -e
if test -z "$DOCKER_COMPOSE_PREFIX"
then
CWD=${PWD##*/}
DOCKER_COMPOSE_PREFIX=${CWD/_/}
fi
COMP... | 10 | Merge pull request #30 from nvllsvm/devenv | 13 | bootstrap | bsd-3-clause | gmr/queries | |
1301 | <NME> .travis.yml
<BEF> sudo: false
language: python
dist: xenial
env:
global:
- PATH=$HOME/.local/bin:$PATH
- AWS_DEFAULT_REGION=us-east-1
- 3.4
install:
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install -r requirements.txt; pip install psycopg2 unittest2; fi
- if [[ $TRAVIS_PYTHON_VERS... | 2 | Simplify the python version rules in travis install rules | 5 | .yml | travis | bsd-3-clause | gmr/queries |
1302 | <NME> .travis.yml
<BEF> sudo: false
language: python
dist: xenial
env:
global:
- PATH=$HOME/.local/bin:$PATH
- AWS_DEFAULT_REGION=us-east-1
- 3.4
install:
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install -r requirements.txt; pip install psycopg2 unittest2; fi
- if [[ $TRAVIS_PYTHON_VERS... | 2 | Simplify the python version rules in travis install rules | 5 | .yml | travis | bsd-3-clause | gmr/queries |
1303 | <NME> README.rst
<BEF> Queries: PostgreSQL Simplified
==============================
PostgreSQL database access simplified.
Queries is an opinionated wrapper for interfacing with PostgreSQL that offers
caching of connections and support for PyPy via psycopg2ct.
The core `queries.Queries` class will automatically regi... | 2 | Minor readme update | 3 | .rst | rst | bsd-3-clause | gmr/queries |
1304 | <NME> README.rst
<BEF> Queries: PostgreSQL Simplified
==============================
PostgreSQL database access simplified.
Queries is an opinionated wrapper for interfacing with PostgreSQL that offers
caching of connections and support for PyPy via psycopg2ct.
The core `queries.Queries` class will automatically regi... | 2 | Minor readme update | 3 | .rst | rst | bsd-3-clause | gmr/queries |
1305 | <NME> setup.cfg
<BEF> [nosetests]
with-coverage=1
cover-package=queries
cover-branches=1
cover-erase=1
logging-level = DEBUG
stop = 1
verbosity = 2
with-coverage = 1
detailed-errors = 1
<MSG> Update config
<DFF> @@ -1,5 +1,12 @@
+[flake8]
+exclude = .git,build,dist,docs,env
+
[nosetests]
-with-coverage=1
-cover-pack... | 11 | Update config | 4 | .cfg | cfg | bsd-3-clause | gmr/queries |
1306 | <NME> setup.cfg
<BEF> [nosetests]
with-coverage=1
cover-package=queries
cover-branches=1
cover-erase=1
logging-level = DEBUG
stop = 1
verbosity = 2
with-coverage = 1
detailed-errors = 1
<MSG> Update config
<DFF> @@ -1,5 +1,12 @@
+[flake8]
+exclude = .git,build,dist,docs,env
+
[nosetests]
-with-coverage=1
-cover-pack... | 11 | Update config | 4 | .cfg | cfg | bsd-3-clause | gmr/queries |
1307 | <NME> session_tests.py
<BEF> """
Tests for functionality in the session module
"""
import hashlib
import logging
import unittest
import mock
from psycopg2 import extras
import psycopg2
# Out of order import to ensure psycopg2cffi is registered
from queries import pool, results, session, utils
LOGGER = logging.getLo... | 1 | Update tests | 1 | .py | py | bsd-3-clause | gmr/queries |
1308 | <NME> session_tests.py
<BEF> """
Tests for functionality in the session module
"""
import hashlib
import logging
import unittest
import mock
from psycopg2 import extras
import psycopg2
# Out of order import to ensure psycopg2cffi is registered
from queries import pool, results, session, utils
LOGGER = logging.getLo... | 1 | Update tests | 1 | .py | py | bsd-3-clause | gmr/queries |
1309 | <NME> README.rst
<BEF> Queries: PostgreSQL Simplified
==============================
*Queries* is a BSD licensed opinionated wrapper of the psycopg2_ library for
interacting with PostgreSQL.
The popular psycopg2_ package is a full-featured python client. Unfortunately
as a developer, you're often repeating the same st... | 2 | Fix the PEP link | 2 | .rst | rst | bsd-3-clause | gmr/queries |
1310 | <NME> README.rst
<BEF> Queries: PostgreSQL Simplified
==============================
*Queries* is a BSD licensed opinionated wrapper of the psycopg2_ library for
interacting with PostgreSQL.
The popular psycopg2_ package is a full-featured python client. Unfortunately
as a developer, you're often repeating the same st... | 2 | Fix the PEP link | 2 | .rst | rst | bsd-3-clause | gmr/queries |
1311 | <NME> session.py
<BEF> """The Session class allows for a unified (and simplified) view of
interfacing with a PostgreSQL database server.
Connection details are passed in as a PostgreSQL URI and connections are pooled
by default, allowing for reuse of connections across modules in the Python
runtime without having to p... | 4 | Increase logging usefulness | 2 | .py | py | bsd-3-clause | gmr/queries |
1312 | <NME> session.py
<BEF> """The Session class allows for a unified (and simplified) view of
interfacing with a PostgreSQL database server.
Connection details are passed in as a PostgreSQL URI and connections are pooled
by default, allowing for reuse of connections across modules in the Python
runtime without having to p... | 4 | Increase logging usefulness | 2 | .py | py | bsd-3-clause | gmr/queries |
1313 | <NME> pool_connection_tests.py
<BEF> ADDFILE
<MSG> Move pool.Connection tests into own file
<DFF> @@ -0,0 +1,80 @@
+"""
+Tests for Connection class in the pool module
+
+"""
+import mock
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
+import weakref
+
+from queries import pool
+
+
+c... | 80 | Move pool.Connection tests into own file | 0 | .py | py | bsd-3-clause | gmr/queries |
1314 | <NME> pool_connection_tests.py
<BEF> ADDFILE
<MSG> Move pool.Connection tests into own file
<DFF> @@ -0,0 +1,80 @@
+"""
+Tests for Connection class in the pool module
+
+"""
+import mock
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
+import weakref
+
+from queries import pool
+
+
+c... | 80 | Move pool.Connection tests into own file | 0 | .py | py | bsd-3-clause | gmr/queries |
1315 | <NME> tornado_session.rst
<BEF> .. py:module:: queries.tornado_session
TornadoSession Asynchronous API
===============================
Use a Queries Session asynchronously within the `Tornado <http://www.tornadoweb.org>`_ framework.
The :py:class:`TornadoSession <queries.TornadoSession>` class is optimized for
asynch... | 2 | Update the TornadoSession docs [skip ci] | 1 | .rst | rst | bsd-3-clause | gmr/queries |
1316 | <NME> tornado_session.rst
<BEF> .. py:module:: queries.tornado_session
TornadoSession Asynchronous API
===============================
Use a Queries Session asynchronously within the `Tornado <http://www.tornadoweb.org>`_ framework.
The :py:class:`TornadoSession <queries.TornadoSession>` class is optimized for
asynch... | 2 | Update the TornadoSession docs [skip ci] | 1 | .rst | rst | bsd-3-clause | gmr/queries |
1317 | <NME> setup.py
<BEF> import os
import os
import platform
# Include the proper requirements
if platform.python_implementation() == 'PyPy':
install_requires = ['psycopg2cffi>=2.7.2,<3']
else:
else:
install_requires = ['psycopg2>=2.5.1,<3']
# Install tornado if generating docs on readthedocs
if os.environ.get('R... | 1 | More python2.6 cleanup, move __init__ stuff to utils | 1 | .py | py | bsd-3-clause | gmr/queries |
1318 | <NME> setup.py
<BEF> import os
import os
import platform
# Include the proper requirements
if platform.python_implementation() == 'PyPy':
install_requires = ['psycopg2cffi>=2.7.2,<3']
else:
else:
install_requires = ['psycopg2>=2.5.1,<3']
# Install tornado if generating docs on readthedocs
if os.environ.get('R... | 1 | More python2.6 cleanup, move __init__ stuff to utils | 1 | .py | py | bsd-3-clause | gmr/queries |
1319 | <NME> .travis.yml
<BEF> sudo: false
language: python
dist: xenial
env:
global:
- PATH=$HOME/.local/bin:$PATH
- AWS_DEFAULT_REGION=us-east-1
- secure: "inURdx4ldkJqQXL1TyvKImC3EnL5TixC1DlNMBYi5ttygwAk+mSSSw8Yc7klB6D1m6q79xUlHRk06vbz23CsXTM4AClC5Emrk6XN2GlUKl5WI+z+A2skI59buEhLWe7e2KzhB/AVx2E3TfKa0oY7raM0UUnaOkpV... | 1 | Attempt to fix the travis job | 0 | .yml | travis | bsd-3-clause | gmr/queries |
1320 | <NME> .travis.yml
<BEF> sudo: false
language: python
dist: xenial
env:
global:
- PATH=$HOME/.local/bin:$PATH
- AWS_DEFAULT_REGION=us-east-1
- secure: "inURdx4ldkJqQXL1TyvKImC3EnL5TixC1DlNMBYi5ttygwAk+mSSSw8Yc7klB6D1m6q79xUlHRk06vbz23CsXTM4AClC5Emrk6XN2GlUKl5WI+z+A2skI59buEhLWe7e2KzhB/AVx2E3TfKa0oY7raM0UUnaOkpV... | 1 | Attempt to fix the travis job | 0 | .yml | travis | bsd-3-clause | gmr/queries |
1321 | <NME> setup.py
<BEF> import os
import platform
import setuptools
# PYPY vs cpython
if platform.python_implementation() == 'PyPy':
install_requires = ['psycopg2cffi>=2.7.2,<3']
else:
install_requires = ['psycopg2>=2.5.1,<3']
# Install tornado if generating docs on readthedocs
if os.environ.get('READTHEDOCS', ... | 2 | Bump the version, remove Python 2.6 | 3 | .py | py | bsd-3-clause | gmr/queries |
1322 | <NME> setup.py
<BEF> import os
import platform
import setuptools
# PYPY vs cpython
if platform.python_implementation() == 'PyPy':
install_requires = ['psycopg2cffi>=2.7.2,<3']
else:
install_requires = ['psycopg2>=2.5.1,<3']
# Install tornado if generating docs on readthedocs
if os.environ.get('READTHEDOCS', ... | 2 | Bump the version, remove Python 2.6 | 3 | .py | py | bsd-3-clause | gmr/queries |
1323 | <NME> tornado_session_tests.py
<BEF> """
Tests for functionality in the tornado_session module
"""
import unittest
import mock
# Out of order import to ensure psycopg2cffi is registered
from queries import pool, tornado_session
from psycopg2 import extras
from tornado import concurrent, gen, ioloop, testing
class... | 18 | Clean up stack and exception handling | 4 | .py | py | bsd-3-clause | gmr/queries |
1324 | <NME> tornado_session_tests.py
<BEF> """
Tests for functionality in the tornado_session module
"""
import unittest
import mock
# Out of order import to ensure psycopg2cffi is registered
from queries import pool, tornado_session
from psycopg2 import extras
from tornado import concurrent, gen, ioloop, testing
class... | 18 | Clean up stack and exception handling | 4 | .py | py | bsd-3-clause | gmr/queries |
1325 | <NME> pool_manager_tests.py
<BEF> """
Tests for Manager class in the pool module
"""
import unittest
import uuid
import mock
from queries import pool
from queries import pool
class ManagerTests(unittest.TestCase):
def setUp(self):
self.manager = pool.PoolManager.instance()
def test_singleton_beh... | 28 | Add queries.pool.PoolManager.shutdown() | 6 | .py | py | bsd-3-clause | gmr/queries |
1326 | <NME> pool_manager_tests.py
<BEF> """
Tests for Manager class in the pool module
"""
import unittest
import uuid
import mock
from queries import pool
from queries import pool
class ManagerTests(unittest.TestCase):
def setUp(self):
self.manager = pool.PoolManager.instance()
def test_singleton_beh... | 28 | Add queries.pool.PoolManager.shutdown() | 6 | .py | py | bsd-3-clause | gmr/queries |
1327 | <NME> results.py
<BEF> """
query or callproc Results
"""
import logging
import psycopg2
LOGGER = logging.getLogger(__name__)
class Results(object):
"""The :py:class:`Results` class contains the results returned from
:py:meth:`Session.query <queries.Session.query>` and
:py:meth:`Session.callproc <queries... | 3 | Results: add __bool__ method. | 0 | .py | py | bsd-3-clause | gmr/queries |
1328 | <NME> results.py
<BEF> """
query or callproc Results
"""
import logging
import psycopg2
LOGGER = logging.getLogger(__name__)
class Results(object):
"""The :py:class:`Results` class contains the results returned from
:py:meth:`Session.query <queries.Session.query>` and
:py:meth:`Session.callproc <queries... | 3 | Results: add __bool__ method. | 0 | .py | py | bsd-3-clause | gmr/queries |
1329 | <NME> tornado_session_tests.py
<BEF> """
Tests for functionality in the tornado_session module
"""
import unittest
import mock
# Out of order import to ensure psycopg2cffi is registered
from queries import pool, tornado_session
from psycopg2 import extras
from tornado import concurrent, gen, ioloop, testing
class... | 8 | Test cleanup | 8 | .py | py | bsd-3-clause | gmr/queries |
1330 | <NME> tornado_session_tests.py
<BEF> """
Tests for functionality in the tornado_session module
"""
import unittest
import mock
# Out of order import to ensure psycopg2cffi is registered
from queries import pool, tornado_session
from psycopg2 import extras
from tornado import concurrent, gen, ioloop, testing
class... | 8 | Test cleanup | 8 | .py | py | bsd-3-clause | gmr/queries |
1331 | <NME> __init__.py
<BEF> """
Queries: PostgreSQL database access simplified
Queries is an opinionated wrapper for interfacing with PostgreSQL that offers
caching of connections and support for PyPy via psycopg2ct.
The core `queries.Queries` class will automatically register support for UUIDs,
Unicode and Unicode array... | 4 | Change how URIs are built with regard to port | 2 | .py | py | bsd-3-clause | gmr/queries |
1332 | <NME> __init__.py
<BEF> """
Queries: PostgreSQL database access simplified
Queries is an opinionated wrapper for interfacing with PostgreSQL that offers
caching of connections and support for PyPy via psycopg2ct.
The core `queries.Queries` class will automatically register support for UUIDs,
Unicode and Unicode array... | 4 | Change how URIs are built with regard to port | 2 | .py | py | bsd-3-clause | gmr/queries |
1333 | <NME> session_tests.py
<BEF> """
Tests for functionality in the session module
"""
import hashlib
import logging
import unittest
import mock
from psycopg2 import extras
import psycopg2
# Out of order import to ensure psycopg2cffi is registered
from queries import pool, results, session, utils
LOGGER = logging.getLo... | 1 | psycopg2ct does not support JSON | 0 | .py | py | bsd-3-clause | gmr/queries |
1334 | <NME> session_tests.py
<BEF> """
Tests for functionality in the session module
"""
import hashlib
import logging
import unittest
import mock
from psycopg2 import extras
import psycopg2
# Out of order import to ensure psycopg2cffi is registered
from queries import pool, results, session, utils
LOGGER = logging.getLo... | 1 | psycopg2ct does not support JSON | 0 | .py | py | bsd-3-clause | gmr/queries |
1335 | <NME> simple_tests.py
<BEF> ADDFILE
<MSG> Initial refactor
<DFF> @@ -0,0 +1,24 @@
+"""
+Queries Simple Method Tests
+
+"""
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
+
+from queries import simple
+
+
+class URITests(unittest.TestCase):
+
+ def test_uri_without_password(self):
... | 24 | Initial refactor | 0 | .py | py | bsd-3-clause | gmr/queries |
1336 | <NME> simple_tests.py
<BEF> ADDFILE
<MSG> Initial refactor
<DFF> @@ -0,0 +1,24 @@
+"""
+Queries Simple Method Tests
+
+"""
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
+
+from queries import simple
+
+
+class URITests(unittest.TestCase):
+
+ def test_uri_without_password(self):
... | 24 | Initial refactor | 0 | .py | py | bsd-3-clause | gmr/queries |
1337 | <NME> .travis.yml
<BEF> sudo: false
language: python
dist: xenial
env:
global:
- PATH=$HOME/.local/bin:$PATH
- AWS_DEFAULT_REGION=us-east-1
- secure: "inURdx4ldkJqQXL1TyvKImC3EnL5TixC1DlNMBYi5ttygwAk+mSSSw8Yc7klB6D1m6q79xUlHRk06vbz23CsXTM4AClC5Emrk6XN2GlUKl5WI+z+A2skI59buEhLWe7e2KzhB/AVx2E3TfKa0oY7raM0UUnaOkpV... | 4 | More trying to get travis to work | 3 | .yml | travis | bsd-3-clause | gmr/queries |
1338 | <NME> .travis.yml
<BEF> sudo: false
language: python
dist: xenial
env:
global:
- PATH=$HOME/.local/bin:$PATH
- AWS_DEFAULT_REGION=us-east-1
- secure: "inURdx4ldkJqQXL1TyvKImC3EnL5TixC1DlNMBYi5ttygwAk+mSSSw8Yc7klB6D1m6q79xUlHRk06vbz23CsXTM4AClC5Emrk6XN2GlUKl5WI+z+A2skI59buEhLWe7e2KzhB/AVx2E3TfKa0oY7raM0UUnaOkpV... | 4 | More trying to get travis to work | 3 | .yml | travis | bsd-3-clause | gmr/queries |
1339 | <NME> setup.py
<BEF> import os
import platform
import setuptools
# PYPY vs cpython
if platform.python_implementation() == 'PyPy':
install_requires = ['psycopg2cffi>=2.7.2,<3']
else:
install_requires = ['psycopg2>=2.5.1,<3']
# Install tornado if generating docs on readthedocs
if os.environ.get('READTHEDOCS', ... | 1 | Bump the version | 1 | .py | py | bsd-3-clause | gmr/queries |
1340 | <NME> setup.py
<BEF> import os
import platform
import setuptools
# PYPY vs cpython
if platform.python_implementation() == 'PyPy':
install_requires = ['psycopg2cffi>=2.7.2,<3']
else:
install_requires = ['psycopg2>=2.5.1,<3']
# Install tornado if generating docs on readthedocs
if os.environ.get('READTHEDOCS', ... | 1 | Bump the version | 1 | .py | py | bsd-3-clause | gmr/queries |
1341 | <NME> README.rst
<BEF> Queries: PostgreSQL Simplified
==============================
*Queries* is a BSD licensed opinionated wrapper of the psycopg2_ library for
interacting with PostgreSQL.
The popular psycopg2_ package is a full-featured python client. Unfortunately
as a developer, you're often repeating the same st... | 6 | Update the badges | 6 | .rst | rst | bsd-3-clause | gmr/queries |
1342 | <NME> README.rst
<BEF> Queries: PostgreSQL Simplified
==============================
*Queries* is a BSD licensed opinionated wrapper of the psycopg2_ library for
interacting with PostgreSQL.
The popular psycopg2_ package is a full-featured python client. Unfortunately
as a developer, you're often repeating the same st... | 6 | Update the badges | 6 | .rst | rst | bsd-3-clause | gmr/queries |
1343 | <NME> session_tests.py
<BEF> """
Tests for functionality in the session module
"""
import hashlib
import logging
import unittest
import mock
from psycopg2 import extras
import psycopg2
# Out of order import to ensure psycopg2cffi is registered
from queries import pool, results, session, utils
LOGGER = logging.getLo... | 2 | Dont let Session and TornadoSession share connections | 1 | .py | py | bsd-3-clause | gmr/queries |
1344 | <NME> session_tests.py
<BEF> """
Tests for functionality in the session module
"""
import hashlib
import logging
import unittest
import mock
from psycopg2 import extras
import psycopg2
# Out of order import to ensure psycopg2cffi is registered
from queries import pool, results, session, utils
LOGGER = logging.getLo... | 2 | Dont let Session and TornadoSession share connections | 1 | .py | py | bsd-3-clause | gmr/queries |
1345 | <NME> session.py
<BEF> """The Session class allows for a unified (and simplified) view of
interfacing with a PostgreSQL database server.
Connection details are passed in as a PostgreSQL URI and connections are pooled
by default, allowing for reuse of connections across modules in the Python
runtime without having to p... | 2 | Move cleanup back after finding issue that they were commented out for | 4 | .py | py | bsd-3-clause | gmr/queries |
1346 | <NME> session.py
<BEF> """The Session class allows for a unified (and simplified) view of
interfacing with a PostgreSQL database server.
Connection details are passed in as a PostgreSQL URI and connections are pooled
by default, allowing for reuse of connections across modules in the Python
runtime without having to p... | 2 | Move cleanup back after finding issue that they were commented out for | 4 | .py | py | bsd-3-clause | gmr/queries |
1347 | <NME> pool.py
<BEF> """
Connection Pooling
"""
import datetime
import logging
import os
import threading
import time
import weakref
import psycopg2
LOGGER = logging.getLogger(__name__)
DEFAULT_IDLE_TTL = 60
DEFAULT_MAX_SIZE = int(os.environ.get('QUERIES_MAX_POOL_SIZE', 1))
class Connection(object):
"""Contain... | 5 | Catch KeyError in clean | 1 | .py | py | bsd-3-clause | gmr/queries |
1348 | <NME> pool.py
<BEF> """
Connection Pooling
"""
import datetime
import logging
import os
import threading
import time
import weakref
import psycopg2
LOGGER = logging.getLogger(__name__)
DEFAULT_IDLE_TTL = 60
DEFAULT_MAX_SIZE = int(os.environ.get('QUERIES_MAX_POOL_SIZE', 1))
class Connection(object):
"""Contain... | 5 | Catch KeyError in clean | 1 | .py | py | bsd-3-clause | gmr/queries |
1349 | <NME> pool_manager_tests.py
<BEF> """
Tests for Manager class in the pool module
"""
import unittest
import uuid
import mock
from queries import pool
def mock_connection():
class ManagerTests(unittest.TestCase):
def setUp(self):
self.manager = pool.PoolManager.instance()
class ManagerTests(unittes... | 0 | Whitespace cleanup | 1 | .py | py | bsd-3-clause | gmr/queries |
1350 | <NME> pool_manager_tests.py
<BEF> """
Tests for Manager class in the pool module
"""
import unittest
import uuid
import mock
from queries import pool
def mock_connection():
class ManagerTests(unittest.TestCase):
def setUp(self):
self.manager = pool.PoolManager.instance()
class ManagerTests(unittes... | 0 | Whitespace cleanup | 1 | .py | py | bsd-3-clause | gmr/queries |
1351 | <NME> tornado_session_tests.py
<BEF> """
Tests for functionality in the tornado_session module
"""
import unittest
import mock
except ImportError:
import unittest
from queries import tornado_session
def setUp(self):
super(SessionConnectTests, self).setUp()
self.conn = mock.Mock()
se... | 60 | Initial TornadoSession tests | 0 | .py | py | bsd-3-clause | gmr/queries |
1352 | <NME> tornado_session_tests.py
<BEF> """
Tests for functionality in the tornado_session module
"""
import unittest
import mock
except ImportError:
import unittest
from queries import tornado_session
def setUp(self):
super(SessionConnectTests, self).setUp()
self.conn = mock.Mock()
se... | 60 | Initial TornadoSession tests | 0 | .py | py | bsd-3-clause | gmr/queries |
1353 | <NME> session_tests.py
<BEF> """
Tests for the session.Session class
"""
import mock
try:
import unittest2 as unittest
except ImportError:
import unittest
import psycopg2
from psycopg2 import extensions
LOGGER = logging.getLogger(__name__)
class SessionTestCase(unittest.TestCase):
URI = 'postgresql://f... | 16 | Update session pool usage and tests | 18 | .py | py | bsd-3-clause | gmr/queries |
1354 | <NME> session_tests.py
<BEF> """
Tests for the session.Session class
"""
import mock
try:
import unittest2 as unittest
except ImportError:
import unittest
import psycopg2
from psycopg2 import extensions
LOGGER = logging.getLogger(__name__)
class SessionTestCase(unittest.TestCase):
URI = 'postgresql://f... | 16 | Update session pool usage and tests | 18 | .py | py | bsd-3-clause | gmr/queries |
1355 | <NME> README.rst
<BEF> Queries: PostgreSQL Simplified
==============================
*Queries* is a BSD licensed opinionated wrapper of the psycopg2_ library for
interacting with PostgreSQL.
The popular psycopg2_ package is a full-featured python client. Unfortunately
as a developer, you're often repeating the same st... | 2 | Update the reference | 2 | .rst | rst | bsd-3-clause | gmr/queries |
1356 | <NME> README.rst
<BEF> Queries: PostgreSQL Simplified
==============================
*Queries* is a BSD licensed opinionated wrapper of the psycopg2_ library for
interacting with PostgreSQL.
The popular psycopg2_ package is a full-featured python client. Unfortunately
as a developer, you're often repeating the same st... | 2 | Update the reference | 2 | .rst | rst | bsd-3-clause | gmr/queries |
1357 | <NME> pool_tests.py
<BEF> """
Tests for functionality in the pool module
"""
import mock
try:
import unittest2 as unittest
except ImportError:
import unittest
import weakref
from queries import pool
class ConnectionTests(unittest.TestCase):
def setUp(self):
self.handle = mock.Mock()
sel... | 241 | Add coverage of queries.pool.Pool | 54 | .py | py | bsd-3-clause | gmr/queries |
1358 | <NME> pool_tests.py
<BEF> """
Tests for functionality in the pool module
"""
import mock
try:
import unittest2 as unittest
except ImportError:
import unittest
import weakref
from queries import pool
class ConnectionTests(unittest.TestCase):
def setUp(self):
self.handle = mock.Mock()
sel... | 241 | Add coverage of queries.pool.Pool | 54 | .py | py | bsd-3-clause | gmr/queries |
1359 | <NME> utils.py
<BEF> ADDFILE
<MSG> Utilities for URI parsing
<DFF> @@ -0,0 +1,58 @@
+"""
+Utility functions for access to OS level info and URI parsing
+
+"""
+import collections
+import os
+import pwd
+try:
+ from urllib import parse as _urlparse
+except ImportError:
+ import urlparse as _urlparse
+
+Parsed = c... | 58 | Utilities for URI parsing | 0 | .py | py | bsd-3-clause | gmr/queries |
1360 | <NME> utils.py
<BEF> ADDFILE
<MSG> Utilities for URI parsing
<DFF> @@ -0,0 +1,58 @@
+"""
+Utility functions for access to OS level info and URI parsing
+
+"""
+import collections
+import os
+import pwd
+try:
+ from urllib import parse as _urlparse
+except ImportError:
+ import urlparse as _urlparse
+
+Parsed = c... | 58 | Utilities for URI parsing | 0 | .py | py | bsd-3-clause | gmr/queries |
1361 | <NME> session.py
<BEF> """The Session class allows for a unified (and simplified) view of
interfacing with a PostgreSQL database server.
Connection details are passed in as a PostgreSQL URI and connections are pooled
by default, allowing for reuse of connections across modules in the Python
runtime without having to p... | 1 | Cleanup imports | 6 | .py | py | bsd-3-clause | gmr/queries |
1362 | <NME> session.py
<BEF> """The Session class allows for a unified (and simplified) view of
interfacing with a PostgreSQL database server.
Connection details are passed in as a PostgreSQL URI and connections are pooled
by default, allowing for reuse of connections across modules in the Python
runtime without having to p... | 1 | Cleanup imports | 6 | .py | py | bsd-3-clause | gmr/queries |
1363 | <NME> setup.py
<BEF> import os
import platform
import setuptools
# PYPY vs cpython
if platform.python_implementation() == 'PyPy':
install_requires = ['psycopg2cffi>=2.7.2,<3']
else:
install_requires = ['psycopg2>=2.5.1,<3']
# Install tornado if generating docs on readthedocs
if os.environ.get('READTHEDOCS', ... | 1 | Dont remove the pool on clean | 1 | .py | py | bsd-3-clause | gmr/queries |
1364 | <NME> setup.py
<BEF> import os
import platform
import setuptools
# PYPY vs cpython
if platform.python_implementation() == 'PyPy':
install_requires = ['psycopg2cffi>=2.7.2,<3']
else:
install_requires = ['psycopg2>=2.5.1,<3']
# Install tornado if generating docs on readthedocs
if os.environ.get('READTHEDOCS', ... | 1 | Dont remove the pool on clean | 1 | .py | py | bsd-3-clause | gmr/queries |
1365 | <NME> tornado_session_tests.py
<BEF> """
Tests for functionality in the tornado_session module
"""
import unittest
import mock
# Out of order import to ensure psycopg2cffi is registered
from queries import pool, tornado_session
from psycopg2 import extras
from tornado import concurrent, gen, ioloop, testing
class... | 6 | Remove test for removed listener dict, add more coverage | 3 | .py | py | bsd-3-clause | gmr/queries |
1366 | <NME> tornado_session_tests.py
<BEF> """
Tests for functionality in the tornado_session module
"""
import unittest
import mock
# Out of order import to ensure psycopg2cffi is registered
from queries import pool, tornado_session
from psycopg2 import extras
from tornado import concurrent, gen, ioloop, testing
class... | 6 | Remove test for removed listener dict, add more coverage | 3 | .py | py | bsd-3-clause | gmr/queries |
1367 | <NME> session_tests.py
<BEF> """
Tests for functionality in the session module
"""
import hashlib
import logging
import unittest
import mock
from psycopg2 import extras
import psycopg2
# Out of order import to ensure psycopg2cffi is registered
from queries import pool, results, session, utils
LOGGER = logging.getLo... | 1 | Fix hashlib/unicode issues in Python 3 | 1 | .py | py | bsd-3-clause | gmr/queries |
1368 | <NME> session_tests.py
<BEF> """
Tests for functionality in the session module
"""
import hashlib
import logging
import unittest
import mock
from psycopg2 import extras
import psycopg2
# Out of order import to ensure psycopg2cffi is registered
from queries import pool, results, session, utils
LOGGER = logging.getLo... | 1 | Fix hashlib/unicode issues in Python 3 | 1 | .py | py | bsd-3-clause | gmr/queries |
1369 | <NME> tornado_session.py
<BEF> """
Tornado Session Adapter
Use Queries asynchronously within the Tornado framework.
Example Use:
.. code:: python
class NameListHandler(web.RequestHandler):
def initialize(self):
self.session = queries.TornadoSession(pool_max_size=60)
@gen.coroutine
... | 4 | Add some logging and remove coroutine decorators | 3 | .py | py | bsd-3-clause | gmr/queries |
1370 | <NME> tornado_session.py
<BEF> """
Tornado Session Adapter
Use Queries asynchronously within the Tornado framework.
Example Use:
.. code:: python
class NameListHandler(web.RequestHandler):
def initialize(self):
self.session = queries.TornadoSession(pool_max_size=60)
@gen.coroutine
... | 4 | Add some logging and remove coroutine decorators | 3 | .py | py | bsd-3-clause | gmr/queries |
1371 | <NME> README.rst
<BEF> Queries: PostgreSQL Simplified
==============================
*Queries* is a BSD licensed opinionated wrapper of the psycopg2_ library for
interacting with PostgreSQL.
The popular psycopg2_ package is a full-featured python client. Unfortunately
as a developer, you're often repeating the same st... | 14 | Additional examples | 0 | .rst | rst | bsd-3-clause | gmr/queries |
1372 | <NME> README.rst
<BEF> Queries: PostgreSQL Simplified
==============================
*Queries* is a BSD licensed opinionated wrapper of the psycopg2_ library for
interacting with PostgreSQL.
The popular psycopg2_ package is a full-featured python client. Unfortunately
as a developer, you're often repeating the same st... | 14 | Additional examples | 0 | .rst | rst | bsd-3-clause | gmr/queries |
1373 | <NME> pool_tests.py
<BEF> """
Tests for functionality in the pool module
"""
import time
import unittest
import uuid
import mock
from queries import pool
MAX_POOL_SIZE = 100
def mock_connection():
conn = mock.MagicMock('psycopg2.extensions.connection')
conn.close = mock.Mock()
conn.closed = True
c... | 1 | Fix tests | 0 | .py | py | bsd-3-clause | gmr/queries |
1374 | <NME> pool_tests.py
<BEF> """
Tests for functionality in the pool module
"""
import time
import unittest
import uuid
import mock
from queries import pool
MAX_POOL_SIZE = 100
def mock_connection():
conn = mock.MagicMock('psycopg2.extensions.connection')
conn.close = mock.Mock()
conn.closed = True
c... | 1 | Fix tests | 0 | .py | py | bsd-3-clause | gmr/queries |
1375 | <NME> session_tests.py
<BEF> """
Tests for functionality in the session module
"""
import hashlib
import logging
import unittest
import mock
from psycopg2 import extras
import psycopg2
# Out of order import to ensure psycopg2cffi is registered
from queries import pool, results, session, utils
LOGGER = logging.getLo... | 1 | Return the hex digest string for the pid, fix tests | 1 | .py | py | bsd-3-clause | gmr/queries |
1376 | <NME> session_tests.py
<BEF> """
Tests for functionality in the session module
"""
import hashlib
import logging
import unittest
import mock
from psycopg2 import extras
import psycopg2
# Out of order import to ensure psycopg2cffi is registered
from queries import pool, results, session, utils
LOGGER = logging.getLo... | 1 | Return the hex digest string for the pid, fix tests | 1 | .py | py | bsd-3-clause | gmr/queries |
1377 | <NME> bootstrap
<BEF> #!/bin/sh
# vim: set ts=2 sts=2 sw=2 et:
test -n "$SHELLDEBUG" && set -x
if test -e /var/run/docker.sock
then
DOCKER_IP=127.0.0.1
else
echo "Docker environment not detected."
exit 1
fi
set -e
if test -z "$COMPOSE_PROJECT_NAME"
then
CWD=${PWD##*/}
export COMPOSE_PROJECT_NAME=${CWD/_/}
fi... | 1 | Simplify build dir creation | 1 | bootstrap | bsd-3-clause | gmr/queries | |
1378 | <NME> bootstrap
<BEF> #!/bin/sh
# vim: set ts=2 sts=2 sw=2 et:
test -n "$SHELLDEBUG" && set -x
if test -e /var/run/docker.sock
then
DOCKER_IP=127.0.0.1
else
echo "Docker environment not detected."
exit 1
fi
set -e
if test -z "$COMPOSE_PROJECT_NAME"
then
CWD=${PWD##*/}
export COMPOSE_PROJECT_NAME=${CWD/_/}
fi... | 1 | Simplify build dir creation | 1 | bootstrap | bsd-3-clause | gmr/queries | |
1379 | <NME> session.py
<BEF> """The Session class allows for a unified (and simplified) view of
interfacing with a PostgreSQL database server.
Connection details are passed in as a PostgreSQL URI and connections are pooled
by default, allowing for reuse of connections across modules in the Python
runtime without having to p... | 6 | Merge pull request #21 from nvllsvm/master | 6 | .py | py | bsd-3-clause | gmr/queries |
1380 | <NME> session.py
<BEF> """The Session class allows for a unified (and simplified) view of
interfacing with a PostgreSQL database server.
Connection details are passed in as a PostgreSQL URI and connections are pooled
by default, allowing for reuse of connections across modules in the Python
runtime without having to p... | 6 | Merge pull request #21 from nvllsvm/master | 6 | .py | py | bsd-3-clause | gmr/queries |
1381 | <NME> .checkignore
<BEF> ADDFILE
<MSG> Add for quantified code
<DFF> @@ -0,0 +1,2 @@
+setup.py
+tests
| 2 | Add for quantified code | 0 | checkignore | bsd-3-clause | gmr/queries | |
1382 | <NME> .checkignore
<BEF> ADDFILE
<MSG> Add for quantified code
<DFF> @@ -0,0 +1,2 @@
+setup.py
+tests
| 2 | Add for quantified code | 0 | checkignore | bsd-3-clause | gmr/queries | |
1383 | <NME> history.rst
<BEF> Version History
===============
-----------------
- Narrow the pin to psycopg2 < 2.8 due to a breaking change
- Fix Results iterator for Python 3.7 (#31 - `nvllsvm <https://github.com/nvllsvm>`_)
2.0.0 2018-01-29
-----------------
- REMOVED support for Python 2.6
- FIXED CPU Pegging bug: Cl... | 3 | Add to version history [ci-skip] | 1 | .rst | rst | bsd-3-clause | gmr/queries |
1384 | <NME> history.rst
<BEF> Version History
===============
-----------------
- Narrow the pin to psycopg2 < 2.8 due to a breaking change
- Fix Results iterator for Python 3.7 (#31 - `nvllsvm <https://github.com/nvllsvm>`_)
2.0.0 2018-01-29
-----------------
- REMOVED support for Python 2.6
- FIXED CPU Pegging bug: Cl... | 3 | Add to version history [ci-skip] | 1 | .rst | rst | bsd-3-clause | gmr/queries |
1385 | <NME> .travis.yml
<BEF> sudo: false
language: python
dist: xenial
env:
- pypy
- 3.2
- 3.3
# - 3.4
install:
- if [[ $TRAVIS_PYTHON_VERSION == 'pypy' ]]; then pip install psycopg2ct; fi
- test
- name: coverage
- name: deploy
if: tag IS present
services:
- postgresql
install:
- pip install awscli
... | 1 | Add python 3.4 | 1 | .yml | travis | bsd-3-clause | gmr/queries |
1386 | <NME> .travis.yml
<BEF> sudo: false
language: python
dist: xenial
env:
- pypy
- 3.2
- 3.3
# - 3.4
install:
- if [[ $TRAVIS_PYTHON_VERSION == 'pypy' ]]; then pip install psycopg2ct; fi
- test
- name: coverage
- name: deploy
if: tag IS present
services:
- postgresql
install:
- pip install awscli
... | 1 | Add python 3.4 | 1 | .yml | travis | bsd-3-clause | gmr/queries |
1387 | <NME> tornado_session.py
<BEF> """
Tornado Session Adapter
Use Queries asynchronously within the Tornado framework.
Example Use:
.. code:: python
class NameListHandler(web.RequestHandler):
def initialize(self):
self.session = queries.TornadoSession(pool_max_size=60)
@gen.coroutine
... | 0 | Remove LISTEN/NOTIFY support in tornado_session | 62 | .py | py | bsd-3-clause | gmr/queries |
1388 | <NME> tornado_session.py
<BEF> """
Tornado Session Adapter
Use Queries asynchronously within the Tornado framework.
Example Use:
.. code:: python
class NameListHandler(web.RequestHandler):
def initialize(self):
self.session = queries.TornadoSession(pool_max_size=60)
@gen.coroutine
... | 0 | Remove LISTEN/NOTIFY support in tornado_session | 62 | .py | py | bsd-3-clause | gmr/queries |
1389 | <NME> pool.py
<BEF> """
Connection Pooling
"""
import logging
import threading
import time
import weakref
import weakref
LOGGER = logging.getLogger(__name__)
DEFAULT_IDLE_TTL = 60
DEFAULT_MAX_SIZE = 1
class Connection(object):
class Connection(object):
"""Contains the handle to the connection, the current sta... | 2 | Merge pull request #9 from djt5019/add-max-pool-size-environ-variable | 1 | .py | py | bsd-3-clause | gmr/queries |
1390 | <NME> pool.py
<BEF> """
Connection Pooling
"""
import logging
import threading
import time
import weakref
import weakref
LOGGER = logging.getLogger(__name__)
DEFAULT_IDLE_TTL = 60
DEFAULT_MAX_SIZE = 1
class Connection(object):
class Connection(object):
"""Contains the handle to the connection, the current sta... | 2 | Merge pull request #9 from djt5019/add-max-pool-size-environ-variable | 1 | .py | py | bsd-3-clause | gmr/queries |
1391 | <NME> results_tests.py
<BEF> """
Tests for functionality in the results module
"""
import logging
import unittest
import mock
import psycopg2
from queries import results
LOGGER = logging.getLogger(__name__)
class ResultsTestCase(unittest.TestCase):
def setUp(self):
self.cursor = mock.MagicMock()
... | 13 | Allow iterating over empty query results | 0 | .py | py | bsd-3-clause | gmr/queries |
1392 | <NME> results_tests.py
<BEF> """
Tests for functionality in the results module
"""
import logging
import unittest
import mock
import psycopg2
from queries import results
LOGGER = logging.getLogger(__name__)
class ResultsTestCase(unittest.TestCase):
def setUp(self):
self.cursor = mock.MagicMock()
... | 13 | Allow iterating over empty query results | 0 | .py | py | bsd-3-clause | gmr/queries |
1393 | <NME> bootstrap
<BEF> #!/bin/sh
# vim: set ts=2 sts=2 sw=2 et:
test -n "$SHELLDEBUG" && set -x
if test -e /var/run/docker.sock
then
DOCKER_IP=127.0.0.1
else
echo "Docker environment not detected."
exit 1
fi
set -e
if test -z "$COMPOSE_PROJECT_NAME"
then
CWD=${PWD##*/}
export COMPOSE_PROJECT_NAME=${CWD/_/}
fi... | 2 | Replace echo with printf | 2 | bootstrap | bsd-3-clause | gmr/queries | |
1394 | <NME> bootstrap
<BEF> #!/bin/sh
# vim: set ts=2 sts=2 sw=2 et:
test -n "$SHELLDEBUG" && set -x
if test -e /var/run/docker.sock
then
DOCKER_IP=127.0.0.1
else
echo "Docker environment not detected."
exit 1
fi
set -e
if test -z "$COMPOSE_PROJECT_NAME"
then
CWD=${PWD##*/}
export COMPOSE_PROJECT_NAME=${CWD/_/}
fi... | 2 | Replace echo with printf | 2 | bootstrap | bsd-3-clause | gmr/queries | |
1395 | <NME> setup.py
<BEF> from setuptools import setup
import platform
# Make the install_requires
# PYPY vs cpython
if platform.python_implementation() == 'PyPy':
install_requires = ['psycopg2cffi>=2.7.2,<3']
else:
install_requires = ['psycopg2>=2.5.1,<3']
# Install tornado if generating docs on readthedocs
if os... | 2 | Fix setup.py to install the right thing | 1 | .py | py | bsd-3-clause | gmr/queries |
1396 | <NME> setup.py
<BEF> from setuptools import setup
import platform
# Make the install_requires
# PYPY vs cpython
if platform.python_implementation() == 'PyPy':
install_requires = ['psycopg2cffi>=2.7.2,<3']
else:
install_requires = ['psycopg2>=2.5.1,<3']
# Install tornado if generating docs on readthedocs
if os... | 2 | Fix setup.py to install the right thing | 1 | .py | py | bsd-3-clause | gmr/queries |
1397 | <NME> session.py
<BEF> """The Session class allows for a unified (and simplified) view of
interfacing with a PostgreSQL database server.
Connection details are passed in as a PostgreSQL URI and connections are pooled
by default, allowing for reuse of connections across modules in the Python
runtime without having to p... | 1 | Comment update [ci skip] | 2 | .py | py | bsd-3-clause | gmr/queries |
1398 | <NME> session.py
<BEF> """The Session class allows for a unified (and simplified) view of
interfacing with a PostgreSQL database server.
Connection details are passed in as a PostgreSQL URI and connections are pooled
by default, allowing for reuse of connections across modules in the Python
runtime without having to p... | 1 | Comment update [ci skip] | 2 | .py | py | bsd-3-clause | gmr/queries |
1399 | <NME> utils_tests.py
<BEF> """
Tests for functionality in the utils module
"""
import platform
import unittest
import mock
import queries
from queries import utils
class GetCurrentUserTests(unittest.TestCase):
@mock.patch('pwd.getpwuid')
def test_get_current_user(self, getpwuid):
"""get_current_us... | 3 | Change the pgsql scheme to postgresql | 3 | .py | py | bsd-3-clause | gmr/queries |