path-sync 0.3.2__tar.gz → 0.3.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: path-sync
3
- Version: 0.3.2
3
+ Version: 0.3.3
4
4
  Summary: Sync files from a source repo to multiple destination repos
5
5
  Author-email: EspenAlbert <espen.albert1@gmail.com>
6
6
  License-Expression: MIT
@@ -3,7 +3,7 @@
3
3
  from path_sync import copy
4
4
  from path_sync import config
5
5
 
6
- VERSION = "0.3.2"
6
+ VERSION = "0.3.3"
7
7
  __all__ = [
8
8
  "copy",
9
9
  "config",
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import fnmatch
3
4
  import glob as glob_mod
4
5
  from enum import StrEnum
5
6
  from pathlib import Path
@@ -39,12 +40,15 @@ class PathMapping(BaseModel):
39
40
  dest_path: str = ""
40
41
  sync_mode: SyncMode = SyncMode.SYNC
41
42
  exclude_dirs: set[str] = Field(default_factory=_default_exclude_dirs)
43
+ exclude_file_patterns: set[str] = Field(default_factory=set)
42
44
 
43
45
  def resolved_dest_path(self) -> str:
44
46
  return self.dest_path or self.src_path
45
47
 
46
48
  def is_excluded(self, path: Path) -> bool:
47
- return bool(self.exclude_dirs & set(path.parts))
49
+ if self.exclude_dirs & set(path.parts):
50
+ return True
51
+ return any(fnmatch.fnmatch(path.name, pat) for pat in self.exclude_file_patterns)
48
52
 
49
53
  def expand_dest_paths(self, repo_root: Path) -> list[Path]:
50
54
  dest_path = self.resolved_dest_path()
@@ -3,7 +3,7 @@
3
3
  # === OK_EDIT: path-sync header ===
4
4
  [project]
5
5
  name = "path-sync"
6
- version = "0.3.2"
6
+ version = "0.3.3"
7
7
  description = "Sync files from a source repo to multiple destination repos"
8
8
  requires-python = ">=3.13"
9
9
  license = "MIT"
File without changes
File without changes
File without changes
File without changes
File without changes