scmrepo 3.3.2__tar.gz → 3.3.3__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.
- {scmrepo-3.3.2 → scmrepo-3.3.3}/.pre-commit-config.yaml +2 -2
- {scmrepo-3.3.2/src/scmrepo.egg-info → scmrepo-3.3.3}/PKG-INFO +2 -2
- {scmrepo-3.3.2 → scmrepo-3.3.3}/pyproject.toml +1 -1
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/backend/dulwich/__init__.py +5 -5
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/lfs/fetch.py +23 -1
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/lfs/storage.py +1 -1
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/stash.py +1 -1
- {scmrepo-3.3.2 → scmrepo-3.3.3/src/scmrepo.egg-info}/PKG-INFO +2 -2
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo.egg-info/requires.txt +1 -1
- {scmrepo-3.3.2 → scmrepo-3.3.3}/.coveragerc +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/.cruft.json +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/.gitattributes +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/.github/dependabot.yml +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/.github/workflows/release.yaml +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/.github/workflows/tests.yaml +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/.github/workflows/update-template.yaml +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/.gitignore +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/CODE_OF_CONDUCT.rst +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/CONTRIBUTING.rst +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/LICENSE +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/README.rst +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/noxfile.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/setup.cfg +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/__init__.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/asyn.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/base.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/exceptions.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/fs.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/__init__.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/backend/__init__.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/backend/base.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/backend/dulwich/asyncssh_vendor.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/backend/dulwich/client.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/backend/gitpython.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/backend/pygit2/__init__.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/backend/pygit2/callbacks.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/backend/pygit2/filter.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/config.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/credentials.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/lfs/__init__.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/lfs/client.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/lfs/exceptions.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/lfs/object.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/lfs/pointer.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/lfs/progress.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/lfs/smudge.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/git/objects.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/noscm.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/progress.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/py.typed +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/urls.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo/utils.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo.egg-info/SOURCES.txt +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo.egg-info/dependency_links.txt +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/src/scmrepo.egg-info/top_level.txt +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/tests/__init__.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/tests/conftest.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/tests/docker-compose.yml +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/tests/git-init/git.sh +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/tests/test_credentials.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/tests/test_dulwich.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/tests/test_fs.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/tests/test_git.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/tests/test_lfs.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/tests/test_noscm.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/tests/test_pygit2.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/tests/test_scmrepo.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/tests/test_stash.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/tests/test_urls.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/tests/user.key +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/tests/user.key.pub +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/tests/vendor/__init__.py +0 -0
- {scmrepo-3.3.2 → scmrepo-3.3.3}/tests/vendor/test_paramiko_vendor.py +0 -0
|
@@ -2,7 +2,7 @@ default_language_version:
|
|
|
2
2
|
python: python3
|
|
3
3
|
repos:
|
|
4
4
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
5
|
-
rev: v4.
|
|
5
|
+
rev: v4.6.0
|
|
6
6
|
hooks:
|
|
7
7
|
- id: check-added-large-files
|
|
8
8
|
- id: check-case-conflict
|
|
@@ -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.3
|
|
23
|
+
rev: 'v0.4.3'
|
|
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.
|
|
3
|
+
Version: 3.3.3
|
|
4
4
|
Summary: scmrepo
|
|
5
5
|
Author-email: Iterative <support@dvc.org>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -36,7 +36,7 @@ Requires-Dist: pytest-mock; extra == "tests"
|
|
|
36
36
|
Requires-Dist: pytest-sugar; extra == "tests"
|
|
37
37
|
Requires-Dist: pytest-test-utils<0.2,>=0.1.0; extra == "tests"
|
|
38
38
|
Provides-Extra: dev
|
|
39
|
-
Requires-Dist: mypy==1.
|
|
39
|
+
Requires-Dist: mypy==1.10.0; extra == "dev"
|
|
40
40
|
Requires-Dist: scmrepo[tests]; extra == "dev"
|
|
41
41
|
Requires-Dist: types-certifi; extra == "dev"
|
|
42
42
|
Requires-Dist: types-mock; extra == "dev"
|
|
@@ -264,7 +264,7 @@ class DulwichBackend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
264
264
|
cls._set_mirror(repo, progress=progress)
|
|
265
265
|
else:
|
|
266
266
|
cls._set_default_tracking_branch(repo)
|
|
267
|
-
except Exception as exc:
|
|
267
|
+
except Exception as exc:
|
|
268
268
|
raise CloneError(url, os.fsdecode(to_path)) from exc
|
|
269
269
|
|
|
270
270
|
@staticmethod
|
|
@@ -580,7 +580,7 @@ class DulwichBackend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
580
580
|
try:
|
|
581
581
|
_remote, location = get_remote_repo(self.repo, url)
|
|
582
582
|
client, path = get_transport_and_path(location, **kwargs)
|
|
583
|
-
except Exception as exc:
|
|
583
|
+
except Exception as exc:
|
|
584
584
|
raise InvalidRemote(url) from exc
|
|
585
585
|
|
|
586
586
|
try:
|
|
@@ -617,7 +617,7 @@ class DulwichBackend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
617
617
|
try:
|
|
618
618
|
_remote, location = get_remote_repo(self.repo, url)
|
|
619
619
|
client, path = get_transport_and_path(location, **kwargs)
|
|
620
|
-
except Exception as exc:
|
|
620
|
+
except Exception as exc:
|
|
621
621
|
raise SCMError(f"'{url}' is not a valid Git remote or URL") from exc
|
|
622
622
|
|
|
623
623
|
change_result = {}
|
|
@@ -910,7 +910,7 @@ class DulwichBackend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
910
910
|
try:
|
|
911
911
|
_, location = get_remote_repo(self.repo, url)
|
|
912
912
|
client, path = get_transport_and_path(location, **kwargs)
|
|
913
|
-
except Exception as exc:
|
|
913
|
+
except Exception as exc:
|
|
914
914
|
raise InvalidRemote(url) from exc
|
|
915
915
|
if isinstance(client, LocalGitClient) and not os.path.exists(
|
|
916
916
|
os.path.join("", path)
|
|
@@ -989,5 +989,5 @@ def ls_remote(url: str) -> dict[str, str]:
|
|
|
989
989
|
return {os.fsdecode(ref): sha.decode("ascii") for ref, sha in refs.items()}
|
|
990
990
|
except HTTPUnauthorized as exc:
|
|
991
991
|
raise AuthError(url) from exc
|
|
992
|
-
except Exception as exc:
|
|
992
|
+
except Exception as exc:
|
|
993
993
|
raise InvalidRemote(url) from exc
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fnmatch
|
|
2
2
|
import io
|
|
3
3
|
import os
|
|
4
|
+
import re
|
|
4
5
|
from collections.abc import Iterable, Iterator
|
|
5
6
|
from typing import TYPE_CHECKING, Callable, Optional
|
|
6
7
|
|
|
@@ -98,6 +99,9 @@ def get_fetch_url(scm: "Git", remote: Optional[str] = None): # noqa: C901,PLR09
|
|
|
98
99
|
return scm.get_remote_url(remote)
|
|
99
100
|
|
|
100
101
|
|
|
102
|
+
_ROOT_PATH_PREFIX_REGEX = re.compile(r"^(?P<prefix>[^*?\[]*(?:/|$))")
|
|
103
|
+
|
|
104
|
+
|
|
101
105
|
def _collect_objects(
|
|
102
106
|
scm: "Git",
|
|
103
107
|
rev: str,
|
|
@@ -105,7 +109,25 @@ def _collect_objects(
|
|
|
105
109
|
exclude: Optional[list[str]],
|
|
106
110
|
) -> Iterator[Pointer]:
|
|
107
111
|
fs = scm.get_fs(rev)
|
|
108
|
-
|
|
112
|
+
# Optimize path filtering if the `include` list contains exactly one path.
|
|
113
|
+
# First, determine the root directory wherein to initiate the file search.
|
|
114
|
+
# If the `include` path is a Unix filename pattern, determine the static
|
|
115
|
+
# path prefix and set it as the root directory. Second, if the path and the
|
|
116
|
+
# root are identical or the Unix filename pattern matches *any* (i.e., `**`)
|
|
117
|
+
# file under the root directory, unset `include` to avoid unnecessary
|
|
118
|
+
# filtering work.
|
|
119
|
+
if (
|
|
120
|
+
include
|
|
121
|
+
and len(include) == 1
|
|
122
|
+
and (result := _ROOT_PATH_PREFIX_REGEX.match(path := include[0]))
|
|
123
|
+
):
|
|
124
|
+
root = result.group("prefix")
|
|
125
|
+
if path in {root, f'{root.rstrip("/")}/**'}:
|
|
126
|
+
include = []
|
|
127
|
+
else:
|
|
128
|
+
root = "/"
|
|
129
|
+
|
|
130
|
+
for path in _filter_paths(fs.find(root), include, exclude):
|
|
109
131
|
check_path = path.lstrip("/")
|
|
110
132
|
if scm.check_attr(check_path, "filter", source=rev) == "lfs":
|
|
111
133
|
try:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: scmrepo
|
|
3
|
-
Version: 3.3.
|
|
3
|
+
Version: 3.3.3
|
|
4
4
|
Summary: scmrepo
|
|
5
5
|
Author-email: Iterative <support@dvc.org>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -36,7 +36,7 @@ Requires-Dist: pytest-mock; extra == "tests"
|
|
|
36
36
|
Requires-Dist: pytest-sugar; extra == "tests"
|
|
37
37
|
Requires-Dist: pytest-test-utils<0.2,>=0.1.0; extra == "tests"
|
|
38
38
|
Provides-Extra: dev
|
|
39
|
-
Requires-Dist: mypy==1.
|
|
39
|
+
Requires-Dist: mypy==1.10.0; extra == "dev"
|
|
40
40
|
Requires-Dist: scmrepo[tests]; extra == "dev"
|
|
41
41
|
Requires-Dist: types-certifi; extra == "dev"
|
|
42
42
|
Requires-Dist: types-mock; extra == "dev"
|
|
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
|
|
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
|