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

scmrepo/base.py CHANGED
@@ -103,3 +103,7 @@ class Base(AbstractContextManager):
103
103
 
104
104
  def _reset(self) -> None:
105
105
  pass
106
+
107
+ def list_submodules(self) -> list[str]:
108
+ """Returns a list of submodules in the repo."""
109
+ return []
scmrepo/git/__init__.py CHANGED
@@ -412,6 +412,7 @@ class Git(Base):
412
412
  check_attr = partialmethod(_backend_func, "check_attr")
413
413
 
414
414
  get_tree_obj = partialmethod(_backend_func, "get_tree_obj")
415
+ list_submodules = partialmethod(_backend_func, "list_submodules")
415
416
 
416
417
  def branch_revs(self, branch: str, end_rev: Optional[str] = None) -> Iterable[str]:
417
418
  """Iterate over revisions in a given branch (from newest to oldest).
@@ -199,6 +199,9 @@ class DulwichBackend(BaseGitBackend): # pylint:disable=abstract-method
199
199
  self._submodules: dict[str, str] = self._find_submodules()
200
200
  self._stashes: dict = {}
201
201
 
202
+ def list_submodules(self) -> list[str]:
203
+ raise NotImplementedError
204
+
202
205
  def _find_submodules(self) -> dict[str, str]:
203
206
  """Return dict mapping submodule names to submodule paths.
204
207
 
@@ -349,21 +352,6 @@ class DulwichBackend(BaseGitBackend): # pylint:disable=abstract-method
349
352
 
350
353
  def _expand_paths(self, paths: list[str], force: bool = False) -> Iterator[str]:
351
354
  for path in paths:
352
- if not os.path.isabs(path) and self._submodules:
353
- # NOTE: If path is inside a submodule, Dulwich expects the
354
- # staged paths to be relative to the submodule root (not the
355
- # parent git repo root). We append path to root_dir here so
356
- # that the result of relpath(path, root_dir) is actually the
357
- # path relative to the submodule root.
358
- fs_path = relpath(path, self.root_dir)
359
- for sm_path in self._submodules.values():
360
- assert self.root_dir
361
- if fs_path.startswith(sm_path):
362
- path = os.path.join(
363
- self.root_dir,
364
- relpath(fs_path, sm_path),
365
- )
366
- break
367
355
  if os.path.isdir(path):
368
356
  for root, _, fs in os.walk(path):
369
357
  for fpath in fs:
@@ -789,3 +789,6 @@ class GitPythonBackend(BaseGitBackend): # pylint:disable=abstract-method
789
789
  if info == "unset":
790
790
  return False
791
791
  return info
792
+
793
+ def list_submodules(self) -> list[str]:
794
+ raise NotImplementedError
@@ -269,6 +269,9 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
269
269
  # can be reacquired later as needed.
270
270
  self.repo.free()
271
271
 
272
+ def list_submodules(self) -> list[str]:
273
+ return self.repo.listall_submodules()
274
+
272
275
  @classmethod
273
276
  def clone(
274
277
  cls,
@@ -865,6 +868,11 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
865
868
  from pygit2 import IndexEntry
866
869
  from pygit2.enums import ResetMode
867
870
 
871
+ if self.list_submodules():
872
+ raise NotImplementedError(
873
+ "pygit2 seems to remove files from submodules on reset"
874
+ )
875
+
868
876
  self.repo.index.read(False) # type: ignore[attr-defined]
869
877
  if paths is not None:
870
878
  tree = self.repo.revparse_single("HEAD").tree # type: ignore[attr-defined]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scmrepo
3
- Version: 3.5.1
3
+ Version: 3.5.2
4
4
  Summary: scmrepo
5
5
  Author-email: Iterative <support@dvc.org>
6
6
  License-Expression: Apache-2.0
@@ -28,7 +28,7 @@ Requires-Dist: aiohttp-retry>=2.5.0
28
28
  Requires-Dist: tqdm
29
29
  Provides-Extra: tests
30
30
  Requires-Dist: aioresponses<0.8,>=0.7; extra == "tests"
31
- Requires-Dist: paramiko<4,>=3.4.0; extra == "tests"
31
+ Requires-Dist: paramiko<5,>=3.4.0; extra == "tests"
32
32
  Requires-Dist: pytest<9,>=7; extra == "tests"
33
33
  Requires-Dist: pytest-asyncio<2,>=0.23.2; extra == "tests"
34
34
  Requires-Dist: pytest-cov>=4.1.0; extra == "tests"
@@ -38,7 +38,7 @@ Requires-Dist: pytest-sugar; extra == "tests"
38
38
  Requires-Dist: pytest-test-utils<0.2,>=0.1.0; extra == "tests"
39
39
  Requires-Dist: proxy.py; extra == "tests"
40
40
  Provides-Extra: dev
41
- Requires-Dist: mypy==1.17.0; extra == "dev"
41
+ Requires-Dist: mypy==1.17.1; extra == "dev"
42
42
  Requires-Dist: scmrepo[tests]; extra == "dev"
43
43
  Requires-Dist: types-certifi; extra == "dev"
44
44
  Requires-Dist: types-mock; extra == "dev"
@@ -1,6 +1,6 @@
1
1
  scmrepo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  scmrepo/asyn.py,sha256=DoTSfXhvGocuS0HS5CuO5MSFIy2qkdbJ4vjymhvT1R8,1457
3
- scmrepo/base.py,sha256=pgddGR7UeZoEq2d5lip1vjbxTmpwTnKFH4JwHy-Fmho,3007
3
+ scmrepo/base.py,sha256=vQrPSM6lmVSLAAWeE2V2ClKb_OZ-wGzrWrxMrEuuvBY,3126
4
4
  scmrepo/exceptions.py,sha256=vR8BuCKgKh9lMnCemzNYGHiJctioOmhn_Kv5m8XO69Y,1053
5
5
  scmrepo/fs.py,sha256=8efNf_D5IQb-N42w-apAkG3Uwe8gJA_HVflniY9gX6M,6639
6
6
  scmrepo/noscm.py,sha256=xraqlBek4zhFlHf1LvTMkgBM0hykgcTfMVkTNCpVlcQ,491
@@ -8,18 +8,18 @@ scmrepo/progress.py,sha256=p4FJwEv1x588oYHk-AcWbq9C382hJ1lq8ThGi9iGPcQ,2336
8
8
  scmrepo/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  scmrepo/urls.py,sha256=vEfW1h1lb7GXvMVBk-TNwqctpl-5xGMA2LbOPVn7t4Q,638
10
10
  scmrepo/utils.py,sha256=PA-U6od-sq1-ty_qriyptNrDvuZGDP8cwCOSQDvHCsw,1714
11
- scmrepo/git/__init__.py,sha256=lTpkGdtwPM1PtYmmymTss8AvZRrdYCX0x_A_wS_pago,17203
11
+ scmrepo/git/__init__.py,sha256=-EBGaBI3l-x2TgGpochkVx-uF7XcxuHjMMPJCAqKbSE,17273
12
12
  scmrepo/git/config.py,sha256=0t0OBmJ9SIa5tf22QdcGzhZfdMzzppvEmceUDg8ZPyE,943
13
13
  scmrepo/git/credentials.py,sha256=_jHkeC-CNQRLtGhaliE57xLWILGBp2Oy7aPJ1TK9Mqw,22314
14
14
  scmrepo/git/objects.py,sha256=qx8zAHZIrr0SDbZGD9wVShlMZK57nef8stIeRVqYdCU,4676
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
17
17
  scmrepo/git/backend/base.py,sha256=U_ldNl5Njz2EoMryfo8nyOf5EKs6Kf2yv_MjObaNndA,13570
18
- scmrepo/git/backend/gitpython.py,sha256=fHJJAaX58fb7OJyXT6X4rOZ7ZmebEGU-MptLGfiXOOE,25762
19
- scmrepo/git/backend/dulwich/__init__.py,sha256=dgbOnhybFhnrncogp0frgQewElwDsazMo-jgnWFKF4g,36086
18
+ scmrepo/git/backend/gitpython.py,sha256=Kzg04vr4T2dL-V_w-I6UOdmEZQCtjDViBeQC4RAzPxc,25841
19
+ scmrepo/git/backend/dulwich/__init__.py,sha256=R6mdUIIm9HxVYa4CxNS6APuEcIE0Bzx4X-bUZN0SNm8,35339
20
20
  scmrepo/git/backend/dulwich/asyncssh_vendor.py,sha256=QnaUyHmPWBWtryK1JCXR_S0UZyjfF_NN7z9jIii3Bac,9912
21
21
  scmrepo/git/backend/dulwich/client.py,sha256=VvAheye_QAK6agGsKVj5Jk62zOp-SipgdwuaJLIWDbA,2573
22
- scmrepo/git/backend/pygit2/__init__.py,sha256=iBNDQDUcdoXMhmfwNBD8acBRQ2Ldt7CcBuWsdjr4c4E,38514
22
+ scmrepo/git/backend/pygit2/__init__.py,sha256=lu4y4CsmCIctbQ3HwzLVcWOX4H7dFP46HDkib563Ql4,38766
23
23
  scmrepo/git/backend/pygit2/callbacks.py,sha256=Mk-2e5dfJPNLsczRiK4rTnjHd5ZyonmegdwiFwM9Anc,2849
24
24
  scmrepo/git/backend/pygit2/filter.py,sha256=lBzwjSTWQ8VY62liqPnVMUZQA0zaol1Koafg1X0sDXE,2377
25
25
  scmrepo/git/lfs/__init__.py,sha256=at5blRIKnKpg_g5dLRDsGWBFi6SbucRlF_DX6aAkGtE,257
@@ -31,8 +31,8 @@ scmrepo/git/lfs/pointer.py,sha256=BcVbtjoOUG9cEzyJSJDeweqehGZvq43P6NNLDYUGYEI,31
31
31
  scmrepo/git/lfs/progress.py,sha256=AcWvygDG0ee__Jec5BlRr58F-lAj3d4Z_j7JbW3OUcI,4733
32
32
  scmrepo/git/lfs/smudge.py,sha256=LMt9I5QodXLh8FiQbAbix3GHbeuyPXGwHuHYJ0f5ORo,1610
33
33
  scmrepo/git/lfs/storage.py,sha256=nx_HvHHC1sf15Qgbsj8jEOkdHXkZ8VUEh8QBtt9sLwI,2348
34
- scmrepo-3.5.1.dist-info/licenses/LICENSE,sha256=-1jhbPjoIVHR0cEgahL4Zhct75Ff4MzYCR_jOaJDPq8,11340
35
- scmrepo-3.5.1.dist-info/METADATA,sha256=jWWESkCTzFdRF6zfD6HMjaA4wGWN8hAsJ9tWoeN5cT0,4825
36
- scmrepo-3.5.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
- scmrepo-3.5.1.dist-info/top_level.txt,sha256=iunjod6w3GogERsAYfLRupnANXnqzX3jbIfbeIQG5cc,8
38
- scmrepo-3.5.1.dist-info/RECORD,,
34
+ scmrepo-3.5.2.dist-info/licenses/LICENSE,sha256=-1jhbPjoIVHR0cEgahL4Zhct75Ff4MzYCR_jOaJDPq8,11340
35
+ scmrepo-3.5.2.dist-info/METADATA,sha256=CO24sQaEyD2vE1oqdqo_AqsL4nkXywX9k6gR-xxfWQY,4825
36
+ scmrepo-3.5.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
+ scmrepo-3.5.2.dist-info/top_level.txt,sha256=iunjod6w3GogERsAYfLRupnANXnqzX3jbIfbeIQG5cc,8
38
+ scmrepo-3.5.2.dist-info/RECORD,,