desksync 0.1.0__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.
@@ -0,0 +1,36 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-python@v5
14
+ with:
15
+ python-version: "3.12"
16
+ - name: Build package
17
+ run: |
18
+ pip install build
19
+ python -m build
20
+ - uses: actions/upload-artifact@v4
21
+ with:
22
+ name: dist
23
+ path: dist/
24
+
25
+ publish:
26
+ needs: build
27
+ runs-on: ubuntu-latest
28
+ environment: pypi
29
+ permissions:
30
+ id-token: write
31
+ steps:
32
+ - uses: actions/download-artifact@v4
33
+ with:
34
+ name: dist
35
+ path: dist/
36
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,35 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.egg-info/
6
+ *.egg
7
+ dist/
8
+ build/
9
+ *.whl
10
+
11
+ # Virtual environments
12
+ .venv/
13
+ venv/
14
+ env/
15
+
16
+ # IDE
17
+ .idea/
18
+ .vscode/
19
+ *.swp
20
+ *.swo
21
+ *~
22
+
23
+ # OS
24
+ .DS_Store
25
+ Thumbs.db
26
+ desktop.ini
27
+
28
+ # Testing
29
+ .pytest_cache/
30
+ .coverage
31
+ htmlcov/
32
+
33
+ # Distribution
34
+ *.tar.gz
35
+ *.zip
desksync-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 aratech-jp
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,90 @@
1
+ Metadata-Version: 2.4
2
+ Name: desksync
3
+ Version: 0.1.0
4
+ Summary: Multi-platform project directory sync tool — sync your projects across Win/Mac/Linux
5
+ Project-URL: Homepage, https://github.com/tsubome/desksync
6
+ Project-URL: Issues, https://github.com/tsubome/desksync
7
+ Project-URL: Repository, https://github.com/tsubome/desksync
8
+ Author: tsubome
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Classifier: Environment :: Console
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development
21
+ Requires-Python: >=3.9
22
+ Requires-Dist: click>=8.0
23
+ Requires-Dist: httpx>=0.24.0
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
26
+ Requires-Dist: pytest>=7.0; extra == 'dev'
27
+ Description-Content-Type: text/markdown
28
+
29
+ # desksync
30
+
31
+ ![Python 3.9+](https://img.shields.io/badge/python-3.9%2B-blue)
32
+ ![License: MIT](https://img.shields.io/badge/license-MIT-green)
33
+
34
+ Sync your `~/projects` directory across Windows, macOS, and Linux. Sit at the same desk regardless of which PC you're on.
35
+
36
+ desksync uses Syncthing (P2P) for non-git files and GitHub for git repositories — so your work is always where you are.
37
+
38
+ ## How It Works
39
+
40
+ ```
41
+ ~/projects/
42
+ ├── my-app/ # git repo -> managed via GitHub (clone/push/pull)
43
+ ├── another-repo/ # git repo -> managed via GitHub
44
+ └── notes/ # plain dir -> synced via Syncthing (P2P)
45
+
46
+ .stignore auto-generated to exclude git repo contents from Syncthing.
47
+ Git repos tracked in a registry; auto-cloned on new machines after desksync init.
48
+ Syncthing is downloaded and managed automatically (isolated instance, custom ports).
49
+ ```
50
+
51
+ ## Quick Start
52
+
53
+ ```bash
54
+ pip install desksync
55
+
56
+ # On your first machine
57
+ desksync init
58
+
59
+ # On a new machine
60
+ desksync init
61
+ desksync post-switch
62
+ ```
63
+
64
+ ## Commands
65
+
66
+ | Command | Description |
67
+ |---|---|
68
+ | `desksync init` | Initialize desksync, download Syncthing, configure everything |
69
+ | `desksync status` | Show sync status of projects, git repos, and Syncthing |
70
+ | `desksync sync` | Trigger a sync cycle (push git repos, sync files) |
71
+ | `desksync scan` | Scan `~/projects` and update the git repo registry |
72
+ | `desksync pre-switch` | Prepare before switching to another machine (push all) |
73
+ | `desksync post-switch` | Set up after arriving on a new machine (clone all) |
74
+ | `desksync daemon` | Start the background sync daemon |
75
+ | `desksync devices` | List and manage paired Syncthing devices |
76
+ | `desksync upgrade` | Upgrade Syncthing to the latest version |
77
+
78
+ ## Requirements
79
+
80
+ - Python 3.9+
81
+ - Git
82
+ - GitHub account (for git repository sync)
83
+
84
+ Syncthing is downloaded and managed automatically — no manual installation required.
85
+
86
+ ## License
87
+
88
+ MIT — see [LICENSE](LICENSE) for details.
89
+
90
+ **Author:** tsubome — [https://github.com/tsubome/desksync](https://github.com/tsubome/desksync)
@@ -0,0 +1,62 @@
1
+ # desksync
2
+
3
+ ![Python 3.9+](https://img.shields.io/badge/python-3.9%2B-blue)
4
+ ![License: MIT](https://img.shields.io/badge/license-MIT-green)
5
+
6
+ Sync your `~/projects` directory across Windows, macOS, and Linux. Sit at the same desk regardless of which PC you're on.
7
+
8
+ desksync uses Syncthing (P2P) for non-git files and GitHub for git repositories — so your work is always where you are.
9
+
10
+ ## How It Works
11
+
12
+ ```
13
+ ~/projects/
14
+ ├── my-app/ # git repo -> managed via GitHub (clone/push/pull)
15
+ ├── another-repo/ # git repo -> managed via GitHub
16
+ └── notes/ # plain dir -> synced via Syncthing (P2P)
17
+
18
+ .stignore auto-generated to exclude git repo contents from Syncthing.
19
+ Git repos tracked in a registry; auto-cloned on new machines after desksync init.
20
+ Syncthing is downloaded and managed automatically (isolated instance, custom ports).
21
+ ```
22
+
23
+ ## Quick Start
24
+
25
+ ```bash
26
+ pip install desksync
27
+
28
+ # On your first machine
29
+ desksync init
30
+
31
+ # On a new machine
32
+ desksync init
33
+ desksync post-switch
34
+ ```
35
+
36
+ ## Commands
37
+
38
+ | Command | Description |
39
+ |---|---|
40
+ | `desksync init` | Initialize desksync, download Syncthing, configure everything |
41
+ | `desksync status` | Show sync status of projects, git repos, and Syncthing |
42
+ | `desksync sync` | Trigger a sync cycle (push git repos, sync files) |
43
+ | `desksync scan` | Scan `~/projects` and update the git repo registry |
44
+ | `desksync pre-switch` | Prepare before switching to another machine (push all) |
45
+ | `desksync post-switch` | Set up after arriving on a new machine (clone all) |
46
+ | `desksync daemon` | Start the background sync daemon |
47
+ | `desksync devices` | List and manage paired Syncthing devices |
48
+ | `desksync upgrade` | Upgrade Syncthing to the latest version |
49
+
50
+ ## Requirements
51
+
52
+ - Python 3.9+
53
+ - Git
54
+ - GitHub account (for git repository sync)
55
+
56
+ Syncthing is downloaded and managed automatically — no manual installation required.
57
+
58
+ ## License
59
+
60
+ MIT — see [LICENSE](LICENSE) for details.
61
+
62
+ **Author:** tsubome — [https://github.com/tsubome/desksync](https://github.com/tsubome/desksync)
@@ -0,0 +1,54 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "desksync"
7
+ version = "0.1.0"
8
+ description = "Multi-platform project directory sync tool — sync your projects across Win/Mac/Linux"
9
+ requires-python = ">=3.9"
10
+ license = "MIT"
11
+ readme = "README.md"
12
+ authors = [
13
+ { name = "tsubome" },
14
+ ]
15
+ classifiers = [
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.9",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
+ "License :: OSI Approved :: MIT License",
23
+ "Operating System :: OS Independent",
24
+ "Environment :: Console",
25
+ "Topic :: Software Development",
26
+ ]
27
+ dependencies = [
28
+ "click>=8.0",
29
+ "httpx>=0.24.0",
30
+ ]
31
+
32
+ [project.urls]
33
+ Homepage = "https://github.com/tsubome/desksync"
34
+ Issues = "https://github.com/tsubome/desksync"
35
+ Repository = "https://github.com/tsubome/desksync"
36
+
37
+ [project.optional-dependencies]
38
+ dev = [
39
+ "pytest>=7.0",
40
+ "pytest-asyncio>=0.21.0",
41
+ ]
42
+
43
+ [project.scripts]
44
+ desksync = "desksync.cli:main"
45
+
46
+ [tool.hatch.build.targets.wheel]
47
+ packages = ["src/desksync"]
48
+
49
+ [tool.ruff]
50
+ line-length = 120
51
+ target-version = "py39"
52
+
53
+ [tool.pytest.ini_options]
54
+ testpaths = ["tests"]
@@ -0,0 +1,67 @@
1
+ from __future__ import annotations
2
+
3
+ __version__ = "0.1.0"
4
+
5
+ __all__ = ["DeskSync", "PreSwitchResult", "PostSwitchResult", "SyncStatus", "__version__"]
6
+
7
+ from dataclasses import dataclass, field
8
+
9
+
10
+ @dataclass
11
+ class PreSwitchResult:
12
+ success: bool = False
13
+ git_pushed: list[str] = field(default_factory=list)
14
+ git_warnings: list[str] = field(default_factory=list)
15
+ syncthing_synced: bool = False
16
+ cloud_synced: bool = False
17
+ errors: list[str] = field(default_factory=list)
18
+
19
+
20
+ @dataclass
21
+ class PostSwitchResult:
22
+ success: bool = False
23
+ git_pulled: list[str] = field(default_factory=list)
24
+ git_conflicts: list[str] = field(default_factory=list)
25
+ syncthing_status: str = "unknown"
26
+ errors: list[str] = field(default_factory=list)
27
+
28
+
29
+ @dataclass
30
+ class SyncStatus:
31
+ # スケルトンのみ
32
+ pass
33
+
34
+
35
+ class DeskSync:
36
+ def __init__(self, projects_dir: str | None = None) -> None:
37
+ """Initialize DeskSync.
38
+
39
+ Args:
40
+ projects_dir: Path to the projects directory.
41
+ If None, reads from ~/.desksync/config.json.
42
+ """
43
+ raise NotImplementedError
44
+
45
+ def pre_switch(self) -> PreSwitchResult:
46
+ """Perform pre-switch synchronization (push git repos, sync files).
47
+
48
+ Returns:
49
+ PreSwitchResult with details of what was synchronized.
50
+ """
51
+ raise NotImplementedError
52
+
53
+ def post_switch(self) -> PostSwitchResult:
54
+ """Perform post-switch synchronization (pull git repos, check sync status).
55
+
56
+ Returns:
57
+ PostSwitchResult with details of what was synchronized.
58
+ """
59
+ raise NotImplementedError
60
+
61
+ def status(self) -> SyncStatus:
62
+ """Get current synchronization status.
63
+
64
+ Returns:
65
+ SyncStatus with current sync state.
66
+ """
67
+ raise NotImplementedError
@@ -0,0 +1,4 @@
1
+ from desksync.cli import main
2
+
3
+ if __name__ == "__main__":
4
+ main()