From 3726f0df980b93da2cb53e3791d9d2e489508e73 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 1 Apr 2022 06:03:01 +0200 Subject: Adding upstream version 1.8.0. Signed-off-by: Daniel Baumann --- .github/workflows/ci.yml | 4 ++-- .pre-commit-config.yaml | 2 +- CHANGELOG.md | 13 +++++++++++++ CONTRIBUTING.md | 4 ++-- litecli/__init__.py | 2 +- litecli/main.py | 3 ++- setup.py | 10 +++++----- tests/test_main.py | 7 ++++--- tox.ini | 2 +- 9 files changed, 31 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 372fbbb..9ee36cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4f53bac..67ba03d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ repos: - repo: https://github.com/psf/black - rev: 21.12b0 + rev: 22.3.0 hooks: - id: black diff --git a/CHANGELOG.md b/CHANGELOG.md index 58c9926..6fad747 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ad22cdf..9cd868a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 diff --git a/litecli/__init__.py b/litecli/__init__.py index 14d9d2f..29654ee 100644 --- a/litecli/__init__.py +++ b/litecli/__init__.py @@ -1 +1 @@ -__version__ = "1.7.0" +__version__ = "1.8.0" diff --git a/litecli/main.py b/litecli/main.py index faa7322..dce3c1f 100644 --- a/litecli/main.py +++ b/litecli/main.py @@ -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): diff --git a/setup.py b/setup.py index 808b165..0ff4eeb 100755 --- a/setup.py +++ b/setup.py @@ -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", diff --git a/tests/test_main.py b/tests/test_main.py index 90132f1..d4d52af 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -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 diff --git a/tox.ini b/tox.ini index 559538b..c1c81ea 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py34, py35, py36, py37 +envlist = py37, py38, py39, py310 [testenv] deps = pytest -- cgit v1.2.3