git-ftp 2.0.0.dev0__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.
@@ -0,0 +1,243 @@
1
+ Metadata-Version: 2.5
2
+ Name: git-ftp
3
+ Version: 2.0.0.dev0
4
+ Summary: Git powered FTP/FTPS/FTPES/SFTP client: deploy a Git repository by uploading only the files that changed since the last deployment. Native Python port of git-ftp.
5
+ Project-URL: Homepage, https://github.com/resmo/git-ftp
6
+ Project-URL: Documentation, https://github.com/resmo/git-ftp/blob/main/docs/git-ftp.1.md
7
+ Project-URL: Changelog, https://github.com/resmo/git-ftp/blob/main/CHANGELOG.md
8
+ Project-URL: Issues, https://github.com/resmo/git-ftp/issues
9
+ Project-URL: Upstream, https://github.com/git-ftp/git-ftp
10
+ Author-email: René Moser <mail@renemoser.net>
11
+ License-Expression: GPL-3.0-or-later
12
+ License-File: LICENSE
13
+ Keywords: deploy,deployment,ftp,ftps,git,git-ftp,sftp
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Intended Audience :: System Administrators
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3 :: Only
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Programming Language :: Python :: 3.14
26
+ Classifier: Topic :: Internet :: File Transfer Protocol (FTP)
27
+ Classifier: Topic :: Software Development :: Version Control :: Git
28
+ Classifier: Topic :: System :: Software Distribution
29
+ Classifier: Typing :: Typed
30
+ Requires-Python: >=3.10
31
+ Requires-Dist: click<9,>=8.2
32
+ Requires-Dist: paramiko<6,>=3.4
33
+ Requires-Dist: pycurl<8,>=7.46
34
+ Description-Content-Type: text/markdown
35
+
36
+ # git-ftp (Python)
37
+
38
+ This is a native Python port of the Bash [git-ftp](https://github.com/git-ftp/git-ftp): deploy a
39
+ Git repository to a server over **FTP, FTPS, FTPES or SFTP**, uploading only the
40
+ files that changed since the last deployment.
41
+
42
+ git-ftp records the deployed commit in a file on the remote (`.git-ftp.log`).
43
+ On the next push it diffs that commit against `HEAD` and transfers exactly the
44
+ files that were added, modified or deleted, in parallel. No server-side
45
+ software is needed.
46
+
47
+ If your server forbids writing dot-files (some hardened FTP servers reject any
48
+ name starting with a `.`), set a non-dot-file name with
49
+ `git config git-ftp.deployedsha1file gitftp.log`.
50
+
51
+ This port reads the same configuration and the same remote files as the Bash
52
+ original, so an existing deployment carries over unchanged. It needs Python 3.10
53
+ or newer and `git`; libcurl comes bundled with the `pycurl` wheel and SFTP is
54
+ spoken by `paramiko`. See [COMPATIBILITY.md](COMPATIBILITY.md) for what was
55
+ kept, fixed and added.
56
+
57
+ ## Install
58
+
59
+ ```sh
60
+ uv tool install git-ftp # or: pipx install git-ftp, pip install git-ftp
61
+ git ftp --version
62
+ ```
63
+
64
+ Git runs the `git-ftp` script as `git ftp` when it is on your `PATH`.
65
+
66
+ ## Usage
67
+
68
+ ```sh
69
+ # First deployment: upload everything and record the commit.
70
+ git ftp init -u alice -P ftp://example.com/public_html
71
+
72
+ # Every deployment after that: only what changed.
73
+ git ftp push -u alice -P ftp://example.com/public_html
74
+
75
+ # The remote already has the current files? Just record the commit.
76
+ git ftp catchup ftp://example.com/public_html
77
+
78
+ # What is deployed?
79
+ git ftp show
80
+ git ftp log
81
+ ```
82
+
83
+ `-P` prompts for the password. Better than typing it every time:
84
+
85
+ ```sh
86
+ git config git-ftp.url ftp://example.com/public_html
87
+ git config git-ftp.user alice
88
+ git config git-ftp.password s3cret # or:
89
+ git config git-ftp.password-command "pass show example.com/ftp"
90
+ git ftp push
91
+ ```
92
+
93
+ In CI, `GIT_FTP_URL`, `GIT_FTP_USER` and `GIT_FTP_PASSWORD` do the same without
94
+ touching any file.
95
+
96
+ ### Scopes
97
+
98
+ Several targets in one repository:
99
+
100
+ ```sh
101
+ git ftp add-scope production ftp://alice:s3cret@live.example.com/htdocs
102
+ git ftp add-scope staging ftp://alice:s3cret@staging.example.com/htdocs
103
+ git ftp push -s production
104
+ git ftp push -s # bare -s: the current branch name is the scope
105
+ ```
106
+
107
+ Scope keys (`git-ftp.<scope>.<key>`) override the plain keys; an explicit empty
108
+ scope value masks the default.
109
+
110
+ ### Protocols
111
+
112
+ | URL | Transport | Encryption |
113
+ |---|---|---|
114
+ | `ftp://host/path` | libcurl | none |
115
+ | `ftpes://host/path` | libcurl | explicit TLS (`AUTH TLS`), data channel too |
116
+ | `ftps://host/path` | libcurl | implicit TLS (port 990) |
117
+ | `sftp://host/path` | paramiko | SSH |
118
+
119
+ TLS certificates are verified; use `--cacert FILE` for a private CA or
120
+ `--insecure` to skip verification. SFTP host keys are checked against
121
+ `~/.ssh/known_hosts` (`ssh-keyscan host >> ~/.ssh/known_hosts` to add one).
122
+ SFTP authenticates with `--key FILE` (`--key-passphrase` for encrypted keys),
123
+ a running `ssh-agent`, or a password. `sftp://host/~/dir` and
124
+ `sftp://host//absolute/dir` work as in curl.
125
+
126
+ ### Choosing what to deploy
127
+
128
+ - `--syncroot DIR` deploys only `DIR`, with `DIR` as the remote root.
129
+ - `.git-ftp-ignore` lists shell globs of Git paths never to upload (`*` also
130
+ matches `/`, and a pattern must match the whole path).
131
+ - `.git-ftp-include` uploads untracked files: `!VERSION.txt` always, or
132
+ `css/style.css:scss/style.scss` whenever the tracked source changed. A
133
+ directory target (`vendor/:composer.lock`) uploads everything below it.
134
+ - `--dry-run` shows the plan; `-a` uploads everything; `-c SHA` diffs against
135
+ a specific commit; `-b BRANCH` deploys another branch.
136
+
137
+ ### Parallel transfers
138
+
139
+ Files are transferred over up to four connections. `--jobs N` or
140
+ `git config git-ftp.jobs N` changes that; `--jobs 1` is sequential. Uploads
141
+ happen first, then deletes, and the commit log is written last, only when every
142
+ upload succeeded, so an interrupted deploy never claims a commit it did not
143
+ finish. Ctrl-C stops promptly.
144
+
145
+ ### Consistent uploads while editing
146
+
147
+ `--worktree`, or `git config git-ftp.worktree true`, reads the files to upload
148
+ from a throwaway Git worktree checked out at the commit being deployed. Editing
149
+ the working tree while a long upload runs then cannot change what is sent. The
150
+ worktree is removed when the deploy finishes.
151
+
152
+ ### Hooks and locking
153
+
154
+ `.git/hooks/pre-ftp-push` (veto with a non-zero exit; skipped by `--no-verify`)
155
+ and `post-ftp-push` (`--enable-post-errors` makes its failure fatal) receive
156
+ `<scope-or-host> <url> <local-commit> <deployed-commit>`; the pre hook also gets
157
+ the NUL-separated `A path` / `D path` change list on stdin.
158
+
159
+ `--lock` writes `git-ftp.lck` on the remote for the duration of the deploy;
160
+ another deploy of a different commit is refused with exit 7. `git ftp unlock`
161
+ removes a stale lock.
162
+
163
+ ### download, pull, snapshot
164
+
165
+ These mirror the remote into the working tree:
166
+
167
+ ```sh
168
+ git ftp download # remote -> working tree (refuses to run with untracked files)
169
+ git ftp pull # download into a commit on the deployed revision, then merge
170
+ git ftp snapshot ftp://example.com/htdocs [dir] # new repository from a remote
171
+ ```
172
+
173
+ `--changed-only` limits `pull` to files that changed locally as well;
174
+ `--no-commit` (or `git-ftp.no-commit`) leaves the merge uncommitted.
175
+
176
+ ### Exit codes
177
+
178
+ | Code | Meaning |
179
+ |---|---|
180
+ | 0 | success |
181
+ | 1 | unexpected error |
182
+ | 2 | wrong usage |
183
+ | 3 | missing argument |
184
+ | 4 | error while uploading (also: remote unreachable, login failed) |
185
+ | 5 | error while downloading (also: `push` before `init`) |
186
+ | 6 | unknown protocol |
187
+ | 7 | remote locked |
188
+ | 8 | git error (not a repository, dirty working tree, bad branch) |
189
+ | 9 | hook failed |
190
+ | 10 | local filesystem error |
191
+ | 130 | interrupted |
192
+
193
+ ### Shell completion
194
+
195
+ ```sh
196
+ eval "$(_GIT_FTP_COMPLETE=bash_source git-ftp)" # zsh: zsh_source, fish: fish_source
197
+ ```
198
+
199
+ ## Development
200
+
201
+ ```sh
202
+ uv sync --all-groups
203
+ make lint typecheck test # ruff, mypy, pytest (in-process FTP/FTPS/SFTP servers)
204
+ make test-docker # pure-ftpd containers, Linux only
205
+ ```
206
+
207
+ The manual page source is `docs/git-ftp.1.md` (`make man` renders it with
208
+ pandoc).
209
+
210
+ ## Releasing
211
+
212
+ The version is derived from the Git tag by `hatch-vcs`; there is no version
213
+ string to edit. Pushing a `v*` tag runs `.github/workflows/publish.yml`, which
214
+ builds the sdist and wheel and publishes them to PyPI via Trusted Publishing (no
215
+ API token), then creates a GitHub release whose notes are the matching
216
+ `CHANGELOG.md` section.
217
+
218
+ One-time setup: on PyPI (and TestPyPI) add a Trusted Publisher for this
219
+ repository with workflow `publish.yml` and environment `pypi` (`testpypi`), and
220
+ create those two environments in the GitHub repository settings.
221
+
222
+ To cut a release:
223
+
224
+ ```sh
225
+ # 1. Move the entries under "## [Unreleased]" into a new "## [X.Y.Z]" section
226
+ # in CHANGELOG.md, then commit.
227
+ $EDITOR CHANGELOG.md
228
+ git add CHANGELOG.md
229
+ git commit -m "Release X.Y.Z"
230
+
231
+ # 2. Tag and push. The tag must be v<version>; the workflow checks that it
232
+ # matches the version hatch-vcs computes.
233
+ git tag -a -m "Release X.Y.Z" vX.Y.Z
234
+ git push origin main vX.Y.Z
235
+ ```
236
+
237
+ Between tags, builds report a development version such as `X.Y.Z.devN+g<hash>`.
238
+ To rehearse against TestPyPI without tagging, run the `publish` workflow manually
239
+ (`workflow_dispatch`) with the TestPyPI option enabled.
240
+
241
+ ## License
242
+
243
+ GPL-3.0-or-later
@@ -0,0 +1,47 @@
1
+ gitftp/__init__.py,sha256=Ikw0WeYNfTvwao29aUjTv0Wii-3VQTk2OqEHBmYZjBs,152
2
+ gitftp/__main__.py,sha256=R2mdiIGhhKqV_9HFeTZCHMraINwGoQECM5Vl6KhTMoY,93
3
+ gitftp/_version.py,sha256=5cx8xbyFQHkRrcxRTV41be3RVchbQnxXn__oF3JNCek,533
4
+ gitftp/auth.py,sha256=2-yLfqlXAxd3j1e0JPWw4BJDFjyLyGNA8pBHG7TD1TE,7133
5
+ gitftp/changeset.py,sha256=zws4uFJkjkWIbpib7n31y_55lvOpMnOFduxmnVXVKBs,3012
6
+ gitftp/config.py,sha256=7aRIOnWttITxg2CwYS7t0u50oHuIuDetTOJNnQYzP_g,5521
7
+ gitftp/deploy.py,sha256=-fmAw41irkoaq2rm2IdVB6G60rb64K6xKRi-i1pQ0ek,13096
8
+ gitftp/errors.py,sha256=A002wjwhKYl6iiHAPf9G_fSWij3BK79l10pXOirmwy8,1786
9
+ gitftp/gitrepo.py,sha256=CAQoeYSJsG2IkjRbFfx1ynRyByXQwoygGyepe2767g0,11113
10
+ gitftp/hooks.py,sha256=sbFKGN_Sb7laoQRyQPkHrpydt4-yWxqFuDm3n_fUDTw,809
11
+ gitftp/ignore.py,sha256=4BuXrNJA8KfVZOJOM0HUqf0D8TYK6MU05nCGTOxdxxw,2566
12
+ gitftp/include.py,sha256=d4MNvpGr2a3BWtDt9jdiv8Cd6sp7u4Ng6K0U4Jc6V4A,2822
13
+ gitftp/lock.py,sha256=Z47EvYZnsbdqhz5EN4jGYZITLW8-z5Wxe1iPtUJxf9A,2838
14
+ gitftp/mirror.py,sha256=pPJRSur9lRdWnO8KekGSRkipCcU2V3Ewey6zGrZSFKA,15703
15
+ gitftp/options.py,sha256=S3jAPr_S4SoSqb456TldyADX-kV4TvU8-MXeyAAdvqU,2031
16
+ gitftp/output.py,sha256=-RbYwddbix744xgvhhFDn74zuKHdfmEYJgCPOy-wfBA,4231
17
+ gitftp/session.py,sha256=GNvqgipIweHuz76DyIfv8L1LeTBItKSgDeoVOQts4vM,6742
18
+ gitftp/transfer.py,sha256=z6H_yegxNydAhTA-xDxGGAbdSRmpUq5RULbN7QcjQsk,8662
19
+ gitftp/url.py,sha256=r8QG8nDK7aVl5HCmXAMVdTUW208-G5MjVqLT6vC4NM8,6696
20
+ gitftp/version.py,sha256=8lmoEMp5HNbUFO7m8W08iX8_mpbSJ9chvoKZNGOWfJg,1094
21
+ gitftp/cli/__init__.py,sha256=p4TZt-ssH_DQ1hnw1I1IXMHo7565h2FyBIbj_YTx5JA,3553
22
+ gitftp/cli/cmd_add_scope.py,sha256=YSvScKeBaqj7j9WWPaKbmoubJx_jvHHTbV0e5rMCCME,665
23
+ gitftp/cli/cmd_catchup.py,sha256=al1DPGQmKiOWy0g1SxIYG4MIsbrY5RvPArF1kTrxXUU,551
24
+ gitftp/cli/cmd_download.py,sha256=MwTU43m76-fsthKWuNcNyYIbCtPysEt1Q66Z5ZBFUXg,560
25
+ gitftp/cli/cmd_help.py,sha256=ENybtGgrezRYnEgZE9dYxGIdwFkP7Nu1rBdD4auWRBk,1012
26
+ gitftp/cli/cmd_init.py,sha256=xz8oDypFRencBt6dNzL-ferUn_eQ1PAmhSPboZHF1C4,544
27
+ gitftp/cli/cmd_log.py,sha256=h3DlFrZoCTHgsKfylTexEehGcQVqIoleIHOPx_60GlQ,1055
28
+ gitftp/cli/cmd_pull.py,sha256=AhtrTVuHzPFjT5jgCUp2rgZcygNK2f-wzo-0gIsjOe8,551
29
+ gitftp/cli/cmd_push.py,sha256=KyArvPAPkEGET51Su_H96ZU8n4MweYLRVAPloZxmdFA,558
30
+ gitftp/cli/cmd_remove_scope.py,sha256=ZhRhI-jn9C74fl7hLU_8oW-5JwLNz2ff1dxFpjqEAm0,663
31
+ gitftp/cli/cmd_show.py,sha256=6_GA3k_PctxhXYy3JGgrOWdQ_RmFpEsmUs3or2DYMXg,1060
32
+ gitftp/cli/cmd_snapshot.py,sha256=-L99ZFY6jaz4o8G0FM4EwxsxnKPEMISaUjYNiRSCM34,639
33
+ gitftp/cli/cmd_unlock.py,sha256=DdwkDBx1dE5LbBNZQZ8Qpi4w1xniW32S2shT9m7bi9g,553
34
+ gitftp/cli/cmd_version.py,sha256=pReQfVTcqfBFu-wVAySOiGhNsIfA3TBOwtmCz9vLFtA,445
35
+ gitftp/cli/group.py,sha256=sNOPb3h9Yq_1u6jPlSrgztJovpROyc1aLulwVHAV-Kw,1676
36
+ gitftp/cli/options.py,sha256=756ZKpYFGXsxpOmrfW0I68d9Jk3uF03kLzZB5N0GLEA,6706
37
+ gitftp/transport/__init__.py,sha256=bQ_mu6vtmO3tsXoler2LFZLVkkb8BK7dDpuz6_lcVhs,69
38
+ gitftp/transport/base.py,sha256=6uZZYmwUl3EMPMeemTX7FIXcj44RmmFxydNlq9QwYIA,2641
39
+ gitftp/transport/curlftp.py,sha256=xparXlXDwSrclHgT4SHoZAZYOr6guB8TwMywKrheTCY,14536
40
+ gitftp/transport/listing.py,sha256=mH5K6lpaL-BRLIEod49r2j7HljsKkGJrnO9phiTV6rY,5301
41
+ gitftp/transport/registry.py,sha256=eJdDxNeQPaKsgVGtEISmeB6egXpoCAXSxHjpcY5yNqM,2148
42
+ gitftp/transport/sftp.py,sha256=nvoImAPR5iPYPZLNYlsNT3b4Kn5Q0Tp6OguLW8QVzpU,16459
43
+ git_ftp-2.0.0.dev0.dist-info/METADATA,sha256=XfsCaxbV96QT_h4vXLIlVT8Cbvu5ltUzUIkkfw__3Bk,9108
44
+ git_ftp-2.0.0.dev0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
45
+ git_ftp-2.0.0.dev0.dist-info/entry_points.txt,sha256=yWycBANI7-mO7zVD1tAsN6vDz6KaVD5gBB69-G1ooDA,44
46
+ git_ftp-2.0.0.dev0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
47
+ git_ftp-2.0.0.dev0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ git-ftp = gitftp.cli:main