git-project 0.0.32__tar.gz → 0.0.34__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 (43) hide show
  1. {git_project-0.0.32 → git_project-0.0.34}/PKG-INFO +1 -1
  2. {git_project-0.0.32 → git_project-0.0.34}/_version.py +2 -2
  3. {git_project-0.0.32 → git_project-0.0.34}/src/git_project/git.py +9 -5
  4. {git_project-0.0.32 → git_project-0.0.34}/src/git_project/substitutable.py +0 -1
  5. {git_project-0.0.32 → git_project-0.0.34}/tests/test_git.py +6 -6
  6. {git_project-0.0.32 → git_project-0.0.34}/tests/test_project.py +1 -1
  7. {git_project-0.0.32 → git_project-0.0.34}/.git +0 -0
  8. {git_project-0.0.32 → git_project-0.0.34}/.gitignore +0 -0
  9. {git_project-0.0.32 → git_project-0.0.34}/CONTRIBUTORS +0 -0
  10. {git_project-0.0.32 → git_project-0.0.34}/COPYING +0 -0
  11. {git_project-0.0.32 → git_project-0.0.34}/MANIFEST.in +0 -0
  12. {git_project-0.0.32 → git_project-0.0.34}/docs/Makefile +0 -0
  13. {git_project-0.0.32 → git_project-0.0.34}/docs/authors.rst +0 -0
  14. {git_project-0.0.32 → git_project-0.0.34}/docs/changelog.rst +0 -0
  15. {git_project-0.0.32 → git_project-0.0.34}/docs/conf.py +0 -0
  16. {git_project-0.0.32 → git_project-0.0.34}/docs/index.rst +0 -0
  17. {git_project-0.0.32 → git_project-0.0.34}/docs/intro.rst +0 -0
  18. {git_project-0.0.32 → git_project-0.0.34}/docs/license.rst +0 -0
  19. {git_project-0.0.32 → git_project-0.0.34}/docs/make.bat +0 -0
  20. {git_project-0.0.32 → git_project-0.0.34}/pyproject.toml +0 -0
  21. {git_project-0.0.32 → git_project-0.0.34}/requirements.txt +0 -0
  22. {git_project-0.0.32 → git_project-0.0.34}/src/git_project/__init__.py +0 -0
  23. {git_project-0.0.32 → git_project-0.0.34}/src/git_project/commandline.py +0 -0
  24. {git_project-0.0.32 → git_project-0.0.34}/src/git_project/configobj.py +0 -0
  25. {git_project-0.0.32 → git_project-0.0.34}/src/git_project/exception.py +0 -0
  26. {git_project-0.0.32 → git_project-0.0.34}/src/git_project/gitproject.py +0 -0
  27. {git_project-0.0.32 → git_project-0.0.34}/src/git_project/main.py +0 -0
  28. {git_project-0.0.32 → git_project-0.0.34}/src/git_project/parsermanager.py +0 -0
  29. {git_project-0.0.32 → git_project-0.0.34}/src/git_project/plugin.py +0 -0
  30. {git_project-0.0.32 → git_project-0.0.34}/src/git_project/pluginmanager.py +0 -0
  31. {git_project-0.0.32 → git_project-0.0.34}/src/git_project/project.py +0 -0
  32. {git_project-0.0.32 → git_project-0.0.34}/src/git_project/runnable.py +0 -0
  33. {git_project-0.0.32 → git_project-0.0.34}/src/git_project/scopedobj.py +0 -0
  34. {git_project-0.0.32 → git_project-0.0.34}/src/git_project/shell.py +0 -0
  35. {git_project-0.0.32 → git_project-0.0.34}/src/git_project/test_support/__init__.py +0 -0
  36. {git_project-0.0.32 → git_project-0.0.34}/src/git_project/test_support/common.py +0 -0
  37. {git_project-0.0.32 → git_project-0.0.34}/tests/conftest.py +0 -0
  38. {git_project-0.0.32 → git_project-0.0.34}/tests/test_confobj.py +0 -0
  39. {git_project-0.0.32 → git_project-0.0.34}/tests/test_gitproject.py +0 -0
  40. {git_project-0.0.32 → git_project-0.0.34}/tests/test_main.py +0 -0
  41. {git_project-0.0.32 → git_project-0.0.34}/tests/test_runnable.py +0 -0
  42. {git_project-0.0.32 → git_project-0.0.34}/tests/test_scopedobj.py +0 -0
  43. {git_project-0.0.32 → git_project-0.0.34}/tests/test_substitutable.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: git-project
3
- Version: 0.0.32
3
+ Version: 0.0.34
4
4
  Summary: The extensible stupid project manager
5
5
  Author-email: "David A. Greene" <dag@obbligato.org>
6
6
  License-Expression: AGPL-3.0-or-later
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.0.32'
21
- __version_tuple__ = version_tuple = (0, 0, 32)
20
+ __version__ = version = '0.0.34'
21
+ __version_tuple__ = version_tuple = (0, 0, 34)
@@ -404,8 +404,12 @@ class Git(object):
404
404
 
405
405
  def credentials(self, url, username_from_url, allowed_types):
406
406
  if allowed_types & pygit2.enums.CredentialType.SSH_KEY:
407
- return pygit2.Keypair(username_from_url, str(Path.home() / '.ssh' / 'id_rsa.pub'),
408
- str(Path.home() / '.ssh' / 'id_rsa'), '')
407
+ return pygit2.Keypair(
408
+ username_from_url,
409
+ str(Path.home() / '.ssh' / f'{self.ssh_id}.pub'),
410
+ str(Path.home() / '.ssh' / self.ssh_id),
411
+ ''
412
+ )
409
413
  elif allowed_types & pygit2.enums.CredentialType.USERNAME:
410
414
  return pygit2.Username(username_from_url)
411
415
  return None
@@ -600,7 +604,7 @@ class Git(object):
600
604
 
601
605
  def fetch_remote(self, remote):
602
606
  """Fetch all refspecs from the given remote."""
603
- callbacks = Git.RemoteCallbacks()
607
+ callbacks = Git.RemoteCallbacks(self.get_ssh_id())
604
608
  self._repo.remotes[remote].fetch(callbacks=callbacks)
605
609
 
606
610
  # Info on refs.
@@ -766,14 +770,14 @@ class Git(object):
766
770
  result = branch.upstream.branch_name
767
771
  return result
768
772
 
769
- def clone(self, url, path=None, bare=False):
773
+ def clone(self, url, ssh_id, path=None, bare=False):
770
774
  """Clone a respository at the given url, making a bare clone if specified."""
771
775
  parsed_url = urllib.parse.urlparse(url)
772
776
  url_path = Path(parsed_url.path).resolve()
773
777
  url_name = url_path.name
774
778
  target_path = path if path else str(Path.cwd() / url_name)
775
779
 
776
- callbacks = Git.RemoteCallbacks()
780
+ callbacks = Git.RemoteCallbacks(ssh_id)
777
781
  self._repo = pygit2.clone_repository(url, target_path, bare, callbacks=callbacks)
778
782
  self._config = self.Config(self, self._repo.config)
779
783
 
@@ -95,7 +95,6 @@ class SubstitutableConfigObject(ConfigObject):
95
95
  current_branch = git.refname_to_branch_name(head_name.read_text().strip())
96
96
  break
97
97
 
98
- print(f'current_branch: {current_branch}')
99
98
  if current_branch is not None:
100
99
  formats['branch'] = current_branch
101
100
 
@@ -439,7 +439,7 @@ def test_git_clone(reset_directory, remote_repository, tmp_path_factory):
439
439
 
440
440
  remote_url = 'file://' + remote_repository.path
441
441
 
442
- clone_path = git.clone(remote_url)
442
+ clone_path = git.clone(remote_url, 'id_rsa')
443
443
  assert os.path.exists(clone_path)
444
444
 
445
445
  os.chdir(clone_path)
@@ -454,7 +454,7 @@ def test_git_clone(reset_directory, remote_repository, tmp_path_factory):
454
454
 
455
455
  git = git_project.Git()
456
456
 
457
- clone_path = git.clone(remote_url, bare=True)
457
+ clone_path = git.clone(remote_url, 'id_rsa', bare=True)
458
458
 
459
459
  assert os.path.exists(clone_path)
460
460
 
@@ -480,7 +480,7 @@ def test_git_clone_with_path(reset_directory,
480
480
 
481
481
  path = path / 'test-clone'
482
482
 
483
- clone_path = git.clone(remote_url, path)
483
+ clone_path = git.clone(remote_url, 'id_rsa', path)
484
484
 
485
485
  assert os.path.exists(clone_path)
486
486
  assert clone_path == str(path)
@@ -878,7 +878,7 @@ def test_git_get_git_common_dir_renamed(reset_directory, local_repository):
878
878
 
879
879
 
880
880
  def test_git_remote_credentials(reset_directory):
881
- callback = git_project.Git.RemoteCallbacks();
881
+ callback = git_project.Git.RemoteCallbacks(ssh_id='id_rsa');
882
882
 
883
883
  key_result = callback.credentials(
884
884
  'ssh:me@my.org/test.git', 'me', pygit2.enums.CredentialType.SSH_KEY
@@ -892,7 +892,7 @@ def test_git_remote_credentials(reset_directory):
892
892
 
893
893
 
894
894
  def test_git_remote_branch_delete_credentials(reset_directory):
895
- callback = git_project.Git.RemoteBranchDeleteCallback();
895
+ callback = git_project.Git.RemoteBranchDeleteCallback(ssh_id='id_rsa');
896
896
 
897
897
  key_result = callback.credentials(
898
898
  'ssh:me@my.org/test.git', 'me', pygit2.enums.CredentialType.SSH_KEY
@@ -906,7 +906,7 @@ def test_git_remote_branch_delete_credentials(reset_directory):
906
906
 
907
907
 
908
908
  def test_git_ls_remotes_credentials(reset_directory):
909
- callback = git_project.Git.LsRemotesCallbacks();
909
+ callback = git_project.Git.LsRemotesCallbacks(ssh_id='id_rsa');
910
910
 
911
911
  key_result = callback.credentials(
912
912
  'ssh:me@my.org/test.git', 'me', pygit2.enums.CredentialType.SSH_KEY
@@ -142,7 +142,7 @@ def test_project_prune_branch(reset_directory,
142
142
  git = git_project.Git()
143
143
  project = git_project.Project.get(git, 'project')
144
144
 
145
- path = git.clone(remote_path)
145
+ path = git.clone(remote_path, 'id_rsa')
146
146
 
147
147
  os.chdir(path)
148
148
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes