Skip to content

Commit

Permalink
Merge branch 'master' into pr1047
Browse files Browse the repository at this point in the history
  • Loading branch information
amjith committed May 6, 2019
2 parents 8b14029 + 9f2d61b commit fe1b202
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 14 deletions.
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -43,4 +49,4 @@ services:
- postgresql

addons:
postgresql: "9.3"
postgresql: "9.6"
11 changes: 9 additions & 2 deletions changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
=====
Expand Down Expand Up @@ -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
18 changes: 13 additions & 5 deletions pgcli/pgexecute.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,22 @@ def connect(self, database=None, user=None, password=None, host=None,
'dsn': dsn,
}
new_params.update(kwargs)

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 is not None
k: unicode2utf8(v) for k, v in new_params.items() if v
})

if 'password' in conn_params and 'dsn' in conn_params:
conn_params['dsn'] = make_dsn(
conn_params['dsn'], password=conn_params.pop('password'))

conn = psycopg2.connect(**conn_params)
cursor = conn.cursor()
conn.set_client_encoding('utf8')
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
'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',
Expand Down
11 changes: 5 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit fe1b202

Please sign in to comment.