gitman 3.8__tar.gz → 3.8.1__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.
Files changed (38) hide show
  1. {gitman-3.8 → gitman-3.8.1}/PKG-INFO +1 -1
  2. {gitman-3.8 → gitman-3.8.1}/gitman/git.py +17 -1
  3. {gitman-3.8 → gitman-3.8.1}/gitman/models/source.py +5 -3
  4. {gitman-3.8 → gitman-3.8.1}/pyproject.toml +7 -7
  5. {gitman-3.8 → gitman-3.8.1}/LICENSE.md +0 -0
  6. {gitman-3.8 → gitman-3.8.1}/README.md +0 -0
  7. {gitman-3.8 → gitman-3.8.1}/gitman/__init__.py +0 -0
  8. {gitman-3.8 → gitman-3.8.1}/gitman/__main__.py +0 -0
  9. {gitman-3.8 → gitman-3.8.1}/gitman/cli.py +0 -0
  10. {gitman-3.8 → gitman-3.8.1}/gitman/commands.py +0 -0
  11. {gitman-3.8 → gitman-3.8.1}/gitman/common.py +0 -0
  12. {gitman-3.8 → gitman-3.8.1}/gitman/decorators.py +0 -0
  13. {gitman-3.8 → gitman-3.8.1}/gitman/exceptions.py +0 -0
  14. {gitman-3.8 → gitman-3.8.1}/gitman/hook-gitman.py +0 -0
  15. {gitman-3.8 → gitman-3.8.1}/gitman/models/__init__.py +0 -0
  16. {gitman-3.8 → gitman-3.8.1}/gitman/models/config.py +0 -0
  17. {gitman-3.8 → gitman-3.8.1}/gitman/models/group.py +0 -0
  18. {gitman-3.8 → gitman-3.8.1}/gitman/plugin.py +0 -0
  19. {gitman-3.8 → gitman-3.8.1}/gitman/settings.py +0 -0
  20. {gitman-3.8 → gitman-3.8.1}/gitman/shell.py +0 -0
  21. {gitman-3.8 → gitman-3.8.1}/gitman/tests/__init__.py +0 -0
  22. {gitman-3.8 → gitman-3.8.1}/gitman/tests/conftest.py +0 -0
  23. {gitman-3.8 → gitman-3.8.1}/gitman/tests/files/gdm-custom.yml +0 -0
  24. {gitman-3.8 → gitman-3.8.1}/gitman/tests/files/gdm-default.yml +0 -0
  25. {gitman-3.8 → gitman-3.8.1}/gitman/tests/files/gitman.yml +0 -0
  26. {gitman-3.8 → gitman-3.8.1}/gitman/tests/files/subdir/gitman.yml +0 -0
  27. {gitman-3.8 → gitman-3.8.1}/gitman/tests/files/subdir/subsubdir/gitman.yml +0 -0
  28. {gitman-3.8 → gitman-3.8.1}/gitman/tests/files/subdir/subsubdir/skip/subsubsubsubdir/gitman.yml +0 -0
  29. {gitman-3.8 → gitman-3.8.1}/gitman/tests/test_cli.py +0 -0
  30. {gitman-3.8 → gitman-3.8.1}/gitman/tests/test_commands.py +0 -0
  31. {gitman-3.8 → gitman-3.8.1}/gitman/tests/test_common.py +0 -0
  32. {gitman-3.8 → gitman-3.8.1}/gitman/tests/test_git.py +0 -0
  33. {gitman-3.8 → gitman-3.8.1}/gitman/tests/test_models_config.py +0 -0
  34. {gitman-3.8 → gitman-3.8.1}/gitman/tests/test_models_group.py +0 -0
  35. {gitman-3.8 → gitman-3.8.1}/gitman/tests/test_models_source.py +0 -0
  36. {gitman-3.8 → gitman-3.8.1}/gitman/tests/test_plugin.py +0 -0
  37. {gitman-3.8 → gitman-3.8.1}/gitman/tests/test_shell.py +0 -0
  38. {gitman-3.8 → gitman-3.8.1}/gitman/tests/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitman
3
- Version: 3.8
3
+ Version: 3.8.1
4
4
  Summary: A language-agnostic dependency manager using Git.
5
5
  License: MIT
6
6
  License-File: LICENSE.md
@@ -12,6 +12,11 @@ from .exceptions import ShellError
12
12
  from .shell import call, pwd
13
13
 
14
14
 
15
+ def sanitize_sparse_paths(sparse_paths):
16
+ """Strip trailing glob patterns for cone mode (e.g. 'src/*' -> 'src')."""
17
+ return [p.rstrip("/*") if p.endswith("/*") else p for p in sparse_paths]
18
+
19
+
15
20
  def git(*args, **kwargs):
16
21
  return call("git", *args, **kwargs)
17
22
 
@@ -69,7 +74,13 @@ def clone(
69
74
  fd.write("%s/objects" % sparse_paths_repo)
70
75
 
71
76
  git("-C", normpath, "sparse-checkout", "init", "--cone")
72
- git("-C", normpath, "sparse-checkout", "set", *sparse_paths)
77
+ git(
78
+ "-C",
79
+ normpath,
80
+ "sparse-checkout",
81
+ "set",
82
+ *sanitize_sparse_paths(sparse_paths)
83
+ )
73
84
  git("-C", normpath, "fetch", "origin")
74
85
  git("-C", normpath, "checkout", rev)
75
86
  elif settings.CACHE_DISABLE:
@@ -245,6 +256,11 @@ def am(patch, _skip=False):
245
256
  raise ShellError from e
246
257
 
247
258
 
259
+ def apply_sparse_checkout(sparse_paths):
260
+ """Re-apply sparse-checkout paths to an existing working tree."""
261
+ git("sparse-checkout", "set", *sanitize_sparse_paths(sparse_paths))
262
+
263
+
248
264
  def update(
249
265
  type, repo, path, *, clean=True, fetch=False, rev=None
250
266
  ): # pylint: disable=redefined-outer-name,unused-argument
@@ -204,6 +204,10 @@ class Source:
204
204
  if fetch or git.is_fetch_required(self.type, self.rev):
205
205
  git.fetch(self.type, self.repo, self.name, rev=self.rev)
206
206
 
207
+ # Re-apply sparse-checkout paths in case they changed since initial clone
208
+ if self.sparse_paths and self.sparse_paths[0]:
209
+ git.apply_sparse_checkout(self.sparse_paths)
210
+
207
211
  # Update the working tree to the desired revision
208
212
  git.update(
209
213
  self.type, self.repo, self.name, fetch=fetch, clean=clean, rev=self.rev
@@ -386,9 +390,7 @@ class Source:
386
390
 
387
391
  Not a valid repository: {}
388
392
  During install you can rebuild a repo with a missing .git directory using the --force option
389
- """.format(
390
- path
391
- )
393
+ """.format(path)
392
394
  return exceptions.InvalidRepository(msg)
393
395
 
394
396
 
@@ -1,7 +1,7 @@
1
1
  [tool.poetry]
2
2
 
3
3
  name = "gitman"
4
- version = "3.8"
4
+ version = "3.8.1"
5
5
  description = "A language-agnostic dependency manager using Git."
6
6
 
7
7
  license = "MIT"
@@ -52,18 +52,18 @@ universal-startfile = ">=0.2,<0.5"
52
52
  [tool.poetry.group.dev.dependencies]
53
53
 
54
54
  # Formatters
55
- black = ">=24.8,<26.0"
56
- isort = ">=5.13,<7.0"
55
+ black = ">=24.8,<27.0"
56
+ isort = ">=5.13,<9.0"
57
57
 
58
58
  # Linters
59
59
  mypy = "^1.3"
60
60
  pydocstyle = "*"
61
- pylint = "~3.3"
61
+ pylint = ">=3.3,<4.1"
62
62
  types-freezegun = "*"
63
63
  types-setuptools = "*"
64
64
 
65
65
  # Testing
66
- pytest = "^8.3"
66
+ pytest = ">=8.3,<10.0"
67
67
  pytest-cov = ">=5,<8"
68
68
  pytest-describe = ">=2.2,<4.0"
69
69
  pytest-expecter = "^3.0"
@@ -71,11 +71,11 @@ pytest-random = "*"
71
71
  freezegun = "*"
72
72
 
73
73
  # Reports
74
- coveragespace = "^6.1"
74
+ coveragespace = "^6.2"
75
75
 
76
76
  # Documentation
77
77
  mkdocs = "^1.2.3"
78
- mkdocstrings = ">=0.18.1,<0.31.0"
78
+ mkdocstrings = ">=0.18.1,<1.1.0"
79
79
  mkdocstrings-python = "*"
80
80
  pygments = "^2.15.0"
81
81
  jinja2 = "~3.1.6"
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