From ebde05ea9451653da26ef5b6d3971721cd16fcd3 Mon Sep 17 00:00:00 2001 From: Tomas Capretto Date: Sun, 19 Jan 2025 10:23:16 -0300 Subject: [PATCH 1/3] Add Python 3.10-3.12 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1c060e2..d490b6f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] name: Set up Python ${{ matrix.python-version }} steps: From e349d1d899e56785bb5f115b4b07e3fb2024cbc2 Mon Sep 17 00:00:00 2001 From: Tomas Capretto Date: Sun, 19 Jan 2025 10:31:33 -0300 Subject: [PATCH 2/3] Update pylint and black versions, remove tests for 3.7 and 3.8 --- .github/workflows/tests.yml | 2 +- .pylintrc | 9 ++++----- flexitext/style.py | 2 +- flexitext/tests/test_flexitext.py | 1 + flexitext/textgrid.py | 2 +- requirements-dev.txt | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d490b6f..79c7c2a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12"] name: Set up Python ${{ matrix.python-version }} steps: diff --git a/.pylintrc b/.pylintrc index c1f3417..e6a5467 100644 --- a/.pylintrc +++ b/.pylintrc @@ -61,9 +61,8 @@ disable=missing-docstring, too-many-locals, too-many-branches, too-many-statements, - no-self-use, too-few-public-methods, - bad-continuation + too-many-positional-arguments # Enable the message, report, category or checker with the given id(s). You can @@ -135,8 +134,8 @@ max-module-lines=1000 # separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. # `trailing-comma` allows a space between comma and closing bracket: (a, ). # `empty-line` allows space-only lines. -no-space-check=trailing-comma, - dict-separator +# no-space-check=trailing-comma, +# dict-separator # Allow the body of a class to be on the same line as the declaration if body # contains single statement. @@ -465,4 +464,4 @@ min-public-methods=2 # Exceptions that will emit a warning when being caught. Defaults to # "Exception" -overgeneral-exceptions=Exception \ No newline at end of file +overgeneral-exceptions=builtins.Exception \ No newline at end of file diff --git a/flexitext/style.py b/flexitext/style.py index 2add60f..8240a54 100644 --- a/flexitext/style.py +++ b/flexitext/style.py @@ -65,7 +65,7 @@ def __call__(self, string): def __repr__(self): specs = [f"{k}={v}" for k, v in self.props.items()] - if sum([len(s) for s in specs]) < 100: + if sum(len(s) for s in specs) < 100: arg = ", ".join(specs) else: arg = spacify(multilinify(specs)) + "\n" diff --git a/flexitext/tests/test_flexitext.py b/flexitext/tests/test_flexitext.py index 56ae0e0..2463088 100644 --- a/flexitext/tests/test_flexitext.py +++ b/flexitext/tests/test_flexitext.py @@ -6,6 +6,7 @@ from flexitext import flexitext + # These tests are quite poor for now def test_flexitext(): text = "a piece of text" diff --git a/flexitext/textgrid.py b/flexitext/textgrid.py index 930f364..339b01e 100644 --- a/flexitext/textgrid.py +++ b/flexitext/textgrid.py @@ -14,7 +14,7 @@ def make_grid(texts): grid: list A nested list with `Text` instances. """ - row_n = sum([text.string.count("\n") for text in texts]) + 1 + row_n = sum(text.string.count("\n") for text in texts) + 1 grid = [[] for _ in range(row_n)] row_idx = 0 for text in texts: diff --git a/requirements-dev.txt b/requirements-dev.txt index 2d3da35..16055be 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -black==22.3.0 -pylint==2.10.2 +black==24.10.0 +pylint==3.3.3 pytest-cov>=2.6.1 pytest>=4.4.0 \ No newline at end of file From 4bbcc65ed4832e359c01f80e771bf10cfc9f7815 Mon Sep 17 00:00:00 2001 From: Tomas Capretto Date: Sun, 19 Jan 2025 10:33:19 -0300 Subject: [PATCH 3/3] target version py310 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9ddc9a6..af25853 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [tool.black] line-length = 100 -target-version = ['py37', 'py38'] \ No newline at end of file +target-version = ["py310"] \ No newline at end of file