swarmauri_gitfilter_minio 0.3.0.dev48__tar.gz → 0.11.0.dev1__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.
@@ -1,21 +1,23 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: swarmauri_gitfilter_minio
3
- Version: 0.3.0.dev48
3
+ Version: 0.11.0.dev1
4
4
  Summary: MinIO git filter for Peagen
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
7
7
  Keywords: swarmauri,sdk,standards,gitfilter,minio
8
8
  Author: Jacob Stewart
9
9
  Author-email: jacob@swarmauri.com
10
- Requires-Python: >=3.10,<3.13
10
+ Requires-Python: >=3.10,<3.15
11
11
  Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python
12
14
  Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
13
16
  Classifier: Programming Language :: Python :: 3.10
14
17
  Classifier: Programming Language :: Python :: 3.11
15
18
  Classifier: Programming Language :: Python :: 3.12
16
- Classifier: Operating System :: OS Independent
17
- Classifier: Programming Language :: Python
18
- Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
19
21
  Requires-Dist: minio
20
22
  Requires-Dist: peagen
21
23
  Requires-Dist: swarmauri_base
@@ -23,27 +25,21 @@ Requires-Dist: swarmauri_core
23
25
  Requires-Dist: swarmauri_standard
24
26
  Description-Content-Type: text/markdown
25
27
 
26
- ![Swarmauri Logo](https://github.com/swarmauri/swarmauri-sdk/blob/3d4d1cfa949399d7019ae9d8f296afba773dfb7f/assets/swarmauri.brand.theme.svg)
28
+ ![Swarmauri Logo](https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri_sdk_brand.png)
27
29
 
28
30
  <p align="center">
29
- <a href="https://pypi.org/project/swarmauri_gitfilter_minio/">
30
- <img src="https://img.shields.io/pypi/dm/swarmauri_gitfilter_minio" alt="PyPI - Downloads"/>
31
- </a>
31
+ <a href="https://pepy.tech/project/swarmauri_gitfilter_minio/">
32
+ <img src="https://static.pepy.tech/badge/swarmauri_gitfilter_minio/month" alt="PyPI - Downloads"/></a>
32
33
  <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_gitfilter_minio/">
33
- <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_gitfilter_minio.svg"/>
34
- </a>
34
+ <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_gitfilter_minio.svg"/></a>
35
35
  <a href="https://pypi.org/project/swarmauri_gitfilter_minio/">
36
- <img src="https://img.shields.io/pypi/pyversions/swarmauri_gitfilter_minio" alt="PyPI - Python Version"/>
37
- </a>
36
+ <img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
38
37
  <a href="https://pypi.org/project/swarmauri_gitfilter_minio/">
39
- <img src="https://img.shields.io/pypi/l/swarmauri_gitfilter_minio" alt="PyPI - License"/>
40
- </a>
38
+ <img src="https://img.shields.io/pypi/l/swarmauri_gitfilter_minio" alt="PyPI - License"/></a>
41
39
  <a href="https://pypi.org/project/swarmauri_gitfilter_minio/">
42
- <img src="https://img.shields.io/pypi/v/swarmauri_gitfilter_minio?label=swarmauri_gitfilter_minio&color=green" alt="PyPI - swarmauri_gitfilter_minio"/>
43
- </a>
44
- </p>
45
-
46
- ---
40
+ <img src="https://img.shields.io/pypi/v/swarmauri_gitfilter_minio?label=swarmauri_gitfilter_minio&color=green" alt="PyPI - swarmauri_gitfilter_minio"/></a>
41
+ <a href="https://discord.gg/N4UpBuQv8T">
42
+ <img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
47
43
 
48
44
  # Swarmauri Git Filter Minio
49
45
 
@@ -117,3 +113,5 @@ If you want to contribute to swarmauri-sdk, read up on our
117
113
  [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md)
118
114
  that will help you get started.
119
115
 
116
+
117
+
@@ -1,24 +1,18 @@
1
- ![Swarmauri Logo](https://github.com/swarmauri/swarmauri-sdk/blob/3d4d1cfa949399d7019ae9d8f296afba773dfb7f/assets/swarmauri.brand.theme.svg)
1
+ ![Swarmauri Logo](https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri_sdk_brand.png)
2
2
 
3
3
  <p align="center">
4
- <a href="https://pypi.org/project/swarmauri_gitfilter_minio/">
5
- <img src="https://img.shields.io/pypi/dm/swarmauri_gitfilter_minio" alt="PyPI - Downloads"/>
6
- </a>
4
+ <a href="https://pepy.tech/project/swarmauri_gitfilter_minio/">
5
+ <img src="https://static.pepy.tech/badge/swarmauri_gitfilter_minio/month" alt="PyPI - Downloads"/></a>
7
6
  <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_gitfilter_minio/">
8
- <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_gitfilter_minio.svg"/>
9
- </a>
7
+ <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_gitfilter_minio.svg"/></a>
10
8
  <a href="https://pypi.org/project/swarmauri_gitfilter_minio/">
11
- <img src="https://img.shields.io/pypi/pyversions/swarmauri_gitfilter_minio" alt="PyPI - Python Version"/>
12
- </a>
9
+ <img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
13
10
  <a href="https://pypi.org/project/swarmauri_gitfilter_minio/">
14
- <img src="https://img.shields.io/pypi/l/swarmauri_gitfilter_minio" alt="PyPI - License"/>
15
- </a>
11
+ <img src="https://img.shields.io/pypi/l/swarmauri_gitfilter_minio" alt="PyPI - License"/></a>
16
12
  <a href="https://pypi.org/project/swarmauri_gitfilter_minio/">
17
- <img src="https://img.shields.io/pypi/v/swarmauri_gitfilter_minio?label=swarmauri_gitfilter_minio&color=green" alt="PyPI - swarmauri_gitfilter_minio"/>
18
- </a>
19
- </p>
20
-
21
- ---
13
+ <img src="https://img.shields.io/pypi/v/swarmauri_gitfilter_minio?label=swarmauri_gitfilter_minio&color=green" alt="PyPI - swarmauri_gitfilter_minio"/></a>
14
+ <a href="https://discord.gg/N4UpBuQv8T">
15
+ <img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
22
16
 
23
17
  # Swarmauri Git Filter Minio
24
18
 
@@ -91,3 +85,5 @@ data = buffer.read()
91
85
  If you want to contribute to swarmauri-sdk, read up on our
92
86
  [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md)
93
87
  that will help you get started.
88
+
89
+
@@ -1,23 +1,23 @@
1
1
  [project]
2
2
  name = "swarmauri_gitfilter_minio"
3
- version = "0.3.0.dev48"
4
- authors = [
5
- { name = "Jacob Stewart", email = "jacob@swarmauri.com" }
6
- ]
3
+ version = "0.11.0.dev1"
4
+ authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
7
5
  description = "MinIO git filter for Peagen"
8
6
  readme = "README.md"
9
7
  license = "Apache-2.0"
10
8
  repository = "http://github.com/swarmauri/swarmauri-sdk"
11
- requires-python = ">=3.10,<3.13"
9
+ requires-python = ">=3.10,<3.15"
12
10
  classifiers = [
13
11
  "License :: OSI Approved :: Apache Software License",
12
+ "Operating System :: OS Independent",
13
+ "Programming Language :: Python",
14
14
  "Programming Language :: Python :: 3",
15
+ "Programming Language :: Python :: 3 :: Only",
15
16
  "Programming Language :: Python :: 3.10",
16
17
  "Programming Language :: Python :: 3.11",
17
18
  "Programming Language :: Python :: 3.12",
18
- "Operating System :: OS Independent",
19
- "Programming Language :: Python",
20
- "Programming Language :: Python :: 3 :: Only",
19
+ "Programming Language :: Python :: 3.13",
20
+ "Programming Language :: Python :: 3.14",
21
21
  ]
22
22
  dependencies = [
23
23
  "peagen",
@@ -35,7 +35,6 @@ keywords = [
35
35
  ]
36
36
 
37
37
  [tool.uv.sources]
38
- peagen = { workspace = true }
39
38
  swarmauri_core = { workspace = true }
40
39
  swarmauri_base = { workspace = true }
41
40
  swarmauri_standard = { workspace = true }
@@ -78,7 +77,7 @@ dev = [
78
77
  "pytest-xdist>=3.6.1",
79
78
  "pytest-json-report>=1.5.0",
80
79
  "python-dotenv",
81
- "requests>=2.32.3",
80
+ "httpx>=0.27",
82
81
  "flake8>=7.0",
83
82
  "pytest-timeout>=2.3.1",
84
83
  "ruff>=0.9.9",
@@ -1,4 +1,5 @@
1
- """Expose the :class:`~swarmauri_gitfilter_minio.minio_filter.MinioFilter` plugin."""
1
+ """Expose the :class:`~swarmauri_gitfilter_minio.minio_filter.MinioFilter`
2
+ plugin."""
2
3
 
3
4
  from .minio_filter import MinioFilter
4
5
 
@@ -1,4 +1,6 @@
1
- """Storage adapter and Git filter backed by a MinIO or S3-compatible service."""
1
+ """
2
+ Storage adapter and Git filter backed by a MinIO or S3-compatible service.
3
+ """
2
4
 
3
5
  from __future__ import annotations
4
6
 
@@ -59,16 +61,13 @@ class MinioFilter(StorageAdapterBase, GitFilterBase):
59
61
  self._endpoint = endpoint
60
62
  self._secure = secure
61
63
  self._bucket = bucket
62
- self._prefix = prefix.lstrip("/")
64
+ self._prefix = self.normalize_prefix(prefix)
63
65
 
64
66
  if not self._client.bucket_exists(bucket):
65
67
  self._client.make_bucket(bucket)
66
68
 
67
69
  def _full_key(self, key: str) -> str:
68
- key = key.lstrip("/")
69
- if self._prefix:
70
- return f"{self._prefix.rstrip('/')}/{key}"
71
- return key
70
+ return self.compose_key(self._prefix, key, allow_empty=True)
72
71
 
73
72
  @property
74
73
  def root_uri(self) -> str:
@@ -98,6 +97,7 @@ class MinioFilter(StorageAdapterBase, GitFilterBase):
98
97
  data = io.BytesIO(data.read()) # type: ignore[arg-type]
99
98
  size = len(data.getbuffer()) # type: ignore[attr-defined]
100
99
  data.seek(0)
100
+ normalized_key = self.normalize_key(key)
101
101
  self._client.put_object(
102
102
  self._bucket,
103
103
  self._full_key(key),
@@ -106,7 +106,7 @@ class MinioFilter(StorageAdapterBase, GitFilterBase):
106
106
  part_size=10 * 1024 * 1024,
107
107
  )
108
108
 
109
- return f"{self.root_uri}{key.lstrip('/')}"
109
+ return f"{self.root_uri}{normalized_key}"
110
110
 
111
111
  def download(self, key: str) -> BinaryIO:
112
112
  """Retrieve an object from the bucket.
@@ -138,7 +138,7 @@ class MinioFilter(StorageAdapterBase, GitFilterBase):
138
138
  for path in base.rglob("*"):
139
139
  if path.is_file():
140
140
  rel = path.relative_to(base).as_posix()
141
- key = f"{prefix.rstrip('/')}/{rel}" if prefix else rel
141
+ key = self.compose_key(prefix, rel)
142
142
  with path.open("rb") as fh:
143
143
  self.upload(key, fh)
144
144
 
@@ -157,7 +157,9 @@ class MinioFilter(StorageAdapterBase, GitFilterBase):
157
157
  key = key[len(self._prefix.rstrip("/")) + 1 :]
158
158
  yield key
159
159
 
160
- def download_prefix(self, prefix: str, dest_dir: str | os.PathLike) -> None:
160
+ def download_prefix(
161
+ self, prefix: str, dest_dir: str | os.PathLike
162
+ ) -> None:
161
163
  """Download all objects beneath a prefix into a directory.
162
164
 
163
165
  prefix (str): Key prefix to copy from the bucket.
@@ -167,7 +169,7 @@ class MinioFilter(StorageAdapterBase, GitFilterBase):
167
169
  """
168
170
  dest = Path(dest_dir)
169
171
  for rel_key in self.iter_prefix(prefix):
170
- target = dest / rel_key
172
+ target = self.download_target_for_key(dest, rel_key)
171
173
  target.parent.mkdir(parents=True, exist_ok=True)
172
174
  data = self.download(rel_key)
173
175
  with target.open("wb") as fh:
@@ -192,8 +194,12 @@ class MinioFilter(StorageAdapterBase, GitFilterBase):
192
194
  cfg = load_peagen_toml()
193
195
  minio_cfg = cfg.get("storage", {}).get("filters", {}).get("minio", {})
194
196
 
195
- access_key = minio_cfg.get("access_key") or os.getenv("MINIO_ACCESS_KEY", "")
196
- secret_key = minio_cfg.get("secret_key") or os.getenv("MINIO_SECRET_KEY", "")
197
+ access_key = minio_cfg.get("access_key") or os.getenv(
198
+ "MINIO_ACCESS_KEY", ""
199
+ )
200
+ secret_key = minio_cfg.get("secret_key") or os.getenv(
201
+ "MINIO_SECRET_KEY", ""
202
+ )
197
203
 
198
204
  return cls(
199
205
  endpoint=endpoint,