baldwin 0.0.1__tar.gz → 0.0.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.
Potentially problematic release.
This version of baldwin might be problematic. Click here for more details.
- {baldwin-0.0.1 → baldwin-0.0.3}/PKG-INFO +1 -1
- {baldwin-0.0.1 → baldwin-0.0.3}/baldwin/__init__.py +1 -1
- {baldwin-0.0.1 → baldwin-0.0.3}/baldwin/main.py +4 -3
- {baldwin-0.0.1 → baldwin-0.0.3}/pyproject.toml +3 -3
- {baldwin-0.0.1 → baldwin-0.0.3}/README.md +0 -0
- {baldwin-0.0.1 → baldwin-0.0.3}/baldwin/resources/default_gitattributes.txt +0 -0
- {baldwin-0.0.1 → baldwin-0.0.3}/baldwin/resources/default_gitignore.txt +0 -0
- {baldwin-0.0.1 → baldwin-0.0.3}/baldwin/resources/prettier.config.json +0 -0
- {baldwin-0.0.1 → baldwin-0.0.3}/baldwin/utils.py +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""Manage a home directory with Git."""
|
|
2
|
-
__version__ = '0.0.
|
|
2
|
+
__version__ = '0.0.3'
|
|
@@ -72,14 +72,16 @@ def init() -> None:
|
|
|
72
72
|
def auto_commit() -> None:
|
|
73
73
|
"""Automatic commit of changed and untracked files."""
|
|
74
74
|
repo = get_repo()
|
|
75
|
+
diff_items = repo.index.diff(None)
|
|
75
76
|
items_to_add = [
|
|
76
|
-
*[Path.home() / e.a_path
|
|
77
|
+
*[p for e in diff_items if (p := Path.home() / e.a_path).exists()], *[
|
|
77
78
|
x for x in (Path.home() / y
|
|
78
79
|
for y in repo.untracked_files) if x.is_file() and not is_binary(str(x))
|
|
79
80
|
]
|
|
80
81
|
]
|
|
81
82
|
format_(items_to_add)
|
|
82
83
|
repo.index.add(items_to_add)
|
|
84
|
+
repo.index.remove([p for e in diff_items if not (p := Path.home() / e.a_path).exists()])
|
|
83
85
|
repo.index.commit(f'Automatic commit @ {datetime.now(tz=UTC).isoformat()}',
|
|
84
86
|
committer=Actor('Auto-commiter', 'hgit@tat.sh'))
|
|
85
87
|
|
|
@@ -106,14 +108,13 @@ def install_units() -> None:
|
|
|
106
108
|
"""Install systemd units for automatic committing."""
|
|
107
109
|
bw = which('bw')
|
|
108
110
|
assert bw is not None
|
|
109
|
-
bw_p = Path(bw).resolve(strict=True)
|
|
110
111
|
service_file = Path('~/.config/systemd/user/home-vcs.service').expanduser()
|
|
111
112
|
service_file.write_text(f"""[Unit]
|
|
112
113
|
Description=Home directory VCS commit
|
|
113
114
|
|
|
114
115
|
[Service]
|
|
115
116
|
Type=oneshot
|
|
116
|
-
ExecStart={
|
|
117
|
+
ExecStart={bw} auto-commit
|
|
117
118
|
""")
|
|
118
119
|
log.debug('Wrote to `%s`.', service_file)
|
|
119
120
|
timer_file = Path('~/.config/systemd/user/home-vcs.timer').expanduser()
|
|
@@ -57,7 +57,7 @@ license = "MIT"
|
|
|
57
57
|
name = "baldwin"
|
|
58
58
|
readme = "README.md"
|
|
59
59
|
repository = "https://github.com/Tatsh/baldwin"
|
|
60
|
-
version = "0.0.
|
|
60
|
+
version = "0.0.3"
|
|
61
61
|
|
|
62
62
|
[tool.poetry.dependencies]
|
|
63
63
|
binaryornot = "^0.4.4"
|
|
@@ -73,9 +73,9 @@ optional = true
|
|
|
73
73
|
|
|
74
74
|
[tool.poetry.group.dev.dependencies]
|
|
75
75
|
binaryornot-stubs = "^0.0.3"
|
|
76
|
-
commitizen = "
|
|
76
|
+
commitizen = ">=3.31,<5.0"
|
|
77
77
|
mypy = "^1.13.0"
|
|
78
|
-
ruff = "
|
|
78
|
+
ruff = ">=0.7.4,<0.9.0"
|
|
79
79
|
yapf = "^0.43.0"
|
|
80
80
|
|
|
81
81
|
[tool.poetry.group.docs]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|