path-sync 0.3.2__py3-none-any.whl → 0.3.3__py3-none-any.whl

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.
path_sync/__init__.py CHANGED
@@ -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()
@@ -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
@@ -1,4 +1,4 @@
1
- path_sync/__init__.py,sha256=m7PJh6WLWUKwFydw1lNBUGCWCD--J4Vou2S-WkP_KFg,153
1
+ path_sync/__init__.py,sha256=2ju41FHOI1W8Ewd9lcAf-v3Mp7vRXFeD72hSCyPlOoI,153
2
2
  path_sync/__main__.py,sha256=HDj3qgijDcK8k976qsAvKMvUq9fZEJTK-dZldUc5-no,326
3
3
  path_sync/config.py,sha256=XYuEK_bjSpAk_nZN0oxpEA-S3t9F6Qn0yznYLoQHIw8,568
4
4
  path_sync/copy.py,sha256=BpflW4086XJFSHHK4taYPgXtF07xHB8qrgm8TYqdM4E,120
@@ -10,12 +10,12 @@ path_sync/_internal/cmd_validate.py,sha256=e6m-JZlXAGr0ZRqfLhhrlmjs4w79p2WWnZo4I
10
10
  path_sync/_internal/file_utils.py,sha256=5C33qzKFQdwChi5YwUWBujj126t0P6dbGSU_5hWExpE,194
11
11
  path_sync/_internal/git_ops.py,sha256=rpG_r7VNH1KlBgqM9mz7xop0mpdy76Vs3rzCoxE1dIQ,5895
12
12
  path_sync/_internal/header.py,sha256=evgY2q_gfDdEytEt_jyJ7M_KdGzCpfdKBUnoh3v-0Go,2593
13
- path_sync/_internal/models.py,sha256=YLN_fi1n0LaYrpmrllHeJbQH_ryPtER5GGPnVCnkr0o,4274
13
+ path_sync/_internal/models.py,sha256=okHJkM2NsJ6Xe2HjJw6XqBTnIzCTQGniJRou6wra56g,4459
14
14
  path_sync/_internal/typer_app.py,sha256=lEGMRXql3Se3VbmwAohvpUaL2cbY-RwhPUq8kL7bPbc,177
15
15
  path_sync/_internal/validation.py,sha256=qhEha-pJiM5zkZlr4sj2I4ZqvqcWMEfL4IZu_LGatLI,2226
16
16
  path_sync/_internal/yaml_utils.py,sha256=yj6Bl54EltjLEcVKaiA5Ahb9byT6OUMh0xIEzTsrvnQ,498
17
- path_sync-0.3.2.dist-info/METADATA,sha256=rZJuJVeznXEleFmKcYFy0ziIfgic_doPOwhYlV7MGKc,8231
18
- path_sync-0.3.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
19
- path_sync-0.3.2.dist-info/entry_points.txt,sha256=jTsL0c-9gP-4_Jt3EPgihtpLcwQR0AFAf1AUpD50AlI,54
20
- path_sync-0.3.2.dist-info/licenses/LICENSE,sha256=OphKV48tcMv6ep-7j-8T6nycykPT0g8ZlMJ9zbGvdPs,1066
21
- path_sync-0.3.2.dist-info/RECORD,,
17
+ path_sync-0.3.3.dist-info/METADATA,sha256=E0c9qnwBL5yTRW7XXcH6yvFaHjQiM7ieV_xpEwXiBtI,8231
18
+ path_sync-0.3.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
19
+ path_sync-0.3.3.dist-info/entry_points.txt,sha256=jTsL0c-9gP-4_Jt3EPgihtpLcwQR0AFAf1AUpD50AlI,54
20
+ path_sync-0.3.3.dist-info/licenses/LICENSE,sha256=OphKV48tcMv6ep-7j-8T6nycykPT0g8ZlMJ9zbGvdPs,1066
21
+ path_sync-0.3.3.dist-info/RECORD,,