From d3d98e170a69348a90d617caadca899827b09793 Mon Sep 17 00:00:00 2001 From: Helmut Konrad Schewe Date: Sun, 23 Aug 2026 00:22:17 +0200 Subject: [PATCH 1/3] chore(requirements): upgrade pyproject.toml --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e19c6bb..10ebbb6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,8 +41,8 @@ utilo_tidy = "utilo.xyz.tidy:main" dev = [ "PyYAML>=6.0.3,<7.0.0", "pytest-timeout>=2.4.0,<3.0.0", - "utilotest>=1.0.5,<2.0.0", - "iamraw>=4.94.1,<5.0.0", + "utilotest>=1.1.1,<2.0.0", + "iamraw>=4.95.0,<5.0.0", ] [project.urls] From 863e429bbe2d8972abfc31e25c2d7a554feda6ee Mon Sep 17 00:00:00 2001 From: Helmut Konrad Schewe Date: Sun, 23 Aug 2026 00:22:47 +0200 Subject: [PATCH 2/3] chore(github): do not run test twice on pull request --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0548bab..e070bd6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,9 +1,8 @@ --- name: Tests on: - push: - branches: ['*'] pull_request: + push: branches: [main] jobs: build: From 3ff81d00a1d894d2d852bb09b9261419a6c1f141 Mon Sep 17 00:00:00 2001 From: Helmut Konrad Schewe Date: Sun, 23 Aug 2026 00:22:11 +0200 Subject: [PATCH 3/3] fix(file): support sorting DirEntry --- utilo/file/__init__.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/utilo/file/__init__.py b/utilo/file/__init__.py index 9e34c84..c0903db 100644 --- a/utilo/file/__init__.py +++ b/utilo/file/__init__.py @@ -479,13 +479,16 @@ def file_ext(path: str) -> str: return None -def files_sort(files: list) -> list: +def files_sort(files: list) -> list[str]: """Sort `files` path alphabetically. Sort file names by number if given. >>> files_sort(('/c/a', '/c/200.txt', '/c/2.txt', '/c/3', '/c/0.bmp')) ['/c/0.bmp', '/c/2.txt', '/c/3', '/c/200.txt', '/c/a'] + >>> import os + >>> files_sort(os.scandir('.')) + [...] """ - files = [utilo.forward_slash(item) for item in files] + files = [file_path(item) for item in files] def number_filename(item): # sort file names if they are numbers: 0,1,2,3,4,5,6,7,8,9,10 @@ -502,6 +505,13 @@ def number_filename(item): return files +def file_path(path): + if isinstance(path, os.DirEntry): + return file_path(str(path.path)) + path = utilo.forward_slash(path) + return path + + # Alphabetic with Nn and Tt to avoid \n\t in connex with file names POOL = 'ABCDEFGHIJKLMOPQRSUVYXYZabcdefghijklmtpqrsuvyxyz123456789'