Skip to content

Commit fef1134

Browse files
authored
Merge pull request #29 from data-science-extensions/updates
Updates
2 parents a3981f5 + 2ced1ff commit fef1134

10 files changed

Lines changed: 51 additions & 35 deletions

File tree

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ repos:
3333

3434
# Linter
3535
- repo: https://github.com/psf/black
36-
rev: "24.10.0"
36+
rev: "25.1.0"
3737
hooks:
3838
- id: black
3939
language_version: python3.13
@@ -48,7 +48,7 @@ repos:
4848

4949
# Run MyPy type checks
5050
- repo: https://github.com/pre-commit/mirrors-mypy
51-
rev: "v1.13.0"
51+
rev: "v1.15.0"
5252
hooks:
5353
- id: mypy
5454
files: src/toolbox_python
@@ -58,7 +58,7 @@ repos:
5858

5959
# Reorder Python imports
6060
- repo: https://github.com/pycqa/isort
61-
rev: "5.13.2"
61+
rev: "6.0.0"
6262
hooks:
6363
- id: isort
6464
name: isort (python)
@@ -67,7 +67,7 @@ repos:
6767

6868
# Find any outdated syntax and replace with modern equivalents
6969
- repo: https://github.com/asottile/pyupgrade
70-
rev: "v3.19.0"
70+
rev: "v3.19.1"
7171
hooks:
7272
- id: pyupgrade
7373
name: Upgrade Python features
@@ -76,7 +76,7 @@ repos:
7676

7777
# Check spelling
7878
- repo: https://github.com/codespell-project/codespell
79-
rev: "v2.3.0"
79+
rev: "v2.4.1"
8080
hooks:
8181
- id: codespell
8282
additional_dependencies:
@@ -87,15 +87,15 @@ repos:
8787

8888
# Remove unused import statements
8989
- repo: https://github.com/hadialqattan/pycln
90-
rev: "v2.4.0"
90+
rev: "v2.5.0"
9191
hooks:
9292
- id: pycln
9393
args:
9494
- "--all"
9595

9696
# Check poetry configs
9797
- repo: https://github.com/python-poetry/poetry
98-
rev: "1.8.0"
98+
rev: "2.1.1"
9999
hooks:
100100
- id: poetry-check
101101

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,22 @@ install-poetry:
3535
$(PYTHON) -m pip install poetry
3636
poetry --version
3737
install:
38+
poetry lock
3839
poetry install --no-interaction --only main
3940
install-dev:
41+
poetry lock
4042
poetry install --no-interaction --with dev
4143
install-docs:
44+
poetry lock
4245
poetry install --no-interaction --with docs
4346
install-test:
47+
poetry lock
4448
poetry install --no-interaction --with test
4549
install-dev-test:
50+
poetry lock
4651
poetry install --no-interaction --with dev,test
4752
install-all:
53+
poetry lock
4854
poetry install --no-interaction --with dev,docs,test
4955

5056

mkdocs.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ plugins:
115115
# - docstring_inheritance.griffe
116116
allow_inspection: true
117117
docstring_style: google
118-
docstring_options:
119-
replace_admonitions: no
120118
show_root_heading: true
121119
show_root_toc_entry: false
122120
show_root_full_path: true

pyproject.toml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
[tool.poetry]
1+
2+
[build-system]
3+
requires = ["poetry-core"]
4+
build-backend = "poetry.core.masonry.api"
5+
6+
[project]
27
name = "toolbox-python"
38
version = "1.0.4"
49
description = "Helper files/functions/classes for generic Python processes"
510
readme = "README.md"
611
license = "MIT"
712
authors = [
8-
"Admin <toolbox-python@data-science-extensions.com>",
13+
{name="Chris Mahoney", email="toolbox-python@data-science-extensions.com"},
914
]
1015
maintainers = [
11-
"Admin <toolbox-python@data-science-extensions.com>",
12-
]
13-
packages = [
14-
{ include = "toolbox_python", from = "src" },
16+
{name="Chris Mahoney", email="toolbox-python@data-science-extensions.com"},
1517
]
1618
classifiers = [
1719
"Topic :: Software Development :: Build Tools",
@@ -29,27 +31,32 @@ classifiers = [
2931
"Topic :: Software Development :: Testing :: Unit",
3032
"Topic :: Utilities",
3133
]
34+
requires-python = ">3.9,<4.0"
35+
dependencies = [
36+
"typeguard==4.*",
37+
"more-itertools==10.*",
38+
]
3239

33-
[tool.poetry.urls]
40+
[project.urls]
3441
Homepage = "https://data-science-extensions.com/python-toolbox"
3542
Documentation = "https://data-science-extensions.com/python-toolbox"
3643
Repository = "https://github.com/data-science-extensions/toolbox-python"
3744
Changelog = "https://github.com/data-science-extensions/toolbox-python/releases"
3845
Issues = "https://github.com/data-science-extensions/toolbox-python/issues"
3946

40-
[tool.poetry.dependencies]
41-
python = ">3.9,<4.0"
42-
typeguard = "4.*"
43-
more-itertools = "10.*"
47+
[tool.poetry]
48+
packages = [
49+
{ include = "toolbox_python", from = "src" },
50+
]
4451

4552
[tool.poetry.group.dev]
4653
optional = true
4754

4855
[tool.poetry.group.dev.dependencies]
49-
black = "24.*"
56+
black = "25.*"
5057
blacken-docs = "1.*"
5158
pre-commit = "4.*"
52-
isort = "5.*"
59+
isort = "6.*"
5360
codespell = "2.*"
5461
pyupgrade = "3.*"
5562
pylint = "3.*"
@@ -68,7 +75,7 @@ mkdocs-coverage = "1.*"
6875
mkdocs-autorefs = "1.*"
6976
livereload = "2.*"
7077
mike = "2.*"
71-
black = "24.*"
78+
black = "25.*"
7279
docstring-inheritance = "2.*"
7380

7481
[tool.poetry.group.test]
@@ -179,10 +186,6 @@ disable = [
179186

180187
[[tool.poetry_bumpversion.replacements]]
181188
files = [
182-
"src/toolbox_python/version.py",
189+
"src/toolbox_python/__init__.py",
183190
"src/tests/test_version.py",
184191
]
185-
186-
[build-system]
187-
requires = ["poetry-core"]
188-
build-backend = "poetry.core.masonry.api"

src/tests/test_output.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212

1313
# ## Python StdLib Imports ----
1414
import logging
15-
from typing import Generator, Literal, Union
15+
from collections.abc import Generator
16+
from functools import lru_cache
17+
from typing import Literal, Union
1618
from unittest import TestCase
1719

1820
# ## Python Third Party Imports ----
@@ -183,6 +185,7 @@ def _pass_fixtures(self, capsys: pytest.CaptureFixture) -> None:
183185
self.capsys: pytest.CaptureFixture = capsys
184186

185187
@staticmethod
188+
@lru_cache
186189
def get_list_of_words(num_words: int = 100) -> str_list:
187190
word_url = "https://www.mit.edu/~ecprice/wordlist.10000"
188191
response: requests.Response = requests.get(word_url)
@@ -262,7 +265,9 @@ def test_5_rowwise(self) -> None:
262265
assert output == expected
263266

264267
@parameterized.expand([("list"), ("tuple"), ("set"), ("generator")])
265-
def test_6_types(self, input_type: Literal["list", "tuple", "set", "generator"]) -> None:
268+
def test_6_types(
269+
self, input_type: Literal["list", "tuple", "set", "generator"]
270+
) -> None:
266271
words: str_list = self.get_list_of_words(4 * 3)
267272
expected: str = "\n".join(
268273
[

src/tests/test_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from unittest import TestCase
1515

1616
# ## Local First Party Imports ----
17-
from toolbox_python.version import __version__ as version
17+
from toolbox_python import __version__ as version
1818

1919

2020
# ---------------------------------------------------------------------------- #

src/toolbox_python/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
__version__ = "1.0.4"
2+
__author__ = "Chris Mahoney"

src/toolbox_python/lists.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def flatten(
195195
"""
196196
return list(
197197
itertools_collapse(
198-
iterable=list_of_lists,
198+
iterable=list_of_lists, # type: ignore
199199
base_type=base_type,
200200
levels=levels,
201201
)

src/toolbox_python/output.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@
3939

4040

4141
# ## Python StdLib Imports ----
42+
from collections.abc import Generator
4243
from logging import Logger, _nameToLevel
4344
from math import ceil
44-
from typing import Any, Generator, Literal, Optional, Union
45+
from typing import Any, Literal, Optional, Union
4546

4647
# ## Python Third Party Imports ----
4748
from typeguard import typechecked
@@ -382,7 +383,9 @@ def list_columns(
382383
]
383384
if columnwise:
384385
if len(segmented_list[-1]) != cols_wide:
385-
segmented_list[-1].extend([""] * (len(string_list) - len(segmented_list[-1])))
386+
segmented_list[-1].extend(
387+
[""] * (len(string_list) - len(segmented_list[-1]))
388+
)
386389
combined_list: Union[list[str_list], Any] = zip(*segmented_list)
387390
else:
388391
combined_list = segmented_list

src/toolbox_python/version.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)