scmrepo 3.3.4__tar.gz → 3.3.5__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.

Potentially problematic release.


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

Files changed (73) hide show
  1. {scmrepo-3.3.4 → scmrepo-3.3.5}/.pre-commit-config.yaml +1 -1
  2. {scmrepo-3.3.4/src/scmrepo.egg-info → scmrepo-3.3.5}/PKG-INFO +1 -1
  3. {scmrepo-3.3.4 → scmrepo-3.3.5}/pyproject.toml +6 -4
  4. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/backend/pygit2/__init__.py +53 -76
  5. {scmrepo-3.3.4 → scmrepo-3.3.5/src/scmrepo.egg-info}/PKG-INFO +1 -1
  6. {scmrepo-3.3.4 → scmrepo-3.3.5}/.coveragerc +0 -0
  7. {scmrepo-3.3.4 → scmrepo-3.3.5}/.cruft.json +0 -0
  8. {scmrepo-3.3.4 → scmrepo-3.3.5}/.gitattributes +0 -0
  9. {scmrepo-3.3.4 → scmrepo-3.3.5}/.github/dependabot.yml +0 -0
  10. {scmrepo-3.3.4 → scmrepo-3.3.5}/.github/workflows/release.yaml +0 -0
  11. {scmrepo-3.3.4 → scmrepo-3.3.5}/.github/workflows/tests.yaml +0 -0
  12. {scmrepo-3.3.4 → scmrepo-3.3.5}/.github/workflows/update-template.yaml +0 -0
  13. {scmrepo-3.3.4 → scmrepo-3.3.5}/.gitignore +0 -0
  14. {scmrepo-3.3.4 → scmrepo-3.3.5}/CODE_OF_CONDUCT.rst +0 -0
  15. {scmrepo-3.3.4 → scmrepo-3.3.5}/CONTRIBUTING.rst +0 -0
  16. {scmrepo-3.3.4 → scmrepo-3.3.5}/LICENSE +0 -0
  17. {scmrepo-3.3.4 → scmrepo-3.3.5}/README.rst +0 -0
  18. {scmrepo-3.3.4 → scmrepo-3.3.5}/noxfile.py +0 -0
  19. {scmrepo-3.3.4 → scmrepo-3.3.5}/setup.cfg +0 -0
  20. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/__init__.py +0 -0
  21. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/asyn.py +0 -0
  22. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/base.py +0 -0
  23. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/exceptions.py +0 -0
  24. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/fs.py +0 -0
  25. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/__init__.py +0 -0
  26. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/backend/__init__.py +0 -0
  27. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/backend/base.py +0 -0
  28. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/backend/dulwich/__init__.py +0 -0
  29. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/backend/dulwich/asyncssh_vendor.py +0 -0
  30. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/backend/dulwich/client.py +0 -0
  31. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/backend/gitpython.py +0 -0
  32. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/backend/pygit2/callbacks.py +0 -0
  33. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/backend/pygit2/filter.py +0 -0
  34. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/config.py +0 -0
  35. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/credentials.py +0 -0
  36. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/lfs/__init__.py +0 -0
  37. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/lfs/client.py +0 -0
  38. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/lfs/exceptions.py +0 -0
  39. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/lfs/fetch.py +0 -0
  40. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/lfs/object.py +0 -0
  41. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/lfs/pointer.py +0 -0
  42. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/lfs/progress.py +0 -0
  43. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/lfs/smudge.py +0 -0
  44. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/lfs/storage.py +0 -0
  45. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/objects.py +0 -0
  46. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/git/stash.py +0 -0
  47. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/noscm.py +0 -0
  48. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/progress.py +0 -0
  49. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/py.typed +0 -0
  50. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/urls.py +0 -0
  51. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo/utils.py +0 -0
  52. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo.egg-info/SOURCES.txt +0 -0
  53. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo.egg-info/dependency_links.txt +0 -0
  54. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo.egg-info/requires.txt +0 -0
  55. {scmrepo-3.3.4 → scmrepo-3.3.5}/src/scmrepo.egg-info/top_level.txt +0 -0
  56. {scmrepo-3.3.4 → scmrepo-3.3.5}/tests/__init__.py +0 -0
  57. {scmrepo-3.3.4 → scmrepo-3.3.5}/tests/conftest.py +0 -0
  58. {scmrepo-3.3.4 → scmrepo-3.3.5}/tests/docker-compose.yml +0 -0
  59. {scmrepo-3.3.4 → scmrepo-3.3.5}/tests/git-init/git.sh +0 -0
  60. {scmrepo-3.3.4 → scmrepo-3.3.5}/tests/test_credentials.py +0 -0
  61. {scmrepo-3.3.4 → scmrepo-3.3.5}/tests/test_dulwich.py +0 -0
  62. {scmrepo-3.3.4 → scmrepo-3.3.5}/tests/test_fs.py +0 -0
  63. {scmrepo-3.3.4 → scmrepo-3.3.5}/tests/test_git.py +0 -0
  64. {scmrepo-3.3.4 → scmrepo-3.3.5}/tests/test_lfs.py +0 -0
  65. {scmrepo-3.3.4 → scmrepo-3.3.5}/tests/test_noscm.py +0 -0
  66. {scmrepo-3.3.4 → scmrepo-3.3.5}/tests/test_pygit2.py +0 -0
  67. {scmrepo-3.3.4 → scmrepo-3.3.5}/tests/test_scmrepo.py +0 -0
  68. {scmrepo-3.3.4 → scmrepo-3.3.5}/tests/test_stash.py +0 -0
  69. {scmrepo-3.3.4 → scmrepo-3.3.5}/tests/test_urls.py +0 -0
  70. {scmrepo-3.3.4 → scmrepo-3.3.5}/tests/user.key +0 -0
  71. {scmrepo-3.3.4 → scmrepo-3.3.5}/tests/user.key.pub +0 -0
  72. {scmrepo-3.3.4 → scmrepo-3.3.5}/tests/vendor/__init__.py +0 -0
  73. {scmrepo-3.3.4 → scmrepo-3.3.5}/tests/vendor/test_paramiko_vendor.py +0 -0
@@ -20,7 +20,7 @@ repos:
20
20
  - id: sort-simple-yaml
21
21
  - id: trailing-whitespace
22
22
  - repo: https://github.com/astral-sh/ruff-pre-commit
23
- rev: 'v0.4.3'
23
+ rev: 'v0.4.4'
24
24
  hooks:
25
25
  - id: ruff
26
26
  args: [--fix, --exit-non-zero-on-fix]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scmrepo
3
- Version: 3.3.4
3
+ Version: 3.3.5
4
4
  Summary: scmrepo
5
5
  Author-email: Iterative <support@dvc.org>
6
6
  License: Apache-2.0
@@ -125,6 +125,10 @@ ignore_missing_imports = true
125
125
  ignore-words-list = "cachable, keypair"
126
126
 
127
127
  [tool.ruff]
128
+ output-format = "full"
129
+ show-fixes = true
130
+
131
+ [tool.ruff.lint]
128
132
  ignore = [
129
133
  "S101", # assert
130
134
  "PLR2004", # magic-value-comparison
@@ -180,10 +184,8 @@ select = [
180
184
  "W", # pycodestyle - Warning
181
185
  "YTT", # flake8-2020
182
186
  ]
183
- show-source = true
184
- show-fixes = true
185
187
 
186
- [tool.ruff.per-file-ignores]
188
+ [tool.ruff.lint.per-file-ignores]
187
189
  "noxfile.py" = ["D", "PTH"]
188
190
  "tests/**" = ["S", "ARG001", "ARG002", "ANN"]
189
191
  "docs/**" = ["INP"]
@@ -199,5 +201,5 @@ strict = true
199
201
  [tool.ruff.lint.isort]
200
202
  known-first-party = ["scmrepo"]
201
203
 
202
- [tool.ruff.pylint]
204
+ [tool.ruff.lint.pylint]
203
205
  max-args = 10
@@ -34,6 +34,7 @@ logger = logging.getLogger(__name__)
34
34
  if TYPE_CHECKING:
35
35
  from pygit2 import Commit, Oid, Signature
36
36
  from pygit2.config import Config as _Pygit2Config
37
+ from pygit2.enums import CheckoutStrategy
37
38
  from pygit2.remotes import Remote
38
39
  from pygit2.repository import Repository
39
40
 
@@ -246,17 +247,15 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
246
247
  )
247
248
 
248
249
  @staticmethod
249
- def _get_checkout_strategy(strategy: Optional[int] = None):
250
- from pygit2 import (
251
- GIT_CHECKOUT_RECREATE_MISSING,
252
- GIT_CHECKOUT_SAFE,
253
- GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES,
254
- )
250
+ def _get_checkout_strategy(
251
+ strategy: Optional["CheckoutStrategy"] = None,
252
+ ) -> "CheckoutStrategy":
253
+ from pygit2.enums import CheckoutStrategy
255
254
 
256
255
  if strategy is None:
257
- strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_RECREATE_MISSING
256
+ strategy = CheckoutStrategy.SAFE | CheckoutStrategy.RECREATE_MISSING
258
257
  if os.name == "nt":
259
- strategy |= GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES
258
+ strategy |= CheckoutStrategy.SKIP_LOCKED_DIRECTORIES
260
259
  return strategy
261
260
 
262
261
  # Workaround to force git_backend_odb_pack to release open file handles
@@ -343,9 +342,12 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
343
342
  force: bool = False,
344
343
  **kwargs,
345
344
  ):
346
- from pygit2 import GIT_CHECKOUT_FORCE, GitError
345
+ from pygit2 import GitError
346
+ from pygit2.enums import CheckoutStrategy
347
347
 
348
- strategy = self._get_checkout_strategy(GIT_CHECKOUT_FORCE if force else None)
348
+ strategy = self._get_checkout_strategy(
349
+ CheckoutStrategy.FORCE if force else None
350
+ )
349
351
 
350
352
  with self.release_odb_handles():
351
353
  if create_new:
@@ -613,7 +615,7 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
613
615
  force: bool = False,
614
616
  on_diverged: Optional[Callable[[str, str], bool]] = None,
615
617
  ) -> SyncStatus:
616
- import pygit2
618
+ from pygit2.enums import MergeAnalysis
617
619
 
618
620
  rh_rev = self.resolve_rev(rh)
619
621
 
@@ -627,16 +629,16 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
627
629
  self.set_ref(lh, rh_rev)
628
630
  return SyncStatus.SUCCESS
629
631
 
630
- if merge_result & pygit2.GIT_MERGE_ANALYSIS_UP_TO_DATE:
632
+ if merge_result & MergeAnalysis.UP_TO_DATE:
631
633
  return SyncStatus.UP_TO_DATE
632
- if merge_result & pygit2.GIT_MERGE_ANALYSIS_FASTFORWARD:
634
+ if merge_result & MergeAnalysis.FASTFORWARD:
633
635
  self.set_ref(lh, rh_rev)
634
636
  return SyncStatus.SUCCESS
635
- if merge_result & pygit2.GIT_MERGE_ANALYSIS_NORMAL:
637
+ if merge_result & MergeAnalysis.NORMAL:
636
638
  if on_diverged and on_diverged(lh, rh_rev):
637
639
  return SyncStatus.SUCCESS
638
640
  return SyncStatus.DIVERGED
639
- logger.debug("Unexpected merge result: %s", pygit2.GIT_MERGE_ANALYSIS_NORMAL)
641
+ logger.debug("Unexpected merge result: %s", MergeAnalysis.NORMAL)
640
642
  raise SCMError("Unknown merge analysis result")
641
643
 
642
644
  @contextmanager
@@ -779,7 +781,8 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
779
781
  skip_conflicts: bool = False,
780
782
  **kwargs,
781
783
  ):
782
- from pygit2 import GIT_CHECKOUT_ALLOW_CONFLICTS, GitError
784
+ from pygit2 import GitError
785
+ from pygit2.enums import CheckoutStrategy
783
786
 
784
787
  from scmrepo.git import Stash
785
788
 
@@ -788,7 +791,7 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
788
791
  self.repo.index.read(False)
789
792
  strategy = self._get_checkout_strategy()
790
793
  if skip_conflicts:
791
- strategy |= GIT_CHECKOUT_ALLOW_CONFLICTS
794
+ strategy |= CheckoutStrategy.ALLOW_CONFLICTS
792
795
  self.repo.stash_apply(
793
796
  index, strategy=strategy, reinstate_index=reinstate_index
794
797
  )
@@ -834,7 +837,8 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
834
837
  raise NotImplementedError
835
838
 
836
839
  def reset(self, hard: bool = False, paths: Optional[Iterable[str]] = None):
837
- from pygit2 import GIT_RESET_HARD, GIT_RESET_MIXED, IndexEntry
840
+ from pygit2 import IndexEntry
841
+ from pygit2.enums import ResetMode
838
842
 
839
843
  self.repo.index.read(False)
840
844
  if paths is not None:
@@ -847,9 +851,9 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
847
851
  self.repo.index.add(IndexEntry(rel, obj.id, obj.filemode))
848
852
  self.repo.index.write()
849
853
  elif hard:
850
- self.repo.reset(self.repo.head.target, GIT_RESET_HARD)
854
+ self.repo.reset(self.repo.head.target, ResetMode.HARD)
851
855
  else:
852
- self.repo.reset(self.repo.head.target, GIT_RESET_MIXED)
856
+ self.repo.reset(self.repo.head.target, ResetMode.MIXED)
853
857
 
854
858
  def checkout_index(
855
859
  self,
@@ -858,22 +862,17 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
858
862
  ours: bool = False,
859
863
  theirs: bool = False,
860
864
  ):
861
- from pygit2 import (
862
- GIT_CHECKOUT_ALLOW_CONFLICTS,
863
- GIT_CHECKOUT_FORCE,
864
- GIT_CHECKOUT_RECREATE_MISSING,
865
- GIT_CHECKOUT_SAFE,
866
- )
865
+ from pygit2.enums import CheckoutStrategy
867
866
 
868
867
  assert not (ours and theirs)
869
- strategy = GIT_CHECKOUT_RECREATE_MISSING
868
+ strategy = CheckoutStrategy.RECREATE_MISSING
870
869
  if force or ours or theirs:
871
- strategy |= GIT_CHECKOUT_FORCE
870
+ strategy |= CheckoutStrategy.FORCE
872
871
  else:
873
- strategy |= GIT_CHECKOUT_SAFE
872
+ strategy |= CheckoutStrategy.SAFE
874
873
 
875
874
  if ours or theirs:
876
- strategy |= GIT_CHECKOUT_ALLOW_CONFLICTS
875
+ strategy |= CheckoutStrategy.ALLOW_CONFLICTS
877
876
  strategy = self._get_checkout_strategy(strategy)
878
877
 
879
878
  index = self.repo.index
@@ -910,18 +909,7 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
910
909
  def status(
911
910
  self, ignored: bool = False, untracked_files: str = "all"
912
911
  ) -> tuple[Mapping[str, Iterable[str]], Iterable[str], Iterable[str]]:
913
- from pygit2 import (
914
- GIT_STATUS_IGNORED,
915
- GIT_STATUS_INDEX_DELETED,
916
- GIT_STATUS_INDEX_MODIFIED,
917
- GIT_STATUS_INDEX_NEW,
918
- GIT_STATUS_WT_DELETED,
919
- GIT_STATUS_WT_MODIFIED,
920
- GIT_STATUS_WT_NEW,
921
- GIT_STATUS_WT_RENAMED,
922
- GIT_STATUS_WT_TYPECHANGE,
923
- GIT_STATUS_WT_UNREADABLE,
924
- )
912
+ from pygit2.enums import FileStatus
925
913
 
926
914
  staged: Mapping[str, list[str]] = {
927
915
  "add": [],
@@ -932,19 +920,19 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
932
920
  untracked: list[str] = []
933
921
 
934
922
  states = {
935
- GIT_STATUS_WT_NEW: untracked,
936
- GIT_STATUS_WT_MODIFIED: unstaged,
937
- GIT_STATUS_WT_TYPECHANGE: staged["modify"],
938
- GIT_STATUS_WT_DELETED: staged["modify"],
939
- GIT_STATUS_WT_RENAMED: staged["modify"],
940
- GIT_STATUS_INDEX_NEW: staged["add"],
941
- GIT_STATUS_INDEX_MODIFIED: staged["modify"],
942
- GIT_STATUS_INDEX_DELETED: staged["delete"],
943
- GIT_STATUS_WT_UNREADABLE: untracked,
923
+ FileStatus.WT_NEW: untracked,
924
+ FileStatus.WT_MODIFIED: unstaged,
925
+ FileStatus.WT_TYPECHANGE: staged["modify"],
926
+ FileStatus.WT_DELETED: staged["modify"],
927
+ FileStatus.WT_RENAMED: staged["modify"],
928
+ FileStatus.INDEX_NEW: staged["add"],
929
+ FileStatus.INDEX_MODIFIED: staged["modify"],
930
+ FileStatus.INDEX_DELETED: staged["delete"],
931
+ FileStatus.WT_UNREADABLE: untracked,
944
932
  }
945
933
 
946
934
  if untracked_files != "no" and ignored:
947
- states[GIT_STATUS_IGNORED] = untracked
935
+ states[FileStatus.IGNORED] = untracked
948
936
 
949
937
  for file, state in self.repo.status(
950
938
  untracked_files=untracked_files, ignored=ignored
@@ -963,22 +951,15 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
963
951
  def iter_remote_refs(self, url: str, base: Optional[str] = None, **kwargs):
964
952
  raise NotImplementedError
965
953
 
966
- def merge( # noqa: C901
954
+ def merge( # noqa: C901, PLR0912
967
955
  self,
968
956
  rev: str,
969
957
  commit: bool = True,
970
958
  msg: Optional[str] = None,
971
959
  squash: bool = False,
972
960
  ) -> Optional[str]:
973
- from pygit2 import (
974
- GIT_MERGE_ANALYSIS_FASTFORWARD,
975
- GIT_MERGE_ANALYSIS_NONE,
976
- GIT_MERGE_ANALYSIS_UNBORN,
977
- GIT_MERGE_ANALYSIS_UP_TO_DATE,
978
- GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY,
979
- GIT_MERGE_PREFERENCE_NO_FASTFORWARD,
980
- GitError,
981
- )
961
+ from pygit2 import GitError
962
+ from pygit2.enums import MergeAnalysis, MergePreference
982
963
 
983
964
  if commit and squash:
984
965
  raise SCMError("Cannot merge with 'squash' and 'commit'")
@@ -991,9 +972,9 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
991
972
  except GitError as exc:
992
973
  raise SCMError("Merge analysis failed") from exc
993
974
 
994
- if analysis == GIT_MERGE_ANALYSIS_NONE:
975
+ if analysis == MergeAnalysis.NONE:
995
976
  raise SCMError(f"'{rev}' cannot be merged into HEAD")
996
- if analysis & GIT_MERGE_ANALYSIS_UP_TO_DATE:
977
+ if analysis & MergeAnalysis.UP_TO_DATE:
997
978
  return None
998
979
 
999
980
  try:
@@ -1006,15 +987,15 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
1006
987
  raise MergeConflictError("Merge contained conflicts")
1007
988
 
1008
989
  try:
1009
- if not (squash or ff_pref & GIT_MERGE_PREFERENCE_NO_FASTFORWARD):
1010
- if analysis & GIT_MERGE_ANALYSIS_FASTFORWARD:
990
+ if not (squash or ff_pref & MergePreference.NO_FASTFORWARD):
991
+ if analysis & MergeAnalysis.FASTFORWARD:
1011
992
  return self._merge_ff(rev, obj)
1012
993
 
1013
- if analysis & GIT_MERGE_ANALYSIS_UNBORN:
994
+ if analysis & MergeAnalysis.UNBORN:
1014
995
  self.repo.set_head(obj.id)
1015
996
  return str(obj.id)
1016
997
 
1017
- if ff_pref & GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY:
998
+ if ff_pref & MergePreference.FASTFORWARD_ONLY:
1018
999
  raise SCMError(f"Cannot fast-forward HEAD to '{rev}'")
1019
1000
 
1020
1001
  if commit:
@@ -1105,19 +1086,15 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
1105
1086
  attr: str,
1106
1087
  source: Optional[str] = None,
1107
1088
  ) -> Optional[Union[bool, str]]:
1108
- from pygit2 import (
1109
- GIT_ATTR_CHECK_FILE_THEN_INDEX,
1110
- GIT_ATTR_CHECK_INCLUDE_COMMIT,
1111
- GIT_ATTR_CHECK_INDEX_ONLY,
1112
- GitError,
1113
- )
1089
+ from pygit2 import GitError
1090
+ from pygit2.enums import AttrCheck
1114
1091
 
1115
1092
  commit: Optional["Commit"] = None
1116
- flags = GIT_ATTR_CHECK_FILE_THEN_INDEX
1093
+ flags = AttrCheck.FILE_THEN_INDEX
1117
1094
  if source:
1118
1095
  try:
1119
1096
  commit, _ref = self._resolve_refish(source)
1120
- flags = GIT_ATTR_CHECK_INDEX_ONLY | GIT_ATTR_CHECK_INCLUDE_COMMIT
1097
+ flags = AttrCheck.INDEX_ONLY | AttrCheck.INCLUDE_COMMIT
1121
1098
  except (KeyError, GitError) as exc:
1122
1099
  raise SCMError(f"Invalid commit '{source}'") from exc
1123
1100
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scmrepo
3
- Version: 3.3.4
3
+ Version: 3.3.5
4
4
  Summary: scmrepo
5
5
  Author-email: Iterative <support@dvc.org>
6
6
  License: Apache-2.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes