python-fsutil 0.16.0__tar.gz → 0.16.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. {python_fsutil-0.16.0/src/python_fsutil.egg-info → python_fsutil-0.16.1}/PKG-INFO +1 -1
  2. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/src/fsutil/metadata.py +1 -1
  3. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/src/fsutil/operations.py +3 -1
  4. {python_fsutil-0.16.0 → python_fsutil-0.16.1/src/python_fsutil.egg-info}/PKG-INFO +1 -1
  5. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/tests/test_operations.py +18 -0
  6. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/LICENSE.txt +0 -0
  7. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/MANIFEST.in +0 -0
  8. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/README.md +0 -0
  9. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/pyproject.toml +0 -0
  10. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/setup.cfg +0 -0
  11. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/setup.py +0 -0
  12. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/src/fsutil/__init__.py +0 -0
  13. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/src/fsutil/archives.py +0 -0
  14. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/src/fsutil/args.py +0 -0
  15. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/src/fsutil/checks.py +0 -0
  16. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/src/fsutil/converters.py +0 -0
  17. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/src/fsutil/deps.py +0 -0
  18. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/src/fsutil/info.py +0 -0
  19. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/src/fsutil/io.py +0 -0
  20. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/src/fsutil/paths.py +0 -0
  21. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/src/fsutil/perms.py +0 -0
  22. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/src/fsutil/py.typed +0 -0
  23. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/src/fsutil/types.py +0 -0
  24. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/src/python_fsutil.egg-info/SOURCES.txt +0 -0
  25. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/src/python_fsutil.egg-info/dependency_links.txt +0 -0
  26. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/src/python_fsutil.egg-info/top_level.txt +0 -0
  27. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/tests/__init__.py +0 -0
  28. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/tests/conftest.py +0 -0
  29. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/tests/test_archives.py +0 -0
  30. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/tests/test_args.py +0 -0
  31. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/tests/test_checks.py +0 -0
  32. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/tests/test_converters.py +0 -0
  33. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/tests/test_deps.py +0 -0
  34. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/tests/test_info.py +0 -0
  35. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/tests/test_io.py +0 -0
  36. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/tests/test_metadata.py +0 -0
  37. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/tests/test_paths.py +0 -0
  38. {python_fsutil-0.16.0 → python_fsutil-0.16.1}/tests/test_perms.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-fsutil
3
- Version: 0.16.0
3
+ Version: 0.16.1
4
4
  Summary: high-level file-system operations for lazy devs.
5
5
  Author-email: Fabio Caccamo <fabio.caccamo@gmail.com>
6
6
  Maintainer-email: Fabio Caccamo <fabio.caccamo@gmail.com>
@@ -4,4 +4,4 @@ __description__ = "high-level file-system operations for lazy devs."
4
4
  __email__ = "fabio.caccamo@gmail.com"
5
5
  __license__ = "MIT"
6
6
  __title__ = "python-fsutil"
7
- __version__ = "0.16.0"
7
+ __version__ = "0.16.1"
@@ -518,7 +518,9 @@ def _search_paths(path: PathIn, pattern: str) -> list[str]:
518
518
  pathname = os.path.join(path, pattern)
519
519
  paths = glob.glob(pathname, recursive=True)
520
520
  # normalize paths to use OS-specific separators
521
- paths = [os.path.normpath(path_result) for path_result in paths]
521
+ paths = [
522
+ os.path.relpath(os.path.normpath(path_result), path) for path_result in paths
523
+ ]
522
524
  return paths
523
525
 
524
526
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-fsutil
3
- Version: 0.16.0
3
+ Version: 0.16.1
4
4
  Summary: high-level file-system operations for lazy devs.
5
5
  Author-email: Fabio Caccamo <fabio.caccamo@gmail.com>
6
6
  Maintainer-email: Fabio Caccamo <fabio.caccamo@gmail.com>
@@ -518,6 +518,24 @@ def test_search_files(temp_path):
518
518
  assert results == expected_results
519
519
 
520
520
 
521
+ def test_search_files_with_relative_path(temp_path, monkeypatch):
522
+ """
523
+ Regression test: search_files with a relative path must not return an empty
524
+ list due to the double-prefix bug in _filter_paths.
525
+ """
526
+ fsutil.create_file(temp_path("a/b/c/IMG_1002.png"))
527
+ fsutil.create_file(temp_path("a/x/c/IMG_1005.png"))
528
+ fsutil.create_file(temp_path("a/b/c/IMG_1000.jpg"))
529
+
530
+ # change cwd to the parent of "a/" so that the relative path is valid
531
+ monkeypatch.chdir(temp_path(""))
532
+
533
+ results = fsutil.search_files("./a/", "**/c/IMG_*.png")
534
+
535
+ assert len(results) == 2
536
+ assert all(fsutil.is_file(result) for result in results)
537
+
538
+
521
539
  def test_search_dirs(temp_path):
522
540
  fsutil.create_file(temp_path("a/b/c/IMG_1000.jpg"))
523
541
  fsutil.create_file(temp_path("x/y/z/c/IMG_1001.jpg"))
File without changes
File without changes
File without changes