git-annex 10.20250520b7__py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.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.
git_annex/__init__.py ADDED
@@ -0,0 +1,57 @@
1
+ import os
2
+ import os.path as op
3
+ import sys
4
+
5
+
6
+ def cli():
7
+ """Emulate a symlink to a binary.
8
+
9
+ This script essentially calls the `git-annex` binary that is shipped
10
+ with the package, but using the `argv` list (including a potentially
11
+ different executable name) pass to the script itself.
12
+
13
+ On Unix-like systems, it `exec`s the binary, replacing the current process.
14
+ Windows does not support `exec`, so in that case, it relies on the
15
+ `executable` argument of `subprocess.run()` to achieve this.
16
+
17
+ This approach provides alternative means for git-annex's installation
18
+ method with symlinks pointing to a single binary, and works on platforms
19
+ without symlink support, and also in packages that cannot represent
20
+ symlinks.
21
+ """
22
+ exedir = op.dirname(__file__)
23
+ exe = op.join(exedir, 'git-annex')
24
+ if sys.platform.startswith('darwin'):
25
+ # we look for an embedded file magic DB,
26
+ # and instruct libmagic to use it
27
+ embedded_magic = op.join(exedir, 'magic.mgc')
28
+ if op.exists(embedded_magic):
29
+ os.environ['MAGIC'] = embedded_magic
30
+
31
+ if sys.platform.startswith('win'):
32
+ exec_subproc(f'{exe}.exe', sys.argv)
33
+ else:
34
+ os.execv(exe, sys.argv)
35
+
36
+
37
+ def exec_subproc(executable, argv):
38
+ import subprocess
39
+
40
+ try:
41
+ subprocess.run(
42
+ argv,
43
+ executable=executable,
44
+ shell=False,
45
+ check=True,
46
+ )
47
+ # try flush here to trigger a BrokenPipeError
48
+ # within the try-except block so we can handle it
49
+ # (happens if the calling process closed stdout
50
+ # already)
51
+ sys.stdout.flush()
52
+ except BrokenPipeError:
53
+ # setting it to None prevents Python from trying to
54
+ # flush again
55
+ sys.stdout = None
56
+ except subprocess.CalledProcessError as e:
57
+ sys.exit(e.returncode)
git_annex/git-annex ADDED
Binary file
git_annex/py.typed ADDED
File without changes
@@ -0,0 +1,134 @@
1
+ Metadata-Version: 2.4
2
+ Name: git-annex
3
+ Version: 10.20250520b7
4
+ Summary: manage files with git, without checking their contents into git
5
+ Project-URL: Homepage, https://git-annex.branchable.com/
6
+ Project-URL: Documentation, https://git-annex.branchable.com/git-annex
7
+ Project-URL: Issues, https://git-annex.branchable.com/bugs
8
+ Project-URL: Source, http://source.git-annex.branchable.com/?p=source.git
9
+ Project-URL: Changelog, http://source.git-annex.branchable.com/?p=source.git;a=blob;f=CHANGELOG;hb=HEAD
10
+ Author-email: Joey Hess <id@joeyh.name>
11
+ Maintainer-email: Michael Hanke <mih@ngln.eu>
12
+ License-Expression: AGPL-3.0-or-later
13
+ Keywords: data logistics,git,version control
14
+ Classifier: Development Status :: 6 - Mature
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Intended Audience :: End Users/Desktop
18
+ Classifier: Intended Audience :: Information Technology
19
+ Classifier: Intended Audience :: Science/Research
20
+ Classifier: License :: DFSG approved
21
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
22
+ Classifier: Natural Language :: English
23
+ Classifier: Operating System :: MacOS
24
+ Classifier: Operating System :: Microsoft :: Windows
25
+ Classifier: Operating System :: POSIX :: Linux
26
+ Classifier: Programming Language :: Haskell
27
+ Classifier: Topic :: Software Development :: Version Control
28
+ Classifier: Topic :: Software Development :: Version Control :: Git
29
+ Classifier: Topic :: System :: Archiving :: Backup
30
+ Classifier: Topic :: System :: Archiving :: Mirroring
31
+ Classifier: Topic :: System :: Archiving :: Packaging
32
+ Classifier: Topic :: Utilities
33
+ Requires-Python: >=3.9
34
+ Description-Content-Type: text/markdown
35
+
36
+ # Python wheel package for git-annex
37
+
38
+ [![Test git-annex wheel from PyPi](https://github.com/psychoinformatics-de/git-annex-wheel/actions/workflows/test-pypi-wheel.yaml/badge.svg)](https://github.com/psychoinformatics-de/git-annex-wheel/actions/workflows/test-pypi-wheel.yaml)
39
+
40
+ ## Why?
41
+
42
+ [Git-annex](https://git-annex.branchable.com/) is written in Haskell and plenty
43
+ of [installation methods](https://git-annex.branchable.com/install/) are
44
+ available. However, for deploying git-annex as a dependency of a Python
45
+ library/application, like [DataLad](https://datalad.org) or
46
+ [AnnexRemote](https://github.com/Lykos153/AnnexRemote), system packages
47
+ are a lot less flexible than Python's virtual environments, and other methods
48
+ are more complex and fragile.
49
+
50
+ With git-annex being available from PyPi, versioned dependencies and deployment
51
+ in application-specific environments are possible via standard means of Python
52
+ packaging.
53
+
54
+ ## Caveats
55
+
56
+ A standard git-annex deployment is (primarily) a single binary (`git-annex`),
57
+ and a bunch of symlinks that make this one binary fulfilled multiple roles
58
+ (`git-annex-shell`, `git-remote-annex`, etc.). A Python wheel, however, is a
59
+ ZIP file container with no support for symlinks, and also no support for
60
+ "post-install" scripts.
61
+
62
+ In order to square this circle, the git-annex binary is wrapped via regular
63
+ Python entrypoint scripts that handle calling git-annex as necessary. This
64
+ delivers a cross-platform compatible wheel, but at a start-up cost (~30ms vs
65
+ ~11ms on my laptop).
66
+
67
+ ## Installation
68
+
69
+ Get the package from [PyPi](https://pypi.org/project/git-annex/), and install like
70
+ any other package from PyPi.
71
+
72
+ [uv](https://docs.astral.sh/uv/) users can deploy git-annex in a dedicated virtual
73
+ environment via the one-liner:
74
+
75
+ ```
76
+ uv tool install git-annex
77
+ ```
78
+
79
+ ## git-annex build configuration
80
+
81
+ Git-annex is built with libmagic support.
82
+
83
+ ## Platform notes
84
+
85
+ ### Linux
86
+
87
+ The `manylinux` wheel is self-contained and includes copies of all libraries.
88
+ It only depends on the declared GLIBC versions.
89
+ The `magic.mgc` database is not included, and is assumed to be available on
90
+ the target system. Install it separately, if needed (e.g., `libmagic-mgc`
91
+ package).
92
+
93
+ ### Windows
94
+
95
+ The wheel is self-contained and includes a copy of libmagic and the `magic.mgc` database.
96
+
97
+ ### Mac
98
+
99
+ The wheel is self-contained and includes a copy of libmagic and the `magic.mgc` database.
100
+
101
+
102
+ ## Developer information
103
+
104
+ ### Sources
105
+
106
+ The sources for this package are available at
107
+ https://github.com/psychoinformatics-de/git-annex-wheel
108
+
109
+ The repository tracks the git-annex sources as a Git submodule.
110
+
111
+ ### Issues
112
+
113
+ For issues related to the Python wheel packaging of git-annex, please
114
+ use the tracker at https://github.com/psychoinformatics-de/git-annex-wheel/issues
115
+
116
+ ### How to update for a new git-annex release?
117
+
118
+ Advance the submodule `./git-annex` to the new release tag.
119
+
120
+ Now adjust the package version in `pyproject.toml` accordingly. This version
121
+ must follow the [rules for Python
122
+ packages](https://packaging.python.org/en/latest/discussions/versioning/).
123
+
124
+ The included (GitHub) action workflows will build a corresponding wheel
125
+ and upload it to PyPi.
126
+
127
+
128
+ ## Acknowledgements
129
+
130
+ This work was funded, in part, by
131
+
132
+ - Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under grant TRR 379 (546006540, Q02 project)
133
+ - Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under grant SFB 1451 (431549029, INF project)
134
+ - MKW-NRW: Ministerium für Kultur und Wissenschaft des Landes Nordrhein-Westfalen under the Kooperationsplattformen 2022 program, grant number: KP22-106A
@@ -0,0 +1,9 @@
1
+ git_annex-10.20250520b7.dist-info/WHEEL,sha256=6_2lANoj4akpF0dr94LsANkG1f93WWvG9zbNtT8RhqI,142
2
+ git_annex-10.20250520b7.dist-info/METADATA,sha256=WdllYufgVbQ1I3viAUzKGrlEPh3kJ9tkIkQRLtQqOaQ,5281
3
+ git_annex-10.20250520b7.dist-info/entry_points.txt,sha256=BI1LqRvI7ETq6hOuPgaT9O9cmmHJwYS3SthvRoNS43s,146
4
+ git_annex-10.20250520b7.dist-info/RECORD,,
5
+ git_annex/git-annex,sha256=tIkjmvMyqsgN8j0YrBWcVXHCNxWMtldoRnBCe0QHA-k,99411512
6
+ git_annex/__init__.py,sha256=71NXukas5SOL6UI65o830T-lAx4QC8h6B1PcYTRxL3g,1869
7
+ git_annex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ git_annex.libs/libmagic-bfa5e61a.so.1.0.0,sha256=hMol0fstxmHO59eaEoZhox5SSiLWBSeibqaylUx1ALo,132872
9
+ git_annex.libs/libgmp-40922323.so.10.3.0,sha256=MWOfBqrSPSsVLbEbD3CKo-a9gPXBME0bkUow1jZKA4Q,535856
@@ -0,0 +1,6 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: false
4
+ Tag: py3-none-manylinux_2_17_x86_64
5
+ Tag: py3-none-manylinux2014_x86_64
6
+
@@ -0,0 +1,5 @@
1
+ [console_scripts]
2
+ git-annex = git_annex:cli
3
+ git-annex-shell = git_annex:cli
4
+ git-remote-annex = git_annex:cli
5
+ git-remote-tor-annex = git_annex:cli
Binary file