From 7ef2dd2e2ea827ac029fc83b2b55f06447e3209a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BB?= =?UTF-8?q?=D0=B8=D0=BD=D0=BE=D0=B2?= Date: Tue, 17 Mar 2026 04:39:10 +0300 Subject: [PATCH 1/9] Bump version to 0.0.5 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 121c8c5..4772b55 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "dirstree" -version = "0.0.4" +version = "0.0.5" authors = [{ name = "Evgeniy Blinov", email = "zheni-b@yandex.ru" }] description = 'Another library for iterating through the contents of a directory' readme = "README.md" From 4e155cd2b395a9b6c085375a9452472380cd2a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BB?= =?UTF-8?q?=D0=B8=D0=BD=D0=BE=D0=B2?= Date: Tue, 17 Mar 2026 04:40:00 +0300 Subject: [PATCH 2/9] Sort dependencies alphabetically in pyproject.toml --- pyproject.toml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4772b55..8de3665 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,8 +9,12 @@ authors = [{ name = "Evgeniy Blinov", email = "zheni-b@yandex.ru" }] description = 'Another library for iterating through the contents of a directory' readme = "README.md" requires-python = ">=3.8" -dependencies = ['pathspec==0.12.1', 'printo>=0.0.10', 'cantok==0.0.32', 'sigmatch>=0.0.6'] - +dependencies = [ + 'printo>=0.0.10', + 'cantok==0.0.32', + 'sigmatch>=0.0.6', + 'pathspec==0.12.1', +] classifiers = [ "Operating System :: OS Independent", 'Operating System :: MacOS :: MacOS X', From 78c0d1609d603d3752c18895a77d88c704f41ae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BB?= =?UTF-8?q?=D0=B8=D0=BD=D0=BE=D0=B2?= Date: Tue, 17 Mar 2026 04:40:36 +0300 Subject: [PATCH 3/9] Update printo version requirement to 0.0.22 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8de3665..5ef4b3a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ description = 'Another library for iterating through the contents of a directory readme = "README.md" requires-python = ">=3.8" dependencies = [ - 'printo>=0.0.10', + 'printo>=0.0.22', 'cantok==0.0.32', 'sigmatch>=0.0.6', 'pathspec==0.12.1', From b649adcc4976ac85994447e2858e98cf5603324e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BB?= =?UTF-8?q?=D0=B8=D0=BD=D0=BE=D0=B2?= Date: Tue, 17 Mar 2026 04:40:48 +0300 Subject: [PATCH 4/9] Update sigmatch version to 0.0.8 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5ef4b3a..81dabcb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ requires-python = ">=3.8" dependencies = [ 'printo>=0.0.22', 'cantok==0.0.32', - 'sigmatch>=0.0.6', + 'sigmatch>=0.0.8', 'pathspec==0.12.1', ] classifiers = [ From 47bf12d73f7794cadf0c81536c06b20519ddfc96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BB?= =?UTF-8?q?=D0=B8=D0=BD=D0=BE=D0=B2?= Date: Tue, 17 Mar 2026 04:51:51 +0300 Subject: [PATCH 5/9] Rename descript_data_object to describe_data_object --- dirstree/crawlers/crawler.py | 4 ++-- dirstree/crawlers/group.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dirstree/crawlers/crawler.py b/dirstree/crawlers/crawler.py index 18090f6..a467fe3 100644 --- a/dirstree/crawlers/crawler.py +++ b/dirstree/crawlers/crawler.py @@ -3,7 +3,7 @@ import pathspec from cantok import AbstractToken, DefaultToken -from printo import descript_data_object, not_none +from printo import describe_data_object, not_none from sigmatch import PossibleCallMatcher from dirstree.crawlers.abstract import AbstractCrawler @@ -60,7 +60,7 @@ def __repr__(self) -> str: } filters.update(self.addictional_repr_filters) - return descript_data_object( + return describe_data_object( self.__class__.__name__, self.paths, { diff --git a/dirstree/crawlers/group.py b/dirstree/crawlers/group.py index d599a23..3565d1c 100644 --- a/dirstree/crawlers/group.py +++ b/dirstree/crawlers/group.py @@ -2,7 +2,7 @@ from typing import Generator, List from cantok import AbstractToken, DefaultToken -from printo import descript_data_object +from printo import describe_data_object from dirstree.crawlers.abstract import AbstractCrawler @@ -12,7 +12,7 @@ def __init__(self, crawlers: List[AbstractCrawler]) -> None: self.crawlers = crawlers def __repr__(self) -> str: - return descript_data_object( + return describe_data_object( type(self).__name__, (self.crawlers,), {}, From a9d59ae146064c5da5b1f760614fb654b2b45511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BB?= =?UTF-8?q?=D0=B8=D0=BD=D0=BE=D0=B2?= Date: Tue, 17 Mar 2026 04:53:46 +0300 Subject: [PATCH 6/9] Fix filter lambda display in test strings --- tests/test_crawler.py | 2 +- tests/test_python_crawler.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_crawler.py b/tests/test_crawler.py index da83183..50a2561 100644 --- a/tests/test_crawler.py +++ b/tests/test_crawler.py @@ -127,7 +127,7 @@ def test_crawl_test_directory_with_exclude_patterns_and_extensions( (Crawler('.', exclude=['*.py'], extensions=['.py']), "Crawler('.', extensions=['.py'], exclude=['*.py'])"), (Crawler('.', exclude=['*.py']), "Crawler('.', exclude=['*.py'])"), (Crawler('.', filter=custom_filter), "Crawler('.', filter=custom_filter)"), - (Crawler('.', filter=lambda x: True), "Crawler('.', filter=λ)"), # noqa: ARG005 + (Crawler('.', filter=lambda x: True), "Crawler('.', filter=lambda x: True)"), # noqa: ARG005 (Crawler('.', token=ConditionToken(lambda: True)), "Crawler('.', token=ConditionToken(λ))"), (Crawler('../dirstree') + Crawler('../cantok'), "CrawlersGroup([Crawler('../dirstree'), Crawler('../cantok')])"), (Crawler('../dirstree') + PythonCrawler('../cantok'), "CrawlersGroup([Crawler('../dirstree'), PythonCrawler('../cantok')])"), diff --git a/tests/test_python_crawler.py b/tests/test_python_crawler.py index 7ea4eaf..da8611f 100644 --- a/tests/test_python_crawler.py +++ b/tests/test_python_crawler.py @@ -74,7 +74,7 @@ def test_crawl_test_directory_with_exclude_inits( (PythonCrawler('usr/bin'), "PythonCrawler('usr/bin')"), (PythonCrawler('.', exclude=['*.py']), "PythonCrawler('.', exclude=['*.py'])"), (PythonCrawler('.', filter=custom_filter), "PythonCrawler('.', filter=custom_filter)"), - (PythonCrawler('.', filter=lambda x: True), "PythonCrawler('.', filter=λ)"), # noqa: ARG005 + (PythonCrawler('.', filter=lambda x: True), "PythonCrawler('.', filter=lambda x: True)"), # noqa: ARG005 (PythonCrawler('.', token=ConditionToken(lambda: True)), "PythonCrawler('.', token=ConditionToken(λ))"), (PythonCrawler('../dirstree') + PythonCrawler('../cantok'), "CrawlersGroup([PythonCrawler('../dirstree'), PythonCrawler('../cantok')])"), ], From d70fb353f0866fb3e71798b1670e2efd475ff6ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BB?= =?UTF-8?q?=D0=B8=D0=BD=D0=BE=D0=B2?= Date: Tue, 17 Mar 2026 04:55:59 +0300 Subject: [PATCH 7/9] Update repository URLs and badges to reflect new owner "mutating" --- README.md | 12 ++++++------ pyproject.toml | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 03a6ce7..921f2a6 100644 --- a/README.md +++ b/README.md @@ -3,19 +3,19 @@ [![Downloads](https://static.pepy.tech/badge/dirstree/month)](https://pepy.tech/project/dirstree) [![Downloads](https://static.pepy.tech/badge/dirstree)](https://pepy.tech/project/dirstree) -[![Coverage Status](https://coveralls.io/repos/github/pomponchik/dirstree/badge.svg?branch=main)](https://coveralls.io/github/pomponchik/dirstree?branch=main) -[![Lines of code](https://sloc.xyz/github/pomponchik/dirstree/?category=code)](https://github.com/boyter/scc/) -[![Hits-of-Code](https://hitsofcode.com/github/pomponchik/dirstree?branch=main)](https://hitsofcode.com/github/pomponchik/dirstree/view?branch=main) -[![Test-Package](https://github.com/pomponchik/dirstree/actions/workflows/tests_and_coverage.yml/badge.svg)](https://github.com/pomponchik/dirstree/actions/workflows/tests_and_coverage.yml) +[![Coverage Status](https://coveralls.io/repos/github/mutating/dirstree/badge.svg?branch=main)](https://coveralls.io/github/mutating/dirstree?branch=main) +[![Lines of code](https://sloc.xyz/github/mutating/dirstree/?category=code)](https://github.com/boyter/scc/) +[![Hits-of-Code](https://hitsofcode.com/github/mutating/dirstree?branch=main)](https://hitsofcode.com/github/mutating/dirstree/view?branch=main) +[![Test-Package](https://github.com/mutating/dirstree/actions/workflows/tests_and_coverage.yml/badge.svg)](https://github.com/mutating/dirstree/actions/workflows/tests_and_coverage.yml) [![Python versions](https://img.shields.io/pypi/pyversions/dirstree.svg)](https://pypi.python.org/pypi/dirstree) [![PyPI version](https://badge.fury.io/py/dirstree.svg)](https://badge.fury.io/py/dirstree) [![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) -[![DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/pomponchik/dirstree) +[![DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/mutating/dirstree) -![logo](https://raw.githubusercontent.com/pomponchik/dirstree/develop/docs/assets/logo_1.svg) +![logo](https://raw.githubusercontent.com/mutating/dirstree/develop/docs/assets/logo_1.svg) There are many libraries for traversing directories. You can also do this using the standard library. This particular library is a bit different in that: diff --git a/pyproject.toml b/pyproject.toml index 81dabcb..70f4fa0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,5 +53,5 @@ lint.select = ["ERA001", "YTT", "ASYNC", "BLE", "B", "A", "COM", "INP", "PIE", " format.quote-style = "single" [project.urls] -'Source' = 'https://github.com/pomponchik/dirstree' -'Tracker' = 'https://github.com/pomponchik/dirstree/issues' +'Source' = 'https://github.com/mutating/dirstree' +'Tracker' = 'https://github.com/mutating/dirstree/issues' From 7c456ad4a9732a3ce09f8465fd49d48af6124b32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BB?= =?UTF-8?q?=D0=B8=D0=BD=D0=BE=D0=B2?= Date: Tue, 17 Mar 2026 04:56:29 +0300 Subject: [PATCH 8/9] Add Python 3.15 support in CI and classifiers --- .github/workflows/lint.yml | 2 +- .github/workflows/tests_and_coverage.yml | 2 +- pyproject.toml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c03f651..a35f18f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: python-version: - ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"] + ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t", "3.15.0-alpha.1"] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/tests_and_coverage.yml b/.github/workflows/tests_and_coverage.yml index 451ec1f..27f68ce 100644 --- a/.github/workflows/tests_and_coverage.yml +++ b/.github/workflows/tests_and_coverage.yml @@ -9,7 +9,7 @@ jobs: matrix: os: [macos-latest, ubuntu-latest, windows-latest] python-version: - ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"] + ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t", "3.15.0-alpha.1"] steps: - uses: actions/checkout@v4 diff --git a/pyproject.toml b/pyproject.toml index 70f4fa0..1e711e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,7 @@ classifiers = [ 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: 3.13', 'Programming Language :: Python :: 3.14', + 'Programming Language :: Python :: 3.15', 'Programming Language :: Python :: Free Threading', 'Programming Language :: Python :: Free Threading :: 3 - Stable', 'License :: OSI Approved :: MIT License', From 54b060126d4580facc1b57268b5e49038c8f6f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BB?= =?UTF-8?q?=D0=B8=D0=BD=D0=BE=D0=B2?= Date: Tue, 17 Mar 2026 05:06:51 +0300 Subject: [PATCH 9/9] Update README.md with corrected links and improved phrasing for clarity and consistency --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 921f2a6..d29e444 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ ![logo](https://raw.githubusercontent.com/mutating/dirstree/develop/docs/assets/logo_1.svg) -There are many libraries for traversing directories. You can also do this using the standard library. This particular library is a bit different in that: +There are many libraries for traversing directories. You can also do this using the standard library. What makes this library different: - ⚗️ Filtering by file extensions, text patterns in [`.gitignore` format](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_ignoring), and using custom callables. - 🐍 Natively works with both [`Path` objects](https://docs.python.org/3/library/pathlib.html#basic-use) from the standard library and strings. @@ -37,23 +37,23 @@ There are many libraries for traversing directories. You can also do this using ## Installation -You can install [`dirstree`](https://pypi.python.org/pypi/dirstree) using pip: +You can install [`dirstree`](https://pypi.org/project/dirstree/) with `pip`: ```bash pip install dirstree ``` -You can also quickly try out this and other packages without having to install using [instld](https://github.com/pomponchik/instld). +You can also use [`instld`](https://github.com/pomponchik/instld) to quickly try out this package and others without installing them. ## Basic usage -It's very easy to work with the library in your own code: +The library is easy to use: - Create a crawler object, passing the path to the base directory and, if necessary, additional arguments. - Iterate through it. -The simplest code example would look like this: +The simplest example would look like this: ```python from dirstree import Crawler @@ -64,12 +64,12 @@ for file in crawler: print(file) ``` -> ↑ Here we output recursively (that is, including the contents of nested directories) all files from the current directory. At each iteration, we get a new [`Path` object](https://docs.python.org/3/library/pathlib.html#basic-use). +> ↑ This recursively prints all files in the current directory, including files in nested directories. At each iteration, we get a new [`Path` object](https://docs.python.org/3/library/pathlib.html#basic-use). ## Filtering -Iterating through the files in the directory, you may not want to view all files, but only files of a certain type. To do this, ignore all other files. How to do it? There are 3 ways: +Iterating through the files in the directory, you may not want to view all files, but only files of a certain type. To do this, ignore all other files. How to do it? There are three ways: - Bypass only files with the specified [extensions](https://en.wikipedia.org/wiki/Filename_extension), such as `.txt`, `.doc`, or `.py`. - Bypass files whose paths follow a specific text pattern. @@ -103,7 +103,7 @@ crawler = Crawler('.', exclude=['.git', 'venv']) # Exclude ".git" and "venv" di If you need a universal way to filter out unnecessary paths, pass your function as the `filter` parameter: ```python -crawler = Crawler('.', filter = lambda path: len(str(path)) == 7) # Iterate only on paths that are 7 characters long. +crawler = Crawler('.', filter=lambda path: len(str(path)) == 7) # Iterate only on paths that are 7 characters long. ``` @@ -111,7 +111,7 @@ crawler = Crawler('.', filter = lambda path: len(str(path)) == 7) # Iterate onl You can set an arbitrary condition under which file traversal will stop using [cancellation tokens](https://cantok.readthedocs.io/en/latest/the_pattern/) from the [`cantok`](https://github.com/pomponchik/cantok) library. -> There are 2 ways to do this ↓ +> There are two ways to do this ↓ 1. If you use the crawler as a one-time object for a single iteration, set the token when creating it: @@ -120,7 +120,7 @@ for path in Crawler('.', token=TimeoutToken(0.0001)): # Limit the iteration time print(path) ``` -2. If you plan to use the crawler object several times, use the `go()` method for iteration and pass a new token to it everytime: +2. If you plan to use the crawler object several times, use the `go()` method for iteration and pass a new token to it every time: ```python crawler = Crawler('.') @@ -141,7 +141,7 @@ for path in Crawler('../dirstree') + Crawler('../cantok'): print(path) ``` -> ↑ The paths that you will iterate on will be automatically deduplicated. +> ↑ The paths that you will iterate over will be automatically deduplicated. > ↑ You can also impose arbitrary restrictions on each of the summed objects, all of them will be taken into account.