scmrepo 3.3.8__py3-none-any.whl → 3.3.9__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.

Potentially problematic release.


This version of scmrepo might be problematic. Click here for more details.

@@ -2,10 +2,10 @@ import io
2
2
  import logging
3
3
  from typing import TYPE_CHECKING, Callable, Optional
4
4
 
5
- from pygit2 import GIT_FILTER_CLEAN, Filter, Passthrough
5
+ from pygit2 import GIT_FILTER_CLEAN, Filter, Passthrough # type: ignore[attr-defined]
6
6
 
7
7
  if TYPE_CHECKING:
8
- from pygit2 import FilterSource
8
+ from pygit2 import FilterSource # type: ignore[attr-defined]
9
9
 
10
10
  logger = logging.getLogger(__name__)
11
11
 
@@ -17,7 +17,7 @@ class LFSFilter(Filter):
17
17
  self._smudge_buf: Optional[io.BytesIO] = None
18
18
  self._smudge_root: Optional[str] = None
19
19
 
20
- def check(self, src: "FilterSource", attr_values: list[str]):
20
+ def check(self, src: "FilterSource", attr_values: list[Optional[str]]):
21
21
  if attr_values[0] == "lfs" and src.mode != GIT_FILTER_CLEAN:
22
22
  self._smudge_buf = io.BytesIO()
23
23
  self._smudge_root = src.repo.workdir or src.repo.path
@@ -173,11 +173,29 @@ class GitCredentialHelper(CredentialHelper):
173
173
  if res.stderr:
174
174
  logger.debug(res.stderr)
175
175
 
176
- credentials = {}
176
+ credentials: dict[str, Any] = {}
177
177
  for line in res.stdout.splitlines():
178
178
  try:
179
179
  key, value = line.split("=", maxsplit=1)
180
- credentials[key] = value
180
+ # Only include credential values that are used in the Credential
181
+ # constructor.
182
+ # Other values may be returned by the subprocess, but they must be
183
+ # ignored.
184
+ # e.g. osxkeychain credential helper >= 2.46.0 can return
185
+ # `capability[]` and `state`)
186
+ if key in [
187
+ "protocol",
188
+ "host",
189
+ "path",
190
+ "username",
191
+ "password",
192
+ "password_expiry_utc",
193
+ "url",
194
+ ]:
195
+ # Garbage bytes were output from git-credential-osxkeychain from
196
+ # 2.45.0 to 2.47.0:
197
+ # https://github.com/git/git/commit/6c3c451fb6e1c3ca83f74e63079d4d0af01b2d69
198
+ credentials[key] = _strip_garbage_bytes(value)
181
199
  except ValueError:
182
200
  continue
183
201
  if not credentials:
@@ -265,6 +283,19 @@ class GitCredentialHelper(CredentialHelper):
265
283
  )
266
284
 
267
285
 
286
+ def _strip_garbage_bytes(s: str) -> str:
287
+ """
288
+ Garbage (random) bytes were output from git-credential-osxkeychain from
289
+ 2.45.0 to 2.47.0 so must be removed.
290
+ https://github.com/git/git/commit/6c3c451fb6e1c3ca83f74e63079d4d0af01b2d69
291
+ :param s: string that might contain garbage/random bytes
292
+ :return str: The string with the garbage bytes removed
293
+ """
294
+ # Assume that any garbage bytes begin with a 0-byte
295
+ zero = s.find(chr(0))
296
+ return s[0:zero] if zero >= 0 else s
297
+
298
+
268
299
  class _CredentialKey(NamedTuple):
269
300
  protocol: str
270
301
  host: Optional[str]
scmrepo/git/lfs/client.py CHANGED
@@ -281,7 +281,7 @@ def _as_atomic(to_info: str, create_parents: bool = False) -> Iterator[str]:
281
281
  if create_parents:
282
282
  os.makedirs(parent, exist_ok=True)
283
283
 
284
- tmp_file = NamedTemporaryFile(dir=parent, delete=False)
284
+ tmp_file = NamedTemporaryFile(dir=parent, delete=False) # noqa: SIM115
285
285
  tmp_file.close()
286
286
  try:
287
287
  yield tmp_file.name
@@ -47,7 +47,7 @@ class LFSStorage:
47
47
  oid = obj if isinstance(obj, str) else obj.oid
48
48
  path = self.oid_to_path(oid)
49
49
  try:
50
- return open(path, **kwargs) # noqa: SIM115
50
+ return open(path, **kwargs)
51
51
  except FileNotFoundError:
52
52
  if not fetch_url or not isinstance(obj, Pointer):
53
53
  raise
@@ -57,7 +57,7 @@ class LFSStorage:
57
57
  raise FileNotFoundError(
58
58
  errno.ENOENT, os.strerror(errno.ENOENT), path
59
59
  ) from exc
60
- return open(path, **kwargs) # noqa: SIM115
60
+ return open(path, **kwargs)
61
61
 
62
62
  def close(self):
63
63
  pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scmrepo
3
- Version: 3.3.8
3
+ Version: 3.3.9
4
4
  Summary: scmrepo
5
5
  Author-email: Iterative <support@dvc.org>
6
6
  License: Apache-2.0
@@ -11,38 +11,39 @@ Classifier: Programming Language :: Python :: 3.9
11
11
  Classifier: Programming Language :: Python :: 3.10
12
12
  Classifier: Programming Language :: Python :: 3.11
13
13
  Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
14
15
  Classifier: Development Status :: 4 - Beta
15
16
  Requires-Python: >=3.9
16
17
  Description-Content-Type: text/x-rst
17
18
  License-File: LICENSE
18
- Requires-Dist: gitpython >3
19
- Requires-Dist: dulwich >=0.22.1
20
- Requires-Dist: pygit2 >=1.14.0
21
- Requires-Dist: pygtrie >=2.3.2
22
- Requires-Dist: fsspec[tqdm] >=2024.2.0
23
- Requires-Dist: pathspec >=0.9.0
24
- Requires-Dist: asyncssh <3,>=2.13.1
25
- Requires-Dist: funcy >=1.14
26
- Requires-Dist: aiohttp-retry >=2.5.0
19
+ Requires-Dist: gitpython>3
20
+ Requires-Dist: dulwich>=0.22.1
21
+ Requires-Dist: pygit2>=1.14.0
22
+ Requires-Dist: pygtrie>=2.3.2
23
+ Requires-Dist: fsspec[tqdm]>=2024.2.0
24
+ Requires-Dist: pathspec>=0.9.0
25
+ Requires-Dist: asyncssh<3,>=2.13.1
26
+ Requires-Dist: funcy>=1.14
27
+ Requires-Dist: aiohttp-retry>=2.5.0
27
28
  Requires-Dist: tqdm
28
- Provides-Extra: dev
29
- Requires-Dist: mypy ==1.11.2 ; extra == 'dev'
30
- Requires-Dist: scmrepo[tests] ; extra == 'dev'
31
- Requires-Dist: types-certifi ; extra == 'dev'
32
- Requires-Dist: types-mock ; extra == 'dev'
33
- Requires-Dist: types-paramiko ; extra == 'dev'
34
- Requires-Dist: types-tqdm ; extra == 'dev'
35
29
  Provides-Extra: tests
36
- Requires-Dist: aioresponses <0.8,>=0.7 ; extra == 'tests'
37
- Requires-Dist: paramiko <4,>=3.4.0 ; extra == 'tests'
38
- Requires-Dist: pytest <9,>=7 ; extra == 'tests'
39
- Requires-Dist: pytest-asyncio <1,>=0.23.2 ; extra == 'tests'
40
- Requires-Dist: pytest-cov >=4.1.0 ; extra == 'tests'
41
- Requires-Dist: pytest-docker <4,>=1 ; extra == 'tests'
42
- Requires-Dist: pytest-mock ; extra == 'tests'
43
- Requires-Dist: pytest-sugar ; extra == 'tests'
44
- Requires-Dist: pytest-test-utils <0.2,>=0.1.0 ; extra == 'tests'
45
- Requires-Dist: proxy.py ; extra == 'tests'
30
+ Requires-Dist: aioresponses<0.8,>=0.7; extra == "tests"
31
+ Requires-Dist: paramiko<4,>=3.4.0; extra == "tests"
32
+ Requires-Dist: pytest<9,>=7; extra == "tests"
33
+ Requires-Dist: pytest-asyncio<1,>=0.23.2; extra == "tests"
34
+ Requires-Dist: pytest-cov>=4.1.0; extra == "tests"
35
+ Requires-Dist: pytest-docker<4,>=1; extra == "tests"
36
+ Requires-Dist: pytest-mock; extra == "tests"
37
+ Requires-Dist: pytest-sugar; extra == "tests"
38
+ Requires-Dist: pytest-test-utils<0.2,>=0.1.0; extra == "tests"
39
+ Requires-Dist: proxy.py; extra == "tests"
40
+ Provides-Extra: dev
41
+ Requires-Dist: mypy==1.13.0; extra == "dev"
42
+ Requires-Dist: scmrepo[tests]; extra == "dev"
43
+ Requires-Dist: types-certifi; extra == "dev"
44
+ Requires-Dist: types-mock; extra == "dev"
45
+ Requires-Dist: types-paramiko; extra == "dev"
46
+ Requires-Dist: types-tqdm; extra == "dev"
46
47
 
47
48
  scmrepo
48
49
  =======
@@ -10,7 +10,7 @@ scmrepo/urls.py,sha256=vEfW1h1lb7GXvMVBk-TNwqctpl-5xGMA2LbOPVn7t4Q,638
10
10
  scmrepo/utils.py,sha256=_F3rVvPhES-A2JxLGob0RV8BOnHzxbA9aDPClA7_V8M,1512
11
11
  scmrepo/git/__init__.py,sha256=6giWgQpgAlJslOkFmSAYkw8pb7nuefrbpZZf5Np3Iyo,17189
12
12
  scmrepo/git/config.py,sha256=0t0OBmJ9SIa5tf22QdcGzhZfdMzzppvEmceUDg8ZPyE,943
13
- scmrepo/git/credentials.py,sha256=duj37Eb3k8SZ5dRIxj8XxB_oGCq2KzEjmeawQccXS_g,20938
13
+ scmrepo/git/credentials.py,sha256=VYk16-KHHD_JMVEeVsWI1ZKp8DUaGi8_GDxB-Fjby6g,22311
14
14
  scmrepo/git/objects.py,sha256=vqeFpUlMFHL9Yv1h3wTA7mbRWHCVC_4KgLy5aAISD2g,4674
15
15
  scmrepo/git/stash.py,sha256=wKWnYj_xpdT_3pvHiXtE7_I_By4S-Zbxf4Lv-ZY2sxI,2785
16
16
  scmrepo/git/backend/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -21,18 +21,18 @@ scmrepo/git/backend/dulwich/asyncssh_vendor.py,sha256=clqsPC9ayulwgb5VLp-69hEbN9
21
21
  scmrepo/git/backend/dulwich/client.py,sha256=XjNBfOp0L8M3iPpqcX_4bmXsO7hwrkyqg5wMbZULD-I,2358
22
22
  scmrepo/git/backend/pygit2/__init__.py,sha256=Is9OjsiDdUTRBUYrG1qoK5AP6Cjcy2tAk71nsmkzLf4,36316
23
23
  scmrepo/git/backend/pygit2/callbacks.py,sha256=BFIFMzUpSC-CtNY50yTqksAusASgidzsQrG-B-Ry2lw,2749
24
- scmrepo/git/backend/pygit2/filter.py,sha256=2NlWfQ7soXN1H7Es6-LctE74hpj3QKQTlYqXRH83VpM,2128
24
+ scmrepo/git/backend/pygit2/filter.py,sha256=8Ibn_2oXM32YRpyovxGKYhtPZLUYTBLDi9--bScOP00,2198
25
25
  scmrepo/git/lfs/__init__.py,sha256=at5blRIKnKpg_g5dLRDsGWBFi6SbucRlF_DX6aAkGtE,257
26
- scmrepo/git/lfs/client.py,sha256=SLlGFC09YD55nTDQ7MjuKD9alql-eOriyNePZikFaYo,10171
26
+ scmrepo/git/lfs/client.py,sha256=64u5lJijUASNJ4H_Eg7aEb8j3z3eluuNUWGnYvfNnvo,10187
27
27
  scmrepo/git/lfs/exceptions.py,sha256=cLlImmPXWJJUl44S4xcRBa2T9wYRkWTaKQGwJylwOhA,77
28
28
  scmrepo/git/lfs/fetch.py,sha256=45JGAKHAdANShZ9XEVXq0EYuKBgGmlMK2TX8z9Og8wg,5530
29
29
  scmrepo/git/lfs/object.py,sha256=rAYY_z9EYoHPfbpF1QHwL7ecYgaETPyCl-zBx0E1oIQ,337
30
30
  scmrepo/git/lfs/pointer.py,sha256=BcVbtjoOUG9cEzyJSJDeweqehGZvq43P6NNLDYUGYEI,3181
31
31
  scmrepo/git/lfs/progress.py,sha256=AcWvygDG0ee__Jec5BlRr58F-lAj3d4Z_j7JbW3OUcI,4733
32
32
  scmrepo/git/lfs/smudge.py,sha256=1O_fznptWo4CKXqcJgUoWP6cgWWhvGAZ3d87kasG3cQ,1610
33
- scmrepo/git/lfs/storage.py,sha256=LbHGhSRdORu4Iqzb7Ef-2tA_iJbZykXZFotWRJvyr2Y,2380
34
- scmrepo-3.3.8.dist-info/LICENSE,sha256=-1jhbPjoIVHR0cEgahL4Zhct75Ff4MzYCR_jOaJDPq8,11340
35
- scmrepo-3.3.8.dist-info/METADATA,sha256=q9rUtEjpdlfz_PXHIk8CIPmy-xtWOQTwa7wHJ7AG1ZY,4774
36
- scmrepo-3.3.8.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
37
- scmrepo-3.3.8.dist-info/top_level.txt,sha256=iunjod6w3GogERsAYfLRupnANXnqzX3jbIfbeIQG5cc,8
38
- scmrepo-3.3.8.dist-info/RECORD,,
33
+ scmrepo/git/lfs/storage.py,sha256=nx_HvHHC1sf15Qgbsj8jEOkdHXkZ8VUEh8QBtt9sLwI,2348
34
+ scmrepo-3.3.9.dist-info/LICENSE,sha256=-1jhbPjoIVHR0cEgahL4Zhct75Ff4MzYCR_jOaJDPq8,11340
35
+ scmrepo-3.3.9.dist-info/METADATA,sha256=rTixvRBdWMPNf_op8TVliMDccLarhPf4_hTMRaZNMcE,4792
36
+ scmrepo-3.3.9.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
37
+ scmrepo-3.3.9.dist-info/top_level.txt,sha256=iunjod6w3GogERsAYfLRupnANXnqzX3jbIfbeIQG5cc,8
38
+ scmrepo-3.3.9.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.1.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5