1
0
Fork 0

Merge branch 'master' into pr1047

This commit is contained in:
Amjith Ramanujam 2019-05-06 11:11:47 -07:00 committed by GitHub
commit fe1b202c55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 36 additions and 15 deletions

View File

@ -1,9 +1,15 @@
dist: xenial
sudo: required
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
- "3.7"
before_install:
- which python
@ -43,4 +49,4 @@ services:
- postgresql
addons:
postgresql: "9.3"
postgresql: "9.6"

View File

@ -8,7 +8,13 @@ Bug fixes:
* Fix for "no attribute KeyringLocked" (#1040). (Thanks: `Irina Truong`_)
* Pgcli no longer works with password containing spaces (#1043). (Thanks: `Irina Truong`_)
* Load keyring only when keyring is enabled in the config file (#1041). (Thanks: `Zhaolong Zhu`_)
* No longer depend on sqlparse as being less than 0.3.0 with the release of sqlparse 0.3.0. (`VVelox`)
* No longer depend on sqlparse as being less than 0.3.0 with the release of sqlparse 0.3.0. (Thanks: `VVelox`_)
* Fix the broken support for pgservice . (Thanks: `Xavier Francisco`_)
Internal:
---------
* Add python 3.7 to travis build matrix. (Thanks: `Irina Truong`_)
2.1.0
=====
@ -965,4 +971,5 @@ Improvements:
.. _`Nathan Verzemnieks`: https://github.com/njvrzm
.. _`raylu`: https://github.com/raylu
.. _`Zhaolong Zhu`: https://github.com/zzl0
.. _`Xavier Francisco`: https://github.com/Qu4tro
.. _`VVelox`: https://github.com/VVelox

View File

@ -233,13 +233,21 @@ class PGExecute(object):
'dsn': dsn,
}
new_params.update(kwargs)
conn_params.update({
k: unicode2utf8(v) for k, v in new_params.items() if v is not None
})
if 'password' in conn_params and 'dsn' in conn_params:
conn_params['dsn'] = make_dsn(
conn_params['dsn'], password=conn_params.pop('password'))
if new_params['dsn']:
new_params = {
'dsn': new_params['dsn'],
'password': new_params['password']
}
if new_params['password']:
new_params['dsn'] = "{0} password={1}".format(
new_params['dsn'], new_params.pop('password')
)
conn_params.update({
k: unicode2utf8(v) for k, v in new_params.items() if v
})
conn = psycopg2.connect(**conn_params)
cursor = conn.cursor()

View File

@ -62,6 +62,7 @@ setup(
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: SQL',
'Topic :: Database',
'Topic :: Database :: Front-Ends',

11
tox.ini
View File

@ -1,11 +1,10 @@
[tox]
envlist = py27, py34, py35, py36
envlist = py27, py34, py35, py36, py37
[testenv]
deps = pytest
mock
pgspecial
humanize
psycopg2
deps = pytest>=2.7.0,<=3.0.7
mock>=1.0.1
behave>=1.2.4
pexpect==3.3
commands = py.test
behave tests/features
passenv = PGHOST