From 06761bdeee9ede85b2c7c48490330e7d40b797f0 Mon Sep 17 00:00:00 2001 From: Liran Funaro Date: Wed, 11 Sep 2024 18:43:50 +0300 Subject: [PATCH] Test with latest Python versions --- .github/workflows/test.yaml | 4 ++-- objsize/__init__.py | 5 +++-- objsize/traverse.py | 1 + test_objsize.py | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9ef8834..57b43bd 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -26,7 +26,7 @@ jobs: black ./*.py --check --diff - name: Lint with flake8 run: | - flake8 . --count --select=E,F,W,C --show-source --max-complexity=10 --max-line-length=120 --statistics --per-file-ignores='__init__.py:F401' + flake8 objsize --count --select=E,F,W,C --show-source --max-complexity=10 --max-line-length=120 --statistics --per-file-ignores='__init__.py:F401' - name: Lint with pylint run: | pylint objsize @@ -38,7 +38,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] + python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13.0-rc.2", "3.14.0-alpha.0" ] steps: - uses: actions/checkout@v3 diff --git a/objsize/__init__.py b/objsize/__init__.py index 3f4cdc4..1fa91fe 100644 --- a/objsize/__init__.py +++ b/objsize/__init__.py @@ -1,6 +1,7 @@ """ Traversal over Python's objects subtree and calculating the total size of the subtree (deep size). """ + import warnings from typing import Any, Iterable, Iterator, Optional @@ -111,7 +112,7 @@ def traverse_exclusive_bfs( yield from settings.traverse_exclusive_bfs(*objs, marked_set=marked_set, exclude_set=exclude_set) -def get_deep_size( +def get_deep_size( # pylint: disable=too-many-arguments *objs, exclude: Optional[Iterable[Any]] = None, marked_set: Optional[MarkedSet] = None, @@ -158,7 +159,7 @@ def get_deep_size( return settings.get_deep_size(*objs, marked_set=marked_set, exclude_set=exclude_set) -def get_exclusive_deep_size( +def get_exclusive_deep_size( # pylint: disable=too-many-arguments *objs, exclude: Optional[Iterable[Any]] = None, marked_set: Optional[MarkedSet] = None, diff --git a/objsize/traverse.py b/objsize/traverse.py index 809d366..c6c0807 100644 --- a/objsize/traverse.py +++ b/objsize/traverse.py @@ -1,6 +1,7 @@ """ Handling of traversal. """ + import collections import gc import inspect diff --git a/test_objsize.py b/test_objsize.py index d6312a7..35a4b6e 100644 --- a/test_objsize.py +++ b/test_objsize.py @@ -1,6 +1,7 @@ """ Unittests for `objsize`. """ + import gc import random import sys