scmrepo 3.4.0__tar.gz → 3.5.0__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.
- {scmrepo-3.4.0 → scmrepo-3.5.0}/.github/workflows/release.yaml +2 -2
- {scmrepo-3.4.0 → scmrepo-3.5.0}/.github/workflows/tests.yaml +1 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/.pre-commit-config.yaml +2 -2
- {scmrepo-3.4.0/src/scmrepo.egg-info → scmrepo-3.5.0}/PKG-INFO +3 -3
- {scmrepo-3.4.0 → scmrepo-3.5.0}/noxfile.py +5 -1
- {scmrepo-3.4.0 → scmrepo-3.5.0}/pyproject.toml +5 -4
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/backend/base.py +1 -1
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/backend/dulwich/__init__.py +13 -5
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/backend/gitpython.py +16 -13
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/backend/pygit2/__init__.py +42 -41
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/backend/pygit2/filter.py +4 -4
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/utils.py +11 -7
- {scmrepo-3.4.0 → scmrepo-3.5.0/src/scmrepo.egg-info}/PKG-INFO +3 -3
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo.egg-info/requires.txt +1 -1
- {scmrepo-3.4.0 → scmrepo-3.5.0}/tests/test_credentials.py +1 -1
- {scmrepo-3.4.0 → scmrepo-3.5.0}/tests/test_dulwich.py +9 -9
- {scmrepo-3.4.0 → scmrepo-3.5.0}/tests/test_git.py +2 -1
- {scmrepo-3.4.0 → scmrepo-3.5.0}/tests/vendor/test_paramiko_vendor.py +6 -6
- {scmrepo-3.4.0 → scmrepo-3.5.0}/.coveragerc +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/.cruft.json +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/.gitattributes +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/.github/dependabot.yml +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/.github/workflows/update-template.yaml +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/.gitignore +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/CODE_OF_CONDUCT.rst +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/CONTRIBUTING.rst +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/LICENSE +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/README.rst +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/setup.cfg +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/__init__.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/asyn.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/base.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/exceptions.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/fs.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/__init__.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/backend/__init__.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/backend/dulwich/asyncssh_vendor.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/backend/dulwich/client.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/backend/pygit2/callbacks.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/config.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/credentials.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/lfs/__init__.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/lfs/client.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/lfs/exceptions.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/lfs/fetch.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/lfs/object.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/lfs/pointer.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/lfs/progress.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/lfs/smudge.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/lfs/storage.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/objects.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/git/stash.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/noscm.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/progress.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/py.typed +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo/urls.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo.egg-info/SOURCES.txt +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo.egg-info/dependency_links.txt +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/src/scmrepo.egg-info/top_level.txt +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/tests/__init__.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/tests/conftest.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/tests/docker-compose.yml +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/tests/git-init/git.sh +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/tests/test_fs.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/tests/test_lfs.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/tests/test_noscm.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/tests/test_pygit2.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/tests/test_scmrepo.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/tests/test_stash.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/tests/test_urls.py +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/tests/user.key +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/tests/user.key.pub +0 -0
- {scmrepo-3.4.0 → scmrepo-3.5.0}/tests/vendor/__init__.py +0 -0
|
@@ -20,9 +20,9 @@ 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.12.
|
|
23
|
+
rev: 'v0.12.5'
|
|
24
24
|
hooks:
|
|
25
|
-
- id: ruff
|
|
25
|
+
- id: ruff-check
|
|
26
26
|
args: [--fix, --exit-non-zero-on-fix]
|
|
27
27
|
- id: ruff-format
|
|
28
28
|
- repo: https://github.com/codespell-project/codespell
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scmrepo
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.5.0
|
|
4
4
|
Summary: scmrepo
|
|
5
5
|
Author-email: Iterative <support@dvc.org>
|
|
6
|
-
License: Apache-2.0
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
7
|
Project-URL: Issues, https://github.com/iterative/scmrepo/issues
|
|
8
8
|
Project-URL: Source, https://github.com/iterative/scmrepo
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -17,7 +17,7 @@ Requires-Python: >=3.9
|
|
|
17
17
|
Description-Content-Type: text/x-rst
|
|
18
18
|
License-File: LICENSE
|
|
19
19
|
Requires-Dist: gitpython>3
|
|
20
|
-
Requires-Dist: dulwich>=0.
|
|
20
|
+
Requires-Dist: dulwich>=0.24.0
|
|
21
21
|
Requires-Dist: pygit2>=1.14.0
|
|
22
22
|
Requires-Dist: pygtrie>=2.3.2
|
|
23
23
|
Requires-Dist: fsspec[tqdm]>=2024.2.0
|
|
@@ -10,7 +10,11 @@ nox.options.sessions = "lint", "tests"
|
|
|
10
10
|
locations = "src", "tests"
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
project = nox.project.load_toml()
|
|
14
|
+
python_versions = nox.project.python_versions(project)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@nox.session(python=python_versions)
|
|
14
18
|
def tests(session: nox.Session) -> None:
|
|
15
19
|
session.install(".[tests]")
|
|
16
20
|
session.run(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools>=
|
|
2
|
+
requires = ["setuptools>=77", "setuptools_scm[toml]>=8"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[tool.setuptools_scm]
|
|
@@ -8,7 +8,8 @@ build-backend = "setuptools.build_meta"
|
|
|
8
8
|
name = "scmrepo"
|
|
9
9
|
description = "scmrepo"
|
|
10
10
|
readme = "README.rst"
|
|
11
|
-
license =
|
|
11
|
+
license = "Apache-2.0"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
12
13
|
authors = [{ name = "Iterative", email = "support@dvc.org" }]
|
|
13
14
|
classifiers = [
|
|
14
15
|
"Programming Language :: Python :: 3",
|
|
@@ -23,7 +24,7 @@ requires-python = ">=3.9"
|
|
|
23
24
|
dynamic = ["version"]
|
|
24
25
|
dependencies = [
|
|
25
26
|
"gitpython>3",
|
|
26
|
-
"dulwich>=0.
|
|
27
|
+
"dulwich>=0.24.0",
|
|
27
28
|
"pygit2>=1.14.0",
|
|
28
29
|
"pygtrie>=2.3.2",
|
|
29
30
|
"fsspec[tqdm]>=2024.2.0",
|
|
@@ -102,7 +103,7 @@ show_error_codes = true
|
|
|
102
103
|
show_error_context = true
|
|
103
104
|
show_traceback = true
|
|
104
105
|
pretty = true
|
|
105
|
-
check_untyped_defs =
|
|
106
|
+
check_untyped_defs = true
|
|
106
107
|
# Warnings
|
|
107
108
|
warn_no_return = true
|
|
108
109
|
warn_redundant_casts = true
|
|
@@ -204,9 +204,11 @@ class DulwichBackend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
204
204
|
|
|
205
205
|
Submodule paths will be relative to Git repo root.
|
|
206
206
|
"""
|
|
207
|
+
|
|
207
208
|
from dulwich.config import ConfigFile, parse_submodules
|
|
208
209
|
|
|
209
210
|
submodules: dict[str, str] = {}
|
|
211
|
+
assert self.root_dir
|
|
210
212
|
config_path = os.path.join(self.root_dir, ".gitmodules")
|
|
211
213
|
if os.path.isfile(config_path):
|
|
212
214
|
config = ConfigFile.from_path(config_path)
|
|
@@ -218,7 +220,7 @@ class DulwichBackend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
218
220
|
self.repo.close()
|
|
219
221
|
|
|
220
222
|
@property
|
|
221
|
-
def root_dir(self) -> str:
|
|
223
|
+
def root_dir(self) -> Optional[str]:
|
|
222
224
|
return self.repo.path
|
|
223
225
|
|
|
224
226
|
@classmethod
|
|
@@ -355,6 +357,7 @@ class DulwichBackend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
355
357
|
# path relative to the submodule root.
|
|
356
358
|
fs_path = relpath(path, self.root_dir)
|
|
357
359
|
for sm_path in self._submodules.values():
|
|
360
|
+
assert self.root_dir
|
|
358
361
|
if fs_path.startswith(sm_path):
|
|
359
362
|
path = os.path.join(
|
|
360
363
|
self.root_dir,
|
|
@@ -379,7 +382,7 @@ class DulwichBackend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
379
382
|
|
|
380
383
|
with reraise((Error, CommitError), SCMError("Git commit failed")):
|
|
381
384
|
try:
|
|
382
|
-
commit(self.
|
|
385
|
+
commit(self.repo, message=msg, no_verify=no_verify)
|
|
383
386
|
except InvalidUserIdentity as exc:
|
|
384
387
|
raise SCMError("Git username and email must be configured") from exc
|
|
385
388
|
except TimezoneFormatError as exc:
|
|
@@ -422,7 +425,7 @@ class DulwichBackend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
422
425
|
from dulwich.porcelain import Error, branch_create
|
|
423
426
|
|
|
424
427
|
try:
|
|
425
|
-
branch_create(self.
|
|
428
|
+
branch_create(self.repo, branch)
|
|
426
429
|
except Error as exc:
|
|
427
430
|
raise SCMError(f"Failed to create branch '{branch}'") from exc
|
|
428
431
|
|
|
@@ -648,8 +651,13 @@ class DulwichBackend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
648
651
|
def update_refs(refs):
|
|
649
652
|
from dulwich.objects import ZERO_SHA
|
|
650
653
|
|
|
654
|
+
_refspecs = (
|
|
655
|
+
os.fsencode(refspecs)
|
|
656
|
+
if isinstance(refspecs, str)
|
|
657
|
+
else [os.fsencode(refspec) for refspec in refspecs]
|
|
658
|
+
)
|
|
651
659
|
selected_refs.extend(
|
|
652
|
-
parse_reftuples(self.repo.refs, refs,
|
|
660
|
+
parse_reftuples(self.repo.refs, refs, _refspecs, force=force)
|
|
653
661
|
)
|
|
654
662
|
new_refs = {}
|
|
655
663
|
for lh, rh, _ in selected_refs:
|
|
@@ -901,7 +909,7 @@ class DulwichBackend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
901
909
|
|
|
902
910
|
with reraise(Error, SCMError("Git status failed")):
|
|
903
911
|
staged, unstaged, untracked = git_status(
|
|
904
|
-
self.
|
|
912
|
+
self.repo, ignored=ignored, untracked_files=untracked_files
|
|
905
913
|
)
|
|
906
914
|
|
|
907
915
|
return (
|
|
@@ -161,8 +161,9 @@ class GitPythonBackend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
161
161
|
return bool(func(str(path)))
|
|
162
162
|
|
|
163
163
|
@property
|
|
164
|
-
def root_dir(self) -> str:
|
|
165
|
-
|
|
164
|
+
def root_dir(self) -> Optional[str]:
|
|
165
|
+
d = self.repo.working_tree_dir
|
|
166
|
+
return os.fspath(d) if d is not None else d
|
|
166
167
|
|
|
167
168
|
@staticmethod
|
|
168
169
|
@requires_git
|
|
@@ -241,7 +242,7 @@ class GitPythonBackend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
241
242
|
|
|
242
243
|
@property
|
|
243
244
|
def dir(self) -> str:
|
|
244
|
-
return self.repo.git_dir
|
|
245
|
+
return os.fspath(self.repo.git_dir)
|
|
245
246
|
|
|
246
247
|
def add(
|
|
247
248
|
self,
|
|
@@ -262,7 +263,7 @@ class GitPythonBackend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
262
263
|
paths = [path for path in paths if not self.is_ignored(path)]
|
|
263
264
|
self.git.add(*paths, **kwargs)
|
|
264
265
|
else:
|
|
265
|
-
self.repo.index.add(paths)
|
|
266
|
+
self.repo.index.add(paths if isinstance(paths, str) else list(paths))
|
|
266
267
|
except AssertionError as exc:
|
|
267
268
|
# NOTE: GitPython is not currently able to handle index version >= 3.
|
|
268
269
|
# See https://github.com/iterative/dvc/issues/610 for more details.
|
|
@@ -301,7 +302,7 @@ class GitPythonBackend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
301
302
|
kwargs["force"] = True
|
|
302
303
|
if unshallow:
|
|
303
304
|
kwargs["unshallow"] = True
|
|
304
|
-
infos = self.repo.remote(name=remote).fetch(**kwargs)
|
|
305
|
+
infos = self.repo.remote(name=remote).fetch(**kwargs) # type: ignore[arg-type]
|
|
305
306
|
for info in infos:
|
|
306
307
|
if info.flags & info.ERROR:
|
|
307
308
|
raise SCMError(f"fetch failed: {info.note}")
|
|
@@ -350,7 +351,7 @@ class GitPythonBackend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
350
351
|
|
|
351
352
|
def active_branch_remote(self) -> str:
|
|
352
353
|
try:
|
|
353
|
-
return self.repo.active_branch.tracking_branch()
|
|
354
|
+
return self.repo.active_branch.tracking_branch() # type: ignore[return-value]
|
|
354
355
|
except (TypeError, ValueError) as exc:
|
|
355
356
|
raise SCMError("No active branch tracking remote") from exc
|
|
356
357
|
|
|
@@ -428,15 +429,15 @@ class GitPythonBackend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
428
429
|
return GitCommit(
|
|
429
430
|
commit.hexsha,
|
|
430
431
|
commit.committed_date,
|
|
431
|
-
commit.committer_tz_offset,
|
|
432
|
-
commit.message,
|
|
432
|
+
commit.committer_tz_offset, # type: ignore[arg-type]
|
|
433
|
+
commit.message, # type: ignore[arg-type]
|
|
433
434
|
[str(parent) for parent in commit.parents],
|
|
434
|
-
commit.committer.name,
|
|
435
|
-
commit.committer.email,
|
|
436
|
-
commit.author.name,
|
|
437
|
-
commit.author.email,
|
|
435
|
+
commit.committer.name, # type: ignore[arg-type]
|
|
436
|
+
commit.committer.email, # type: ignore[arg-type]
|
|
437
|
+
commit.author.name, # type: ignore[arg-type]
|
|
438
|
+
commit.author.email, # type: ignore[arg-type]
|
|
438
439
|
commit.authored_date,
|
|
439
|
-
commit.author_tz_offset,
|
|
440
|
+
commit.author_tz_offset, # type: ignore[arg-type]
|
|
440
441
|
)
|
|
441
442
|
|
|
442
443
|
def set_ref(
|
|
@@ -744,6 +745,8 @@ class GitPythonBackend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
744
745
|
if not ref.tag:
|
|
745
746
|
return ref.commit.hexsha
|
|
746
747
|
tag = ref.tag
|
|
748
|
+
assert tag.tagger.email
|
|
749
|
+
assert tag.tagger.name
|
|
747
750
|
return GitTag(
|
|
748
751
|
tag.tag,
|
|
749
752
|
tag.hexsha,
|
|
@@ -171,7 +171,7 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
171
171
|
# NOTE: we want this init to be lazy so we do it on backend init.
|
|
172
172
|
# for subsequent backend instances, this call will error out since
|
|
173
173
|
# the filter is already registered
|
|
174
|
-
pygit2.filter_register("lfs", LFSFilter)
|
|
174
|
+
pygit2.filter_register("lfs", LFSFilter) # type: ignore[attr-defined]
|
|
175
175
|
except ValueError:
|
|
176
176
|
pass
|
|
177
177
|
|
|
@@ -181,7 +181,7 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
181
181
|
self.repo.free()
|
|
182
182
|
|
|
183
183
|
@property
|
|
184
|
-
def root_dir(self) -> str:
|
|
184
|
+
def root_dir(self) -> Optional[str]:
|
|
185
185
|
return self.repo.workdir
|
|
186
186
|
|
|
187
187
|
@cached_property
|
|
@@ -194,10 +194,10 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
194
194
|
from pygit2 import Tag
|
|
195
195
|
from pygit2.enums import ObjectType
|
|
196
196
|
|
|
197
|
-
commit, ref = self.repo.resolve_refish(refish)
|
|
197
|
+
commit, ref = self.repo.resolve_refish(refish) # type: ignore[attr-defined]
|
|
198
198
|
if isinstance(commit, Tag):
|
|
199
199
|
ref = commit
|
|
200
|
-
commit = commit.peel(ObjectType.COMMIT)
|
|
200
|
+
commit = commit.peel(ObjectType.COMMIT) # type: ignore[call-overload]
|
|
201
201
|
return commit, ref
|
|
202
202
|
|
|
203
203
|
@property
|
|
@@ -354,8 +354,8 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
354
354
|
with self.release_odb_handles():
|
|
355
355
|
if create_new:
|
|
356
356
|
commit = self.repo.revparse_single("HEAD")
|
|
357
|
-
new_branch = self.repo.branches.local.create(branch, commit)
|
|
358
|
-
self.repo.checkout(new_branch, strategy=strategy)
|
|
357
|
+
new_branch = self.repo.branches.local.create(branch, commit) # type: ignore[arg-type]
|
|
358
|
+
self.repo.checkout(new_branch, strategy=strategy) # type: ignore[attr-defined]
|
|
359
359
|
else:
|
|
360
360
|
if branch == "-":
|
|
361
361
|
branch = "@{-1}"
|
|
@@ -363,12 +363,12 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
363
363
|
commit, ref = self._resolve_refish(branch)
|
|
364
364
|
except (KeyError, GitError) as exc:
|
|
365
365
|
raise RevError(f"unknown Git revision '{branch}'") from exc
|
|
366
|
-
self.repo.checkout_tree(commit, strategy=strategy)
|
|
366
|
+
self.repo.checkout_tree(commit, strategy=strategy) # type: ignore[attr-defined]
|
|
367
367
|
detach = kwargs.get("detach", False)
|
|
368
368
|
if ref and not detach:
|
|
369
|
-
self.repo.set_head(ref.name)
|
|
369
|
+
self.repo.set_head(ref.name) # type: ignore[attr-defined]
|
|
370
370
|
else:
|
|
371
|
-
self.repo.set_head(commit.id)
|
|
371
|
+
self.repo.set_head(commit.id) # type: ignore[attr-defined]
|
|
372
372
|
|
|
373
373
|
def fetch(
|
|
374
374
|
self,
|
|
@@ -389,7 +389,7 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
389
389
|
|
|
390
390
|
try:
|
|
391
391
|
commit = self.repo[self.repo.head.target]
|
|
392
|
-
self.repo.create_branch(branch, commit)
|
|
392
|
+
self.repo.create_branch(branch, commit) # type: ignore[arg-type]
|
|
393
393
|
except GitError as exc:
|
|
394
394
|
raise SCMError(f"Failed to create branch '{branch}'") from exc
|
|
395
395
|
|
|
@@ -431,7 +431,7 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
431
431
|
# if HEAD points to a nonexistent branch we still return the
|
|
432
432
|
# branch name (without "refs/heads/" prefix) to match gitpython's
|
|
433
433
|
# behavior
|
|
434
|
-
return self.repo.references["HEAD"].target[11:]
|
|
434
|
+
return self.repo.references["HEAD"].target[11:] # type: ignore[index]
|
|
435
435
|
return self.repo.head.shorthand
|
|
436
436
|
|
|
437
437
|
def active_branch_remote(self) -> str:
|
|
@@ -474,13 +474,13 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
474
474
|
|
|
475
475
|
# Walk all commits
|
|
476
476
|
walker = self.repo.walk(None)
|
|
477
|
-
for
|
|
478
|
-
walker.push(
|
|
477
|
+
for o in starting_points:
|
|
478
|
+
walker.push(o)
|
|
479
479
|
walker.sort(SortMode.TIME)
|
|
480
480
|
return [str(commit.id) for commit in walker]
|
|
481
481
|
|
|
482
482
|
def get_tree_obj(self, rev: str, **kwargs) -> Pygit2Object:
|
|
483
|
-
tree = self.repo[rev].tree
|
|
483
|
+
tree = self.repo[rev].tree # type: ignore[attr-defined]
|
|
484
484
|
return Pygit2Object(tree, backend=self)
|
|
485
485
|
|
|
486
486
|
def get_rev(self) -> str:
|
|
@@ -571,7 +571,7 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
571
571
|
try:
|
|
572
572
|
obj = self.repo[ref.target]
|
|
573
573
|
if isinstance(obj, Tag):
|
|
574
|
-
return str(obj.peel(ObjectType.COMMIT).id)
|
|
574
|
+
return str(obj.peel(ObjectType.COMMIT).id) # type: ignore[call-overload]
|
|
575
575
|
except ValueError:
|
|
576
576
|
pass
|
|
577
577
|
|
|
@@ -784,7 +784,7 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
784
784
|
from scmrepo.git import Stash
|
|
785
785
|
|
|
786
786
|
try:
|
|
787
|
-
oid = self.repo.stash(
|
|
787
|
+
oid = self.repo.stash( # type: ignore[attr-defined]
|
|
788
788
|
self.committer,
|
|
789
789
|
message=message,
|
|
790
790
|
include_untracked=include_untracked,
|
|
@@ -795,8 +795,8 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
795
795
|
commit = self.repo[oid]
|
|
796
796
|
|
|
797
797
|
if ref != Stash.DEFAULT_STASH:
|
|
798
|
-
self.set_ref(ref, commit.id, message=commit.message)
|
|
799
|
-
self.repo.stash_drop()
|
|
798
|
+
self.set_ref(ref, commit.id, message=commit.message) # type: ignore[attr-defined,arg-type]
|
|
799
|
+
self.repo.stash_drop() # type: ignore[attr-defined]
|
|
800
800
|
return str(oid), False
|
|
801
801
|
|
|
802
802
|
def _stash_apply(
|
|
@@ -813,11 +813,11 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
813
813
|
|
|
814
814
|
def _apply(index):
|
|
815
815
|
try:
|
|
816
|
-
self.repo.index.read(False)
|
|
816
|
+
self.repo.index.read(False) # type: ignore[attr-defined]
|
|
817
817
|
strategy = self._get_checkout_strategy()
|
|
818
818
|
if skip_conflicts:
|
|
819
819
|
strategy |= CheckoutStrategy.ALLOW_CONFLICTS
|
|
820
|
-
self.repo.stash_apply(
|
|
820
|
+
self.repo.stash_apply( # type: ignore[attr-defined]
|
|
821
821
|
index, strategy=strategy, reinstate_index=reinstate_index
|
|
822
822
|
)
|
|
823
823
|
except GitError as exc:
|
|
@@ -839,7 +839,7 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
839
839
|
try:
|
|
840
840
|
_apply(0)
|
|
841
841
|
finally:
|
|
842
|
-
self.repo.stash_drop()
|
|
842
|
+
self.repo.stash_drop() # type: ignore[attr-defined]
|
|
843
843
|
|
|
844
844
|
def _stash_drop(self, ref: str, index: int):
|
|
845
845
|
from scmrepo.git import Stash
|
|
@@ -847,7 +847,7 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
847
847
|
if ref != Stash.DEFAULT_STASH:
|
|
848
848
|
raise NotImplementedError
|
|
849
849
|
|
|
850
|
-
self.repo.stash_drop(index)
|
|
850
|
+
self.repo.stash_drop(index) # type: ignore[attr-defined]
|
|
851
851
|
|
|
852
852
|
def _describe(
|
|
853
853
|
self,
|
|
@@ -865,16 +865,16 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
865
865
|
from pygit2 import IndexEntry
|
|
866
866
|
from pygit2.enums import ResetMode
|
|
867
867
|
|
|
868
|
-
self.repo.index.read(False)
|
|
868
|
+
self.repo.index.read(False) # type: ignore[attr-defined]
|
|
869
869
|
if paths is not None:
|
|
870
|
-
tree = self.repo.revparse_single("HEAD").tree
|
|
870
|
+
tree = self.repo.revparse_single("HEAD").tree # type: ignore[attr-defined]
|
|
871
871
|
for path in paths:
|
|
872
872
|
rel = relpath(path, self.root_dir)
|
|
873
873
|
if os.name == "nt":
|
|
874
874
|
rel = rel.replace("\\", "/")
|
|
875
875
|
obj = tree[rel]
|
|
876
|
-
self.repo.index.add(IndexEntry(rel, obj.id, obj.filemode))
|
|
877
|
-
self.repo.index.write()
|
|
876
|
+
self.repo.index.add(IndexEntry(rel, obj.id, obj.filemode)) # type: ignore[attr-defined]
|
|
877
|
+
self.repo.index.write() # type: ignore[attr-defined]
|
|
878
878
|
elif hard:
|
|
879
879
|
self.repo.reset(self.repo.head.target, ResetMode.HARD)
|
|
880
880
|
else:
|
|
@@ -900,7 +900,7 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
900
900
|
strategy |= CheckoutStrategy.ALLOW_CONFLICTS
|
|
901
901
|
strategy = self._get_checkout_strategy(strategy)
|
|
902
902
|
|
|
903
|
-
index = self.repo.index
|
|
903
|
+
index = self.repo.index # type: ignore[attr-defined]
|
|
904
904
|
if paths:
|
|
905
905
|
path_list: Optional[list[str]] = [
|
|
906
906
|
relpath(path, self.root_dir) for path in paths
|
|
@@ -914,7 +914,7 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
914
914
|
path_list = None
|
|
915
915
|
|
|
916
916
|
with self.release_odb_handles():
|
|
917
|
-
self.repo.checkout_index(index=index, paths=path_list, strategy=strategy)
|
|
917
|
+
self.repo.checkout_index(index=index, paths=path_list, strategy=strategy) # type: ignore[attr-defined]
|
|
918
918
|
|
|
919
919
|
if index.conflicts and (ours or theirs):
|
|
920
920
|
for ancestor, ours_entry, theirs_entry in index.conflicts:
|
|
@@ -925,9 +925,10 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
925
925
|
index.add(ours_entry)
|
|
926
926
|
else:
|
|
927
927
|
entry = theirs_entry
|
|
928
|
+
assert self.root_dir
|
|
928
929
|
path = os.path.join(self.root_dir, entry.path)
|
|
929
930
|
with open(path, "wb") as fobj:
|
|
930
|
-
fobj.write(self.repo.get(entry.id).read_raw())
|
|
931
|
+
fobj.write(self.repo.get(entry.id).read_raw()) # type: ignore[attr-defined]
|
|
931
932
|
index.add(entry.path)
|
|
932
933
|
index.write()
|
|
933
934
|
|
|
@@ -990,8 +991,8 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
990
991
|
raise SCMError("Cannot merge with 'squash' and 'commit'")
|
|
991
992
|
|
|
992
993
|
with self.release_odb_handles():
|
|
993
|
-
self.repo.index.read(False)
|
|
994
|
-
obj, _ref = self.repo.resolve_refish(rev)
|
|
994
|
+
self.repo.index.read(False) # type: ignore[attr-defined]
|
|
995
|
+
obj, _ref = self.repo.resolve_refish(rev) # type: ignore[attr-defined]
|
|
995
996
|
try:
|
|
996
997
|
analysis, ff_pref = self.repo.merge_analysis(obj.id)
|
|
997
998
|
except GitError as exc:
|
|
@@ -1003,12 +1004,12 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
1003
1004
|
return None
|
|
1004
1005
|
|
|
1005
1006
|
try:
|
|
1006
|
-
self.repo.merge(obj.id)
|
|
1007
|
-
self.repo.index.write()
|
|
1007
|
+
self.repo.merge(obj.id) # type: ignore[attr-defined]
|
|
1008
|
+
self.repo.index.write() # type: ignore[attr-defined]
|
|
1008
1009
|
except GitError as exc:
|
|
1009
1010
|
raise SCMError("Merge failed") from exc
|
|
1010
1011
|
|
|
1011
|
-
if self.repo.index.conflicts:
|
|
1012
|
+
if self.repo.index.conflicts: # type: ignore[attr-defined]
|
|
1012
1013
|
raise MergeConflictError("Merge contained conflicts")
|
|
1013
1014
|
|
|
1014
1015
|
try:
|
|
@@ -1017,7 +1018,7 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
1017
1018
|
return self._merge_ff(rev, obj)
|
|
1018
1019
|
|
|
1019
1020
|
if analysis & MergeAnalysis.UNBORN:
|
|
1020
|
-
self.repo.set_head(obj.id)
|
|
1021
|
+
self.repo.set_head(obj.id) # type: ignore[attr-defined]
|
|
1021
1022
|
return str(obj.id)
|
|
1022
1023
|
|
|
1023
1024
|
if ff_pref & MergePreference.FASTFORWARD_ONLY:
|
|
@@ -1030,12 +1031,12 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
1030
1031
|
# HEAD is not moved and merge changes stay in index
|
|
1031
1032
|
return None
|
|
1032
1033
|
finally:
|
|
1033
|
-
self.repo.state_cleanup()
|
|
1034
|
-
self.repo.index.write()
|
|
1034
|
+
self.repo.state_cleanup() # type: ignore[attr-defined]
|
|
1035
|
+
self.repo.index.write() # type: ignore[attr-defined]
|
|
1035
1036
|
|
|
1036
1037
|
def _merge_ff(self, rev: str, obj) -> str:
|
|
1037
1038
|
if self.repo.head_is_detached:
|
|
1038
|
-
self.repo.set_head(obj.id)
|
|
1039
|
+
self.repo.set_head(obj.id) # type: ignore[attr-defined]
|
|
1039
1040
|
else:
|
|
1040
1041
|
branch = self.get_ref("HEAD", follow=False)
|
|
1041
1042
|
assert branch
|
|
@@ -1049,7 +1050,7 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
1049
1050
|
def _merge_commit(self, msg: Optional[str], obj) -> str:
|
|
1050
1051
|
if not msg:
|
|
1051
1052
|
raise SCMError("Merge commit message is required")
|
|
1052
|
-
tree = self.repo.index.write_tree()
|
|
1053
|
+
tree = self.repo.index.write_tree() # type: ignore[attr-defined]
|
|
1053
1054
|
merge_commit = self.repo.create_commit(
|
|
1054
1055
|
"HEAD",
|
|
1055
1056
|
self.author,
|
|
@@ -1103,7 +1104,7 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
1103
1104
|
|
|
1104
1105
|
if path:
|
|
1105
1106
|
return Pygit2Config(_Pygit2Config(path))
|
|
1106
|
-
return Pygit2Config(self.repo.config)
|
|
1107
|
+
return Pygit2Config(self.repo.config) # type: ignore[attr-defined]
|
|
1107
1108
|
|
|
1108
1109
|
def check_attr(
|
|
1109
1110
|
self,
|
|
@@ -1123,7 +1124,7 @@ class Pygit2Backend(BaseGitBackend): # pylint:disable=abstract-method
|
|
|
1123
1124
|
except (KeyError, GitError) as exc:
|
|
1124
1125
|
raise SCMError(f"Invalid commit '{source}'") from exc
|
|
1125
1126
|
try:
|
|
1126
|
-
return self.repo.get_attr(
|
|
1127
|
+
return self.repo.get_attr( # type: ignore[attr-defined]
|
|
1127
1128
|
path, attr, flags=flags, commit=commit.id if commit else None
|
|
1128
1129
|
)
|
|
1129
1130
|
except GitError as exc:
|
|
@@ -18,22 +18,22 @@ class LFSFilter(Filter):
|
|
|
18
18
|
self._smudge_root: Optional[str] = None
|
|
19
19
|
|
|
20
20
|
def check(self, src: "FilterSource", attr_values: list[Optional[str]]):
|
|
21
|
-
if attr_values[0] == "lfs" and src.mode != GIT_FILTER_CLEAN:
|
|
21
|
+
if attr_values[0] == "lfs" and src.mode != GIT_FILTER_CLEAN: # type: ignore[attr-defined]
|
|
22
22
|
self._smudge_buf = io.BytesIO()
|
|
23
|
-
self._smudge_root = src.repo.workdir or src.repo.path
|
|
23
|
+
self._smudge_root = src.repo.workdir or src.repo.path # type: ignore[attr-defined]
|
|
24
24
|
return
|
|
25
25
|
raise Passthrough
|
|
26
26
|
|
|
27
27
|
def write(
|
|
28
28
|
self, data: bytes, src: "FilterSource", write_next: Callable[[bytes], None]
|
|
29
29
|
):
|
|
30
|
-
if src.mode == GIT_FILTER_CLEAN:
|
|
30
|
+
if src.mode == GIT_FILTER_CLEAN: # type: ignore[attr-defined]
|
|
31
31
|
write_next(data)
|
|
32
32
|
return
|
|
33
33
|
if self._smudge_buf is None:
|
|
34
34
|
self._smudge_buf = io.BytesIO()
|
|
35
35
|
if self._smudge_root is None:
|
|
36
|
-
self._smudge_root = src.repo.workdir or src.repo.path
|
|
36
|
+
self._smudge_root = src.repo.workdir or src.repo.path # type: ignore[attr-defined]
|
|
37
37
|
self._smudge_buf.write(data)
|
|
38
38
|
|
|
39
39
|
def close(self, write_next: Callable[[bytes], None]):
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import os
|
|
2
|
-
from collections.abc import MutableMapping
|
|
2
|
+
from collections.abc import Iterator, MutableMapping
|
|
3
|
+
from typing import Callable, TypeVar, Union
|
|
3
4
|
|
|
5
|
+
K = TypeVar("K")
|
|
6
|
+
V = TypeVar("V")
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
|
|
9
|
+
class LazyDict(MutableMapping[K, V]):
|
|
10
|
+
def __init__(self, values: dict[K, Union[V, Callable[[], V]]]):
|
|
7
11
|
self._values = values
|
|
8
12
|
|
|
9
13
|
def __getitem__(self, item):
|
|
@@ -13,16 +17,16 @@ class LazyDict(MutableMapping):
|
|
|
13
17
|
self._values[item] = value
|
|
14
18
|
return value
|
|
15
19
|
|
|
16
|
-
def __setitem__(self, key, value):
|
|
20
|
+
def __setitem__(self, key: K, value: Union[V, Callable[[], V]]) -> None:
|
|
17
21
|
self._values[key] = value
|
|
18
22
|
|
|
19
|
-
def __delitem__(self, key):
|
|
23
|
+
def __delitem__(self, key: K) -> None:
|
|
20
24
|
del self._values[key]
|
|
21
25
|
|
|
22
|
-
def __iter__(self):
|
|
26
|
+
def __iter__(self) -> Iterator[K]:
|
|
23
27
|
return iter(self._values)
|
|
24
28
|
|
|
25
|
-
def __len__(self):
|
|
29
|
+
def __len__(self) -> int:
|
|
26
30
|
return len(self._values)
|
|
27
31
|
|
|
28
32
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scmrepo
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.5.0
|
|
4
4
|
Summary: scmrepo
|
|
5
5
|
Author-email: Iterative <support@dvc.org>
|
|
6
|
-
License: Apache-2.0
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
7
|
Project-URL: Issues, https://github.com/iterative/scmrepo/issues
|
|
8
8
|
Project-URL: Source, https://github.com/iterative/scmrepo
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -17,7 +17,7 @@ Requires-Python: >=3.9
|
|
|
17
17
|
Description-Content-Type: text/x-rst
|
|
18
18
|
License-File: LICENSE
|
|
19
19
|
Requires-Dist: gitpython>3
|
|
20
|
-
Requires-Dist: dulwich>=0.
|
|
20
|
+
Requires-Dist: dulwich>=0.24.0
|
|
21
21
|
Requires-Dist: pygit2>=1.14.0
|
|
22
22
|
Requires-Dist: pygtrie>=2.3.2
|
|
23
23
|
Requires-Dist: fsspec[tqdm]>=2024.2.0
|
|
@@ -73,7 +73,7 @@ def test_subprocess_strip_trailing_garbage_bytes(git_helper, mocker):
|
|
|
73
73
|
"subprocess.run",
|
|
74
74
|
# Simulate git-credential-osxkeychain (version 2.45), assuming initial 0-byte
|
|
75
75
|
return_value=mocker.Mock(
|
|
76
|
-
stdout=f"username=foo\npassword=bar{chr(0)}{random.randbytes(15)}"
|
|
76
|
+
stdout=f"username=foo\npassword=bar{chr(0)}{random.randbytes(15)}" # type: ignore[str-bytes-safe]
|
|
77
77
|
),
|
|
78
78
|
)
|
|
79
79
|
creds = git_helper.get(Credential(protocol="https", host="foo.com", path="foo.git"))
|
|
@@ -68,24 +68,24 @@ class Server(paramiko.ServerInterface):
|
|
|
68
68
|
|
|
69
69
|
def check_auth_interactive_response(self, responses):
|
|
70
70
|
if responses[0] == PASSWORD:
|
|
71
|
-
return paramiko.AUTH_SUCCESSFUL
|
|
72
|
-
return paramiko.AUTH_FAILED
|
|
71
|
+
return paramiko.AUTH_SUCCESSFUL # type: ignore[attr-defined]
|
|
72
|
+
return paramiko.AUTH_FAILED # type: ignore[attr-defined]
|
|
73
73
|
|
|
74
74
|
def check_auth_password(self, username, password):
|
|
75
75
|
if username == USER and password == PASSWORD:
|
|
76
|
-
return paramiko.AUTH_SUCCESSFUL
|
|
77
|
-
return paramiko.AUTH_FAILED
|
|
76
|
+
return paramiko.AUTH_SUCCESSFUL # type: ignore[attr-defined]
|
|
77
|
+
return paramiko.AUTH_FAILED # type: ignore[attr-defined]
|
|
78
78
|
|
|
79
79
|
def check_auth_publickey(self, username, key):
|
|
80
80
|
pubkey = paramiko.RSAKey.from_private_key(StringIO(CLIENT_KEY))
|
|
81
81
|
if username == USER and key == pubkey:
|
|
82
|
-
return paramiko.AUTH_SUCCESSFUL
|
|
83
|
-
return paramiko.AUTH_FAILED
|
|
82
|
+
return paramiko.AUTH_SUCCESSFUL # type: ignore[attr-defined]
|
|
83
|
+
return paramiko.AUTH_FAILED # type: ignore[attr-defined]
|
|
84
84
|
|
|
85
85
|
def check_channel_request(self, kind, chanid):
|
|
86
86
|
if kind == "session":
|
|
87
|
-
return paramiko.OPEN_SUCCEEDED
|
|
88
|
-
return paramiko.OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED
|
|
87
|
+
return paramiko.OPEN_SUCCEEDED # type: ignore[attr-defined]
|
|
88
|
+
return paramiko.OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED # type: ignore[attr-defined]
|
|
89
89
|
|
|
90
90
|
def get_allowed_auths(self, username):
|
|
91
91
|
return self.allowed_auths
|
|
@@ -111,7 +111,7 @@ def ssh_conn(request: pytest.FixtureRequest) -> dict[str, Any]:
|
|
|
111
111
|
conn, _ = sock.accept()
|
|
112
112
|
except OSError:
|
|
113
113
|
return False
|
|
114
|
-
server.transport = transport = paramiko.Transport(conn)
|
|
114
|
+
server.transport = transport = paramiko.Transport(conn) # type: ignore[attr-defined]
|
|
115
115
|
request.addfinalizer(transport.close)
|
|
116
116
|
host_key = paramiko.RSAKey.from_private_key(StringIO(CLIENT_KEY))
|
|
117
117
|
transport.add_server_key(host_key)
|
|
@@ -921,7 +921,7 @@ def test_ignored(tmp_dir: TmpDir, scm: Git, git: Git, git_backend: str):
|
|
|
921
921
|
assert not git.is_ignored(tmp_dir / "dir1" / "file2.txt")
|
|
922
922
|
|
|
923
923
|
|
|
924
|
-
@pytest.mark.skip_git_backend("pygit2", "gitpython"
|
|
924
|
+
@pytest.mark.skip_git_backend("pygit2", "gitpython")
|
|
925
925
|
def test_ignored_dir_unignored_subdirs(tmp_dir: TmpDir, scm: Git, git: Git):
|
|
926
926
|
tmp_dir.gen({".gitignore": "data/**\n!data/**/\n!data/**/*.csv"})
|
|
927
927
|
scm.add([".gitignore"])
|
|
@@ -1111,6 +1111,7 @@ def proxy_server():
|
|
|
1111
1111
|
pass
|
|
1112
1112
|
|
|
1113
1113
|
_ProxyServer.setUpClass()
|
|
1114
|
+
assert _ProxyServer.PROXY
|
|
1114
1115
|
yield f"http://{_ProxyServer.PROXY.flags.hostname}:{_ProxyServer.PROXY.flags.port}"
|
|
1115
1116
|
_ProxyServer.tearDownClass()
|
|
1116
1117
|
|
|
@@ -41,19 +41,19 @@ else:
|
|
|
41
41
|
|
|
42
42
|
def check_auth_password(self, username, password):
|
|
43
43
|
if username == USER and password == PASSWORD:
|
|
44
|
-
return paramiko.AUTH_SUCCESSFUL
|
|
45
|
-
return paramiko.AUTH_FAILED
|
|
44
|
+
return paramiko.AUTH_SUCCESSFUL # type: ignore[attr-defined]
|
|
45
|
+
return paramiko.AUTH_FAILED # type: ignore[attr-defined]
|
|
46
46
|
|
|
47
47
|
def check_auth_publickey(self, username, key):
|
|
48
48
|
pubkey = paramiko.RSAKey.from_private_key(StringIO(CLIENT_KEY))
|
|
49
49
|
if username == USER and key == pubkey:
|
|
50
|
-
return paramiko.AUTH_SUCCESSFUL
|
|
51
|
-
return paramiko.AUTH_FAILED
|
|
50
|
+
return paramiko.AUTH_SUCCESSFUL # type: ignore[attr-defined]
|
|
51
|
+
return paramiko.AUTH_FAILED # type: ignore[attr-defined]
|
|
52
52
|
|
|
53
53
|
def check_channel_request(self, kind, chanid):
|
|
54
54
|
if kind == "session":
|
|
55
|
-
return paramiko.OPEN_SUCCEEDED
|
|
56
|
-
return paramiko.OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED
|
|
55
|
+
return paramiko.OPEN_SUCCEEDED # type: ignore[attr-defined]
|
|
56
|
+
return paramiko.OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED # type: ignore[attr-defined]
|
|
57
57
|
|
|
58
58
|
def get_allowed_auths(self, username):
|
|
59
59
|
return "password,publickey"
|
|
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
|