git-project 0.0.30__tar.gz → 0.0.31__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 (45) hide show
  1. git_project-0.0.31/.git +1 -0
  2. {git_project-0.0.30 → git_project-0.0.31}/PKG-INFO +1 -1
  3. {git_project-0.0.30 → git_project-0.0.31}/_version.py +2 -2
  4. {git_project-0.0.30 → git_project-0.0.31}/src/git_project/substitutable.py +3 -1
  5. {git_project-0.0.30 → git_project-0.0.31}/tests/test_substitutable.py +45 -0
  6. git_project-0.0.30/.git +0 -1
  7. git_project-0.0.30/test.out +0 -131
  8. {git_project-0.0.30 → git_project-0.0.31}/.gitignore +0 -0
  9. {git_project-0.0.30 → git_project-0.0.31}/CONTRIBUTORS +0 -0
  10. {git_project-0.0.30 → git_project-0.0.31}/COPYING +0 -0
  11. {git_project-0.0.30 → git_project-0.0.31}/MANIFEST.in +0 -0
  12. {git_project-0.0.30 → git_project-0.0.31}/docs/Makefile +0 -0
  13. {git_project-0.0.30 → git_project-0.0.31}/docs/authors.rst +0 -0
  14. {git_project-0.0.30 → git_project-0.0.31}/docs/changelog.rst +0 -0
  15. {git_project-0.0.30 → git_project-0.0.31}/docs/conf.py +0 -0
  16. {git_project-0.0.30 → git_project-0.0.31}/docs/index.rst +0 -0
  17. {git_project-0.0.30 → git_project-0.0.31}/docs/intro.rst +0 -0
  18. {git_project-0.0.30 → git_project-0.0.31}/docs/license.rst +0 -0
  19. {git_project-0.0.30 → git_project-0.0.31}/docs/make.bat +0 -0
  20. {git_project-0.0.30 → git_project-0.0.31}/pyproject.toml +0 -0
  21. {git_project-0.0.30 → git_project-0.0.31}/requirements.txt +0 -0
  22. {git_project-0.0.30 → git_project-0.0.31}/src/git_project/__init__.py +0 -0
  23. {git_project-0.0.30 → git_project-0.0.31}/src/git_project/commandline.py +0 -0
  24. {git_project-0.0.30 → git_project-0.0.31}/src/git_project/configobj.py +0 -0
  25. {git_project-0.0.30 → git_project-0.0.31}/src/git_project/exception.py +0 -0
  26. {git_project-0.0.30 → git_project-0.0.31}/src/git_project/git.py +0 -0
  27. {git_project-0.0.30 → git_project-0.0.31}/src/git_project/gitproject.py +0 -0
  28. {git_project-0.0.30 → git_project-0.0.31}/src/git_project/main.py +0 -0
  29. {git_project-0.0.30 → git_project-0.0.31}/src/git_project/parsermanager.py +0 -0
  30. {git_project-0.0.30 → git_project-0.0.31}/src/git_project/plugin.py +0 -0
  31. {git_project-0.0.30 → git_project-0.0.31}/src/git_project/pluginmanager.py +0 -0
  32. {git_project-0.0.30 → git_project-0.0.31}/src/git_project/project.py +0 -0
  33. {git_project-0.0.30 → git_project-0.0.31}/src/git_project/runnable.py +0 -0
  34. {git_project-0.0.30 → git_project-0.0.31}/src/git_project/scopedobj.py +0 -0
  35. {git_project-0.0.30 → git_project-0.0.31}/src/git_project/shell.py +0 -0
  36. {git_project-0.0.30 → git_project-0.0.31}/src/git_project/test_support/__init__.py +0 -0
  37. {git_project-0.0.30 → git_project-0.0.31}/src/git_project/test_support/common.py +0 -0
  38. {git_project-0.0.30 → git_project-0.0.31}/tests/conftest.py +0 -0
  39. {git_project-0.0.30 → git_project-0.0.31}/tests/test_confobj.py +0 -0
  40. {git_project-0.0.30 → git_project-0.0.31}/tests/test_git.py +0 -0
  41. {git_project-0.0.30 → git_project-0.0.31}/tests/test_gitproject.py +0 -0
  42. {git_project-0.0.30 → git_project-0.0.31}/tests/test_main.py +0 -0
  43. {git_project-0.0.30 → git_project-0.0.31}/tests/test_project.py +0 -0
  44. {git_project-0.0.30 → git_project-0.0.31}/tests/test_runnable.py +0 -0
  45. {git_project-0.0.30 → git_project-0.0.31}/tests/test_scopedobj.py +0 -0
@@ -0,0 +1 @@
1
+ gitdir: /home/dag/src/git-project/.git/worktrees/master/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: git-project
3
- Version: 0.0.30
3
+ Version: 0.0.31
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.30'
21
- __version_tuple__ = version_tuple = (0, 0, 30)
20
+ __version__ = version = '0.0.31'
21
+ __version_tuple__ = version_tuple = (0, 0, 31)
@@ -95,7 +95,9 @@ class SubstitutableConfigObject(ConfigObject):
95
95
  current_branch = git.refname_to_branch_name(head_name.read_text().strip())
96
96
  break
97
97
 
98
- formats['branch'] = current_branch
98
+ print(f'current_branch: {current_branch}')
99
+ if current_branch is not None:
100
+ formats['branch'] = current_branch
99
101
 
100
102
  # Make sure substitutions don't reference themselves, to avoid an
101
103
  # infinite loop substituting.
@@ -50,6 +50,28 @@ class MySubstitutable(git_project.SubstitutableConfigObject):
50
50
  command='cd {builddir}/{branch} && make {target}',
51
51
  description='Test command')
52
52
 
53
+ class MyNoBranchSubstitutable(git_project.SubstitutableConfigObject):
54
+ def __init__(self,
55
+ git,
56
+ project_section,
57
+ subsection,
58
+ ident,
59
+ **kwargs):
60
+ super().__init__(git,
61
+ project_section,
62
+ subsection,
63
+ ident,
64
+ **kwargs)
65
+
66
+ @classmethod
67
+ def get(cls, git, project_section, ident):
68
+ return super().get(git,
69
+ project_section,
70
+ 'mysubstitutable',
71
+ ident,
72
+ command='cd {builddir} && make {target}',
73
+ description='Test command')
74
+
53
75
  def test_substitutable_get(reset_directory, git):
54
76
  substitutable = MySubstitutable.get(git, 'project', 'test')
55
77
 
@@ -542,3 +564,26 @@ def test_substitutable_substitute_preserve_escaped_braces(reset_directory, git):
542
564
  substitutable.command)
543
565
 
544
566
  assert command == f'cd {git.get_working_copy_root()}/{{{{}}path{{}}}}/to/build/{git.get_current_branch()} && make {project.target}'
567
+
568
+
569
+ def test_substitutable_substitute_no_branch(reset_directory, git):
570
+ class MyProject(git_project.ScopedConfigObject):
571
+ def __init__(self):
572
+ super().__init__(git,
573
+ 'project',
574
+ None,
575
+ 'myproject',
576
+ builddir='{git_workdir}/path/to/build',
577
+ target='debug')
578
+
579
+ substitutable = MyNoBranchSubstitutable.get(git, 'project', 'test')
580
+
581
+ project = MyProject()
582
+
583
+ git.detach_head()
584
+
585
+ command = substitutable.substitute_value(git,
586
+ project,
587
+ substitutable.command)
588
+
589
+ assert command == f'cd {git.get_working_copy_root()}/path/to/build && make {project.target}'
git_project-0.0.30/.git DELETED
@@ -1 +0,0 @@
1
- gitdir: /home/dag/src/git-project/.git/worktrees/dev/
@@ -1,131 +0,0 @@
1
- ============================= test session starts ==============================
2
- platform linux -- Python 3.11.9, pytest-8.2.2, pluggy-1.5.0
3
- rootdir: /home/dag/src/git-project/dev
4
- configfile: pyproject.toml
5
- plugins: anyio-4.3.0, console-scripts-1.4.1
6
- collected 106 items
7
-
8
- tests/test_confobj.py ............ [ 11%]
9
- tests/test_git.py .......................FF............................ [ 61%]
10
- tests/test_gitproject.py .. [ 63%]
11
- tests/test_main.py . [ 64%]
12
- tests/test_project.py ........... [ 74%]
13
- tests/test_runnable.py ........ [ 82%]
14
- tests/test_scopedobj.py ..... [ 86%]
15
- tests/test_substitutable.py .............. [100%]
16
-
17
- =================================== FAILURES ===================================
18
- ________________________________ test_git_clone ________________________________
19
-
20
- reset_directory = None
21
- remote_repository = pygit2.Repository('/tmp/pytest-of-dag/pytest-14/local_remote_test_git_clone.git0/')
22
- tmp_path_factory = TempPathFactory(_given_basetemp=None, _trace=<pluggy._tracing.TagTracerSub object at 0x7ff199ba1e50>, _basetemp=PosixPath('/tmp/pytest-of-dag/pytest-14'), _retention_count=3, _retention_policy='all')
23
-
24
- def test_git_clone(reset_directory, remote_repository, tmp_path_factory):
25
- path = tmp_path_factory.mktemp('clone-workdir')
26
-
27
- os.chdir(path)
28
-
29
- git = git_project.Git()
30
-
31
- remote_url = 'file://' + remote_repository.path
32
-
33
- > clone_path = git.clone(remote_url)
34
-
35
- /home/dag/src/git-project/dev/tests/test_git.py:441:
36
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
37
- /home/dag/src/git-project/dev/src/git_project/git.py:744: in clone
38
- self._repo = pygit2.clone_repository(url, target_path, bare, callbacks=callbacks)
39
- /home/dag/.virtualenvs/dev/lib/python3.11/site-packages/pygit2/__init__.py:217: in clone_repository
40
- payload.check_error(err)
41
- /home/dag/.virtualenvs/dev/lib/python3.11/site-packages/pygit2/callbacks.py:93: in check_error
42
- raise self._stored_exception
43
- /home/dag/.virtualenvs/dev/lib/python3.11/site-packages/pygit2/callbacks.py:424: in wrapper
44
- return f(*args)
45
- /home/dag/.virtualenvs/dev/lib/python3.11/site-packages/pygit2/callbacks.py:552: in _transfer_progress_cb
46
- transfer_progress(TransferProgress(stats_ptr))
47
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
48
-
49
- self = <git_project.git.Git.RemoteCallbacks object at 0x7ff199a06950>
50
- stats = <pygit2.remotes.TransferProgress object at 0x7ff199a9f790>
51
-
52
- def transfer_progress(self, stats):
53
- if not self.started_transfer:
54
- self.started_transfer = True
55
- print(f'Receiving objects ({stats.total_objects})...')
56
- > self.progress.start(max_value=stats.total_objects)
57
- E TypeError: ProgressBar.start() got an unexpected keyword argument 'max_value'
58
-
59
- /home/dag/src/git-project/dev/src/git_project/git.py:77: TypeError
60
- ----------------------------- Captured stdout call -----------------------------
61
- Remote: Counting objects 1
62
- Remote: Counting objects 9
63
- Remote: Counting objects 14
64
- Remote: Counting objects 14
65
-
66
- Remote: Compressing objects: 0% (0/14)
67
- Remote: Compressing objects: 100% (14/14), done
68
-
69
- Receiving objects (14)...
70
- ___________________________ test_git_clone_with_path ___________________________
71
-
72
- reset_directory = None
73
- remote_repository = pygit2.Repository('/tmp/pytest-of-dag/pytest-14/local_remote_test_git_clone_with_path.git0/')
74
- tmp_path_factory = TempPathFactory(_given_basetemp=None, _trace=<pluggy._tracing.TagTracerSub object at 0x7ff199ba1e50>, _basetemp=PosixPath('/tmp/pytest-of-dag/pytest-14'), _retention_count=3, _retention_policy='all')
75
-
76
- def test_git_clone_with_path(reset_directory,
77
- remote_repository,
78
- tmp_path_factory):
79
- path = tmp_path_factory.mktemp('clone-workdir')
80
- os.chdir(path)
81
-
82
- git = git_project.Git()
83
-
84
- remote_url = 'file://' + remote_repository.path
85
-
86
- path = Path.cwd() / 'foo' / 'bar'
87
-
88
- os.makedirs(path)
89
-
90
- path = path / 'test-clone'
91
-
92
- > clone_path = git.clone(remote_url, path)
93
-
94
- /home/dag/src/git-project/dev/tests/test_git.py:482:
95
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
96
- /home/dag/src/git-project/dev/src/git_project/git.py:744: in clone
97
- self._repo = pygit2.clone_repository(url, target_path, bare, callbacks=callbacks)
98
- /home/dag/.virtualenvs/dev/lib/python3.11/site-packages/pygit2/__init__.py:217: in clone_repository
99
- payload.check_error(err)
100
- /home/dag/.virtualenvs/dev/lib/python3.11/site-packages/pygit2/callbacks.py:93: in check_error
101
- raise self._stored_exception
102
- /home/dag/.virtualenvs/dev/lib/python3.11/site-packages/pygit2/callbacks.py:424: in wrapper
103
- return f(*args)
104
- /home/dag/.virtualenvs/dev/lib/python3.11/site-packages/pygit2/callbacks.py:552: in _transfer_progress_cb
105
- transfer_progress(TransferProgress(stats_ptr))
106
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
107
-
108
- self = <git_project.git.Git.RemoteCallbacks object at 0x7ff198a8e350>
109
- stats = <pygit2.remotes.TransferProgress object at 0x7ff198a8eb10>
110
-
111
- def transfer_progress(self, stats):
112
- if not self.started_transfer:
113
- self.started_transfer = True
114
- print(f'Receiving objects ({stats.total_objects})...')
115
- > self.progress.start(max_value=stats.total_objects)
116
- E TypeError: ProgressBar.start() got an unexpected keyword argument 'max_value'
117
-
118
- /home/dag/src/git-project/dev/src/git_project/git.py:77: TypeError
119
- ----------------------------- Captured stdout call -----------------------------
120
- Remote: Counting objects 1
121
- Remote: Counting objects 14
122
- Remote: Counting objects 14
123
-
124
- Remote: Compressing objects: 0% (0/14)
125
- Remote: Compressing objects: 100% (14/14), done
126
-
127
- Receiving objects (14)...
128
- =========================== short test summary info ============================
129
- FAILED tests/test_git.py::test_git_clone - TypeError: ProgressBar.start() got...
130
- FAILED tests/test_git.py::test_git_clone_with_path - TypeError: ProgressBar.s...
131
- ======================== 2 failed, 104 passed in 2.74s =========================
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes