1
0
Fork 0
Commit Graph

127 Commits

Author SHA1 Message Date
Kevin Marsh c6c5f041c0
dependencies: add support for sqlparse 0.5.x (#1458) 2024-04-25 10:37:29 -07:00
Damien Baty 9f114c4549 feat: Replace pendulum by home-made duration-to-words function
`pgcli` uses Pendulum to display the query execution time in words:

    > select pg_sleep(62)
    +----------+
    | pg_sleep |
    |----------|
    |          |
    +----------+
    SELECT 1
    Time: 62.066s (1 minute 2 seconds), executed in: 62.063s (1 minute 2 seconds)

Pendulum 3 (which has been released in December 2023 and is now
written in Rust) does not build on 32-bit architectures [1]. As such,
installing `pgcli` on such architectures fails. We could pin Pendulum
to version 2 (which was written in Python and builds "everywhere"),
but requiring a whole library and its own dependencies for such a
small feature seems unwarranted.

This commit thus removes the requirement on Pendulum and replaces it
by a simple "duration-to-words" function.

Fixes #1451.

[1] Upstream issue: https://github.com/sdispater/pendulum/issues/784
2024-02-20 12:51:20 +01:00
ERYoung11 96eb37fd19
Fix psycopg installation error on windows, Issue #1413 (#1449)
* Fix Issue #1413, win32 psycopg

* Fix Issue #1413, win32 psycopg

* fixing syntax error

* black fix to a test

---------

Co-authored-by: Irina Truong <637013+j-bennet@users.noreply.github.com>
2024-02-05 21:44:05 -08:00
Dick Marinus 08cf5e720f
downgrade pendulum to released version (#1434)
* downgrade pendulum to released version

* install beta version of pendulum for 3.12
2023-10-29 16:04:00 -07:00
Irina Truong 6332e18b48
Drop python 3.7, add 3.12 (#1426)
* Fix deprecation.

* Drop python 3.7 and add 3.12.

* Bump pendulum.

* Changelog.

* Update gh actions.

* See if things pass without this scenario.

* Skip failing scenarios in 3.12.
2023-10-11 12:34:59 +08:00
Dick Marinus fa054a5546
add python 3.11 support (#1356)
* add python 3.11 support

* use beta version

* Python 11 is available.

Co-authored-by: Irina Truong <i.chernyavska@gmail.com>
2022-11-11 10:31:41 -08:00
Eric Young 647dd44ac6 reformat of setup.py 2022-09-01 11:55:44 -05:00
Eric Young 79df61f674 Small developer improvements for Windows-based devs. 2022-09-01 10:32:36 -05:00
Irina Truong 18071754bc
Port to psycopg3 (#1324)
* WIP.

* Add some comments about porting from psycopg 2 to 3 (#1318)

* WIP

* Disable _set_wait_callback()

* TransactionStatus.

* First working query.

* More pg3 changes.

* test_pgexecute still fails.

* Fix bytea support.

* Fix json and enum unicode.

* Get unit tests to pass.

* Behave tests still break, WIP.

* Prompt seems to be displayed fine, why don't the tests see the whitespace?

* Python version.

* Fix test.

* Black.

* Added black to dev reqs.

* nbu link for donations.

* Use psycopg.sql to format statement.

* Special case for show help in pgbouncer.

* Fix test.

* Added integration test.

* Install pgbouncer in ci.

* Fix integration test.

* Remove tmate session.

* Revert commenting out python versions.

* Pin pgspecial to >=2.

* Changelog.

Co-authored-by: Daniele Varrazzo <daniele.varrazzo@gmail.com>
Co-authored-by: Amjith Ramanujam <amjith.r@gmail.com>
2022-06-06 11:20:48 -07:00
Andrii Oriekhov 4f151b07e4
add GitHub URL for PyPi (#1322) 2022-03-19 13:48:46 -07:00
Irina Truong 7423f9d239
Bump pgspecial. (#1319) 2022-02-28 13:51:56 -08:00
Bruno Inec ed9d123073
Add SSH tunnel support (#1301)
* Add initial sshtunnel support

* Force CI to rerun.

* Fix unit test for 3.6.

* Black.

Co-authored-by: Irina Truong <i.chernyavska@gmail.com>
2022-02-18 14:57:42 -08:00
Amjith Ramanujam a981564f9d
Upgrade cli_helpers to workaround the Pygments regression. (#1310) 2022-01-18 12:33:26 -08:00
Amjith Ramanujam 6d2021b263
Workaround pygments related issue.
Related pygments issue: https://github.com/pygments/pygments/issues/2027
2022-01-10 12:57:36 -08:00
Kevin Marsh 34d6e080ff
dependencies: add support for sqlparse 0.4.x (#1224) 2020-12-01 16:03:38 -08:00
laixintao f985e1bdd8
test: test pgcli on python3.9 (#1214)
* test: test pgcli on python3.9

* test on 3.9

* use 3.9-dev version from travis.

* try to fix pexpect EOF.
2020-10-13 11:47:34 -07:00
laixintao e60d28f194
bugfix: revert prompt_toolkit to 2.0.6
This was introduced by: e9c97072af (  Use
InputMode.REPLACE_SINGLE (#1208) )

see also: https://github.com/dbcli/pgcli/pull/1197
2020-09-14 10:01:23 +08:00
bitkeen e9c97072af
Use InputMode.REPLACE_SINGLE (#1208)
InputMode.REPLACE_SINGLE was added to prompt-toolkit.
This fixes Exception <InputMode.REPLACE_SINGLE: 'vi-replace-single'>
in single-char replace mode when using prompt_toolkit>=3.0.6.
2020-09-05 14:30:46 -07:00
Tom Caruso 8f7e314508
Move from humanize to pendulum library for displaying query durations (#1199) 2020-07-28 23:08:19 -07:00
Dick Marinus 80bf05a3b3
Keep support for prompt_toolkit 2 (#1197)
* Keep support for prompt_toolkit 2

* include prompt toolkit 3
2020-07-08 12:28:24 -07:00
laixintao 0c24e8bda2
Support style for missing value. (#1186)
* Support style for missing value.

* update changelog.

* upgrade minimal version of cli_helpers, in order to use style for null.
2020-05-28 15:29:50 -07:00
Georgy Frolov bd705bd5c4
add python_requires constraint to setup.py (#1182) 2020-05-12 16:23:34 -07:00
赖信涛 b6e2a229e5
upgrade prompt-toolit to 3.0 (#1149)
* upgrade prompt-toolit to 3.0

fix: https://github.com/dbcli/pgcli/issues/1148

related:
https://github.com/prompt-toolkit/python-prompt-toolkit/issues/886

in order to make the `behave` test pass, I have to:

- extend timeout for database connection test.
- extend timeout for basic command expect.
- extend timeout for features/steps/crud_table.py:: see data selected.
- disable cpr for features but "run the cli"

* [ci] disable CPR for all behave tests.

* bugfix: remove duplicated prompt expect.

* [ci] delete CPR env setting.

* Revert "[ci] delete CPR env setting."

This reverts commit fe4d5b565e.

* revert the extending timeout back.

* [ci] test when didn't disable CPR.

* Revert "[ci] test when didn't disable CPR."

This reverts commit d379b1e736.
2020-04-05 20:56:31 -07:00
赖信涛 e9874e2f96
python3.8: add travis test and setup.py class. (#1157) 2020-03-18 09:11:10 -07:00
赖信涛 bc7a5d0100
Drop Python3.5. (#1154)
* Drop Python3.5.

* delete 3.5 from setup.py

* fix black format. Using python3.7 for development now.

* black target to py36
2020-03-11 13:58:13 -07:00
赖信涛 fd77549754
Deprecate Python2.7. (#1153)
* deprecate Python2.7.

So we can use latest version of prompt-toolit.
Relate: https://github.com/dbcli/pgcli/pull/1149

* black format, remove 2.7 support.

* using version py35 for black.

* Revert "black format, remove 2.7 support."

This reverts commit 4b6d0496cc.

* deprecated py27 using black.

* remove 2.7 from travis.

* update setup.py: delete python 2.7 support.
2020-03-09 20:14:51 -07:00
赖信涛 8fe316e537 Drop Python 3.4 support (#1141)
* remove python3.4 support.

Python 3.4 has reached end-of-life.
https://www.python.org/downloads/release/python-340/

* drop maximun version of pytest

* update changelog

* add laixintao to contributors, delete py34 from tox
2020-01-15 22:45:16 -08:00
Amjith Ramanujam 257d0f2786
Merge pull request #1119 from mmtj/setup-cleanup
setup: Simplify getting module version
2019-12-08 19:18:42 -08:00
Irina Truong 51d4d4a04c
J bennet/release 2.2.0 (#1126)
* Changelog.

* Bump pgspecial.

* Restrict prompt_toolkit to <3.0.0.
2019-12-04 09:24:17 -08:00
Martin Matějek 202ce851ce
setup: Simplify getting module version 2019-10-29 21:33:09 +01:00
Irina Truong c145291072 Bump psycopg2 to 2.8. 2019-10-28 09:19:13 -07:00
Telmo "Trooper 8c597751fd Allow psycopg2 up to 2.8.2 (#1060)
* Allow psycopg2 up to 2.8.2

This fixes the issue with pgcli not working on Arch Linux, since the package `python2-psycopg2` is already on 2.8.2.

* Added name to 'AUTHORS' and contribution to 'changelog.rst' referring to #2de6266

* Allow for newer versions of psycopg2 to be used
2019-05-29 21:14:32 -07:00
Irina Truong 8cb7009bcd
black all the things. (#1049)
* added black to develop guide

* no need for pep8radius.

* changelog.

* Add pre-commit checkbox.

* Add pre-commit to dev reqs.

* Add pyproject.toml for black.

* Pre-commit config.

* Add black to travis and dev reqs.

* Install and run black in travis.

* Remove black from dev reqs.

* Lower black target version.

* Re-format with black.
2019-05-25 13:08:56 -07:00
Amjith Ramanujam fe1b202c55
Merge branch 'master' into pr1047 2019-05-06 11:11:47 -07:00
Amjith Ramanujam 1908142adb Upgrade to sqlparse 0.3.0. 2019-05-06 09:05:56 -07:00
Irina Truong 3366be52fb Build pgcli with 3.7. 2019-05-03 21:36:21 -04:00
VVelox dc1c335632
Update setup.py 2019-05-03 04:21:25 -05:00
Irina Truong ab18b08903
Changelog update before release. Bump cli_helpers. (#1030) 2019-04-05 17:24:10 -07:00
Irina Truong d2aa094134
bump pgspecial req. (#981) 2018-12-20 11:33:36 -08:00
Dick Marinus 94475e6283 Require prompt_toolkit>=2.0.6. 2018-11-11 13:42:33 -08:00
Irina Truong 392491a74d
Cherry-picked prompt-toolkit 2.0 changes. (#930)
* Cherry-picked prompt-toolkit 2.0 changes.

* Increase help timeout.

* Missed one.

* Fixes editor command.

* Expect exact to fix named query error.

* Unicode is non-optional with ptk 2.0.

* Unicode literals all the things (almost).

* PEP8.

* Change how we swap completers.

* By default, bottom toolbar styles are reversed. We don't want that.

* Adapt styles to 2.0.

* The future is now. Switch to ptk 2.0 style names.

* PEP8.

* Flag for enable_open_in_editor.

* add class:prompt to prompt

* Removed workaround for #668. Some renaming.

* use pgcli.completer instead of app.current_buffer.completer

* enable_system_prompt=True like old prompt toolkit

* keep search_ignore_case enabled (was ignore_case)

* fix closing parenthese

* keep marking class:continuation token for continuation

* capture KeyboardInterrupt manually

AbortAction has been removed in Prompt_toolkit 2.0

* replace C-J with enter, add more comments

* reversed ([...]) to [(...)] (oops)

* pep8 fixes

* Does Vi mode have to be applied to session every time?

* (workaround) also enable vi_mode after edit command

* Fixed test errors after rebasing on master.
2018-09-28 14:18:40 -07:00
Irina Truong 41a2b49acc In fact bump even further. 2018-07-27 10:27:32 -07:00
Irina Truong 110a9c61f1 Bump pgspecial to 1.11.1. 2018-07-25 19:23:54 -07:00
Dick Marinus 868b81aa98 make keyring optional 2018-07-22 07:34:56 +02:00
Dick Marinus c17bcd66c8 exclude *.pyc from sdist and lower python3-keyring to >= 11.0.0 2018-07-14 09:41:54 +02:00
Amjith Ramanujam 5427ad9a45 Bump the version of pgspecial to 1.11.0 2018-05-20 21:30:03 -07:00
Chris Fournier 09a43ccd49 Remember prompted passwords using keyring 2018-05-14 11:30:50 -04:00
Irina Truong b95ac556ca Do not use psycopg2 2.8 yet. 2018-03-23 11:16:06 -07:00
Irina Truong dd579cd330 Revert to psycopg2, and add instructions for no-binary install. 2018-03-23 11:12:03 -07:00
Irina Truong 10904eee43 Changelog update, and bump pgspecial for the release. 2018-03-02 10:24:41 -08:00