git-project 0.0.28__tar.gz → 0.0.30__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 (47) hide show
  1. {git_project-0.0.28 → git_project-0.0.30}/PKG-INFO +1 -1
  2. {git_project-0.0.28 → git_project-0.0.30}/_version.py +2 -2
  3. {git_project-0.0.28 → git_project-0.0.30}/src/git_project/git.py +10 -8
  4. {git_project-0.0.28 → git_project-0.0.30}/tests/test_git.py +43 -0
  5. git_project-0.0.28/.#pyproject.toml +0 -1
  6. git_project-0.0.28/git_project-0.0.28.dev1+g2184a37-py3-none-any.whl +0 -0
  7. git_project-0.0.28/git_project-0.0.28.dev1+g2184a37.tar.gz +0 -0
  8. {git_project-0.0.28 → git_project-0.0.30}/.git +0 -0
  9. {git_project-0.0.28 → git_project-0.0.30}/.gitignore +0 -0
  10. {git_project-0.0.28 → git_project-0.0.30}/CONTRIBUTORS +0 -0
  11. {git_project-0.0.28 → git_project-0.0.30}/COPYING +0 -0
  12. {git_project-0.0.28 → git_project-0.0.30}/MANIFEST.in +0 -0
  13. {git_project-0.0.28 → git_project-0.0.30}/docs/Makefile +0 -0
  14. {git_project-0.0.28 → git_project-0.0.30}/docs/authors.rst +0 -0
  15. {git_project-0.0.28 → git_project-0.0.30}/docs/changelog.rst +0 -0
  16. {git_project-0.0.28 → git_project-0.0.30}/docs/conf.py +0 -0
  17. {git_project-0.0.28 → git_project-0.0.30}/docs/index.rst +0 -0
  18. {git_project-0.0.28 → git_project-0.0.30}/docs/intro.rst +0 -0
  19. {git_project-0.0.28 → git_project-0.0.30}/docs/license.rst +0 -0
  20. {git_project-0.0.28 → git_project-0.0.30}/docs/make.bat +0 -0
  21. {git_project-0.0.28 → git_project-0.0.30}/pyproject.toml +0 -0
  22. {git_project-0.0.28 → git_project-0.0.30}/requirements.txt +0 -0
  23. {git_project-0.0.28 → git_project-0.0.30}/src/git_project/__init__.py +0 -0
  24. {git_project-0.0.28 → git_project-0.0.30}/src/git_project/commandline.py +0 -0
  25. {git_project-0.0.28 → git_project-0.0.30}/src/git_project/configobj.py +0 -0
  26. {git_project-0.0.28 → git_project-0.0.30}/src/git_project/exception.py +0 -0
  27. {git_project-0.0.28 → git_project-0.0.30}/src/git_project/gitproject.py +0 -0
  28. {git_project-0.0.28 → git_project-0.0.30}/src/git_project/main.py +0 -0
  29. {git_project-0.0.28 → git_project-0.0.30}/src/git_project/parsermanager.py +0 -0
  30. {git_project-0.0.28 → git_project-0.0.30}/src/git_project/plugin.py +0 -0
  31. {git_project-0.0.28 → git_project-0.0.30}/src/git_project/pluginmanager.py +0 -0
  32. {git_project-0.0.28 → git_project-0.0.30}/src/git_project/project.py +0 -0
  33. {git_project-0.0.28 → git_project-0.0.30}/src/git_project/runnable.py +0 -0
  34. {git_project-0.0.28 → git_project-0.0.30}/src/git_project/scopedobj.py +0 -0
  35. {git_project-0.0.28 → git_project-0.0.30}/src/git_project/shell.py +0 -0
  36. {git_project-0.0.28 → git_project-0.0.30}/src/git_project/substitutable.py +0 -0
  37. {git_project-0.0.28 → git_project-0.0.30}/src/git_project/test_support/__init__.py +0 -0
  38. {git_project-0.0.28 → git_project-0.0.30}/src/git_project/test_support/common.py +0 -0
  39. {git_project-0.0.28 → git_project-0.0.30}/test.out +0 -0
  40. {git_project-0.0.28 → git_project-0.0.30}/tests/conftest.py +0 -0
  41. {git_project-0.0.28 → git_project-0.0.30}/tests/test_confobj.py +0 -0
  42. {git_project-0.0.28 → git_project-0.0.30}/tests/test_gitproject.py +0 -0
  43. {git_project-0.0.28 → git_project-0.0.30}/tests/test_main.py +0 -0
  44. {git_project-0.0.28 → git_project-0.0.30}/tests/test_project.py +0 -0
  45. {git_project-0.0.28 → git_project-0.0.30}/tests/test_runnable.py +0 -0
  46. {git_project-0.0.28 → git_project-0.0.30}/tests/test_scopedobj.py +0 -0
  47. {git_project-0.0.28 → git_project-0.0.30}/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.28
3
+ Version: 0.0.30
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.28'
21
- __version_tuple__ = version_tuple = (0, 0, 28)
20
+ __version__ = version = '0.0.30'
21
+ __version_tuple__ = version_tuple = (0, 0, 30)
@@ -58,10 +58,12 @@ class Git(object):
58
58
  self.null_oid = pygit2.Oid(hex='0000000000000000000000000000000000000000')
59
59
 
60
60
  def credentials(self, url, username_from_url, allowed_types):
61
- if allowed_types & pygit2.credentials.GIT_CREDENTIAL_SSH_KEY:
62
- return pygit2.Keypair(username_from_url, str(Path.home() / '.ssh' / 'id_rsa.pub'),
63
- str(Path.home() / '.ssh' / 'id_rsa'), '')
64
- elif allowed_types & pygit2.credentials.GIT_CREDENTIAL_USERNAME:
61
+ if allowed_types & pygit2.enums.CredentialType.SSH_KEY:
62
+ return pygit2.Keypair(
63
+ username_from_url, str(Path.home() / '.ssh' / 'id_rsa.pub'),
64
+ str(Path.home() / '.ssh' / 'id_rsa'), ''
65
+ )
66
+ elif allowed_types & pygit2.enums.CredentialType.USERNAME:
65
67
  return pygit2.Username(username_from_url)
66
68
  return None
67
69
 
@@ -373,10 +375,10 @@ class Git(object):
373
375
  class RemoteBranchDeleteCallback(pygit2.RemoteCallbacks):
374
376
  """Check the result of remove branch prune operations."""
375
377
  def credentials(self, url, username_from_url, allowed_types):
376
- if allowed_types & pygit2.credentials.GIT_CREDENTIAL_SSH_KEY:
378
+ if allowed_types & pygit2.enums.CredentialType.SSH_KEY:
377
379
  return pygit2.Keypair(username_from_url, str(Path.home() / '.ssh' / 'id_rsa.pub'),
378
380
  str(Path.home() / '.ssh' / 'id_rsa'), '')
379
- elif allowed_types & pygit2.credentials.GIT_CREDENTIAL_USERNAME:
381
+ elif allowed_types & pygit2.enums.CredentialType.USERNAME:
380
382
  return pygit2.Username(username_from_url)
381
383
  return None
382
384
 
@@ -387,10 +389,10 @@ class Git(object):
387
389
 
388
390
  class LsRemotesCallbacks(pygit2.RemoteCallbacks):
389
391
  def credentials(self, url, username_from_url, allowed_types):
390
- if allowed_types & pygit2.credentials.GIT_CREDENTIAL_SSH_KEY:
392
+ if allowed_types & pygit2.enums.CredentialType.SSH_KEY:
391
393
  return pygit2.Keypair(username_from_url, str(Path.home() / '.ssh' / 'id_rsa.pub'),
392
394
  str(Path.home() / '.ssh' / 'id_rsa'), '')
393
- elif allowed_types & pygit2.credentials.GIT_CREDENTIAL_USERNAME:
395
+ elif allowed_types & pygit2.enums.CredentialType.USERNAME:
394
396
  return pygit2.Username(username_from_url)
395
397
  return None
396
398
 
@@ -21,6 +21,7 @@ import os
21
21
  import git_project
22
22
 
23
23
  from pathlib import Path
24
+ import pygit2
24
25
  import shutil
25
26
 
26
27
  def test_git_init(reset_directory,
@@ -874,3 +875,45 @@ def test_git_get_git_common_dir_renamed(reset_directory, local_repository):
874
875
 
875
876
  assert git.has_repo()
876
877
  assert Path(git.get_git_common_dir()).name == new_hidden_dir
878
+
879
+
880
+ def test_git_remote_credentials(reset_directory):
881
+ callback = git_project.Git.RemoteCallbacks();
882
+
883
+ key_result = callback.credentials(
884
+ 'ssh:me@my.org/test.git', 'me', pygit2.enums.CredentialType.SSH_KEY
885
+ )
886
+ name_result = callback.credentials(
887
+ 'ssh:me@my.org/test.git', 'me', pygit2.enums.CredentialType.USERNAME
888
+ )
889
+
890
+ assert isinstance(key_result, pygit2.Keypair)
891
+ assert isinstance(name_result, pygit2.Username)
892
+
893
+
894
+ def test_git_remote_branch_delete_credentials(reset_directory):
895
+ callback = git_project.Git.RemoteBranchDeleteCallback();
896
+
897
+ key_result = callback.credentials(
898
+ 'ssh:me@my.org/test.git', 'me', pygit2.enums.CredentialType.SSH_KEY
899
+ )
900
+ name_result = callback.credentials(
901
+ 'ssh:me@my.org/test.git', 'me', pygit2.enums.CredentialType.USERNAME
902
+ )
903
+
904
+ assert isinstance(key_result, pygit2.Keypair)
905
+ assert isinstance(name_result, pygit2.Username)
906
+
907
+
908
+ def test_git_ls_remotes_credentials(reset_directory):
909
+ callback = git_project.Git.LsRemotesCallbacks();
910
+
911
+ key_result = callback.credentials(
912
+ 'ssh:me@my.org/test.git', 'me', pygit2.enums.CredentialType.SSH_KEY
913
+ )
914
+ name_result = callback.credentials(
915
+ 'ssh:me@my.org/test.git', 'me', pygit2.enums.CredentialType.USERNAME
916
+ )
917
+
918
+ assert isinstance(key_result, pygit2.Keypair)
919
+ assert isinstance(name_result, pygit2.Username)
@@ -1 +0,0 @@
1
- dag@basie.2617:1746908671
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