1
0
Fork 0

Merging upstream version 1.8.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 17:44:54 +01:00
parent d6182ff8b2
commit c82478bb50
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
9 changed files with 31 additions and 16 deletions

View file

@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
@ -36,7 +36,7 @@ jobs:
- name: Run Black
run: |
./setup.py lint
if: matrix.python-version == '3.6'
if: matrix.python-version == '3.7'
- name: Coverage
run: |

View file

@ -1,5 +1,5 @@
repos:
- repo: https://github.com/psf/black
rev: 21.12b0
rev: 22.3.0
hooks:
- id: black

View file

@ -1,3 +1,16 @@
## 1.8.0 - 2022-03-29
### Features
* Update compatible Python versions. (Thanks: [blazewicz])
* Add support for Python 3.10. (Thanks: [blazewicz])
* Drop support for Python 3.6. (Thanks: [blazewicz])
### Bug Fixes
* Upgrade cli_helpers to workaround Pygments regression.
* Use get_terminal_size from shutil instead of click.
## 1.7.0 - 2022-01-11
### Features

View file

@ -1,6 +1,6 @@
# Development Guide
This is a guide for developers who would like to contribute to this project. It is recommended to use Python 3.6 and above for development.
This is a guide for developers who would like to contribute to this project. It is recommended to use Python 3.7 and above for development.
If you're interested in contributing to litecli, thank you. We'd love your help!
You'll always get credit for your work.
@ -79,7 +79,7 @@ hasn't broken any existing functionality. To run the tests, just type in:
$ ./setup.py test
```
litecli supports Python 2.7 and 3.4+. You can test against multiple versions of
litecli supports Python 3.7+. You can test against multiple versions of
Python by running tox:
```bash

View file

@ -1 +1 @@
__version__ = "1.7.0"
__version__ = "1.8.0"

View file

@ -11,6 +11,7 @@ from datetime import datetime
from io import open
from collections import namedtuple
from sqlite3 import OperationalError
import shutil
from cli_helpers.tabular_output import TabularOutputFormatter
from cli_helpers.tabular_output import preprocessors
@ -815,7 +816,7 @@ class LiteCli(object):
"""Get the number of lines to reserve for the completion menu."""
reserved_space_ratio = 0.45
max_reserved_space = 8
_, height = click.get_terminal_size()
_, height = shutil.get_terminal_size()
return min(int(round(height * reserved_space_ratio)), max_reserved_space)
def get_last_query(self):

View file

@ -24,11 +24,11 @@ readme = open_file("README.md")
install_requirements = [
"click >= 4.1",
"Pygments>=1.6,<=2.11.1",
"Pygments>=1.6",
"prompt_toolkit>=3.0.3,<4.0.0",
"sqlparse",
"configobj >= 5.0.5",
"cli_helpers[styles] >= 1.0.1",
"cli_helpers[styles] >= 2.2.1",
]
@ -57,10 +57,10 @@ setup(
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: SQL",
"Topic :: Database",
"Topic :: Database :: Front-Ends",

View file

@ -2,6 +2,7 @@ import os
from collections import namedtuple
from textwrap import dedent
from tempfile import NamedTemporaryFile
import shutil
import click
from click.testing import CliRunner
@ -232,12 +233,12 @@ def test_reserved_space_is_integer():
def stub_terminal_size():
return (5, 5)
old_func = click.get_terminal_size
old_func = shutil.get_terminal_size
click.get_terminal_size = stub_terminal_size
shutil.get_terminal_size = stub_terminal_size
lc = LiteCli()
assert isinstance(lc.get_reserved_space(), int)
click.get_terminal_size = old_func
shutil.get_terminal_size = old_func
@dbtest

View file

@ -1,5 +1,5 @@
[tox]
envlist = py27, py34, py35, py36, py37
envlist = py37, py38, py39, py310
[testenv]
deps = pytest