git-project-core-plugins 0.0.22__tar.gz → 0.0.24__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 (59) hide show
  1. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/PKG-INFO +4 -4
  2. git_project_core_plugins-0.0.24/_version.py +24 -0
  3. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/pyproject.toml +2 -2
  4. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/requirements.txt +2 -2
  5. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/src/git_project_core_plugins/artifact.py +19 -4
  6. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/src/git_project_core_plugins/run.py +49 -12
  7. git_project_core_plugins-0.0.24/test.out +8 -0
  8. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/tests/test_artifact.py +7 -7
  9. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/tests/test_run.py +23 -0
  10. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/tests/test_worktree.py +102 -4
  11. git_project_core_plugins-0.0.22/.git +0 -1
  12. git_project_core_plugins-0.0.22/_version.py +0 -16
  13. git_project_core_plugins-0.0.22/test.out +0 -38
  14. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/COPYING +0 -0
  15. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/MANIFEST.in +0 -0
  16. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/build/lib/git_project_core_plugins/__init__.py +0 -0
  17. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/build/lib/git_project_core_plugins/artifact.py +0 -0
  18. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/build/lib/git_project_core_plugins/branch.py +0 -0
  19. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/build/lib/git_project_core_plugins/clone.py +0 -0
  20. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/build/lib/git_project_core_plugins/common.py +0 -0
  21. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/build/lib/git_project_core_plugins/config.py +0 -0
  22. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/build/lib/git_project_core_plugins/help.py +0 -0
  23. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/build/lib/git_project_core_plugins/init.py +0 -0
  24. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/build/lib/git_project_core_plugins/run.py +0 -0
  25. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/build/lib/git_project_core_plugins/worktree.py +0 -0
  26. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/docs/Makefile +0 -0
  27. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/docs/README-template.rst +0 -0
  28. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/docs/authors.rst +0 -0
  29. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/docs/changelog.rst +0 -0
  30. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/docs/conf.py +0 -0
  31. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/docs/index.rst +0 -0
  32. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/docs/intro.rst +0 -0
  33. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/docs/license.rst +0 -0
  34. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/docs/make.bat +0 -0
  35. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/gen-readme.py +0 -0
  36. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/gen-readme.py~ +0 -0
  37. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/git_project_core_plugins.egg-info/PKG-INFO +0 -0
  38. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/git_project_core_plugins.egg-info/SOURCES.txt +0 -0
  39. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/git_project_core_plugins.egg-info/dependency_links.txt +0 -0
  40. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/git_project_core_plugins.egg-info/entry_points.txt +0 -0
  41. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/git_project_core_plugins.egg-info/not-zip-safe +0 -0
  42. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/git_project_core_plugins.egg-info/requires.txt +0 -0
  43. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/git_project_core_plugins.egg-info/top_level.txt +0 -0
  44. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/src/git_project_core_plugins/__init__.py +0 -0
  45. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/src/git_project_core_plugins/branch.py +0 -0
  46. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/src/git_project_core_plugins/clone.py +0 -0
  47. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/src/git_project_core_plugins/common.py +0 -0
  48. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/src/git_project_core_plugins/config.py +0 -0
  49. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/src/git_project_core_plugins/help.py +0 -0
  50. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/src/git_project_core_plugins/init.py +0 -0
  51. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/src/git_project_core_plugins/worktree.py +0 -0
  52. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/src/git_project_core_plugins/worktree.py~ +0 -0
  53. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/tests/common.py +0 -0
  54. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/tests/conftest.py +0 -0
  55. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/tests/test_branch.py +0 -0
  56. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/tests/test_clone.py +0 -0
  57. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/tests/test_config.py +0 -0
  58. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/tests/test_help.py +0 -0
  59. {git_project_core_plugins-0.0.22 → git_project_core_plugins-0.0.24}/tests/test_init.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: git-project-core-plugins
3
- Version: 0.0.22
3
+ Version: 0.0.24
4
4
  Summary: The extensible stupid project manager - core functionality
5
5
  Author-email: "David A. Greene" <dag@obbligato.org>
6
6
  License-Expression: AGPL-3.0-or-later
@@ -12,9 +12,9 @@ Classifier: Intended Audience :: Developers
12
12
  Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
13
13
  Classifier: Programming Language :: Python :: 3.9
14
14
  Classifier: Topic :: Software Development :: Version Control :: Git
15
- Requires-Python: >=3
16
- Requires-Dist: git-project>=0.0.27
17
- Requires-Dist: progressbar
15
+ Requires-Python: >=3.9
16
+ Requires-Dist: git-project>=0.0.30
17
+ Requires-Dist: pytest-console-scripts
18
18
  Provides-Extra: test
19
19
  Requires-Dist: git-project; extra == 'test'
20
20
  Requires-Dist: pytest; extra == 'test'
@@ -0,0 +1,24 @@
1
+ # file generated by vcs-versioning
2
+ # don't change, don't track in version control
3
+ from __future__ import annotations
4
+
5
+ __all__ = [
6
+ "__version__",
7
+ "__version_tuple__",
8
+ "version",
9
+ "version_tuple",
10
+ "__commit_id__",
11
+ "commit_id",
12
+ ]
13
+
14
+ version: str
15
+ __version__: str
16
+ __version_tuple__: tuple[int | str, ...]
17
+ version_tuple: tuple[int | str, ...]
18
+ commit_id: str | None
19
+ __commit_id__: str | None
20
+
21
+ __version__ = version = '0.0.24'
22
+ __version_tuple__ = version_tuple = (0, 0, 24)
23
+
24
+ __commit_id__ = commit_id = None
@@ -31,7 +31,7 @@ name = "git-project-core-plugins"
31
31
  dynamic = ["dependencies", "readme", "version"]
32
32
  description = "The extensible stupid project manager - core functionality"
33
33
  license = "AGPL-3.0-or-later"
34
- requires-python = ">=3"
34
+ requires-python = ">=3.9"
35
35
  authors = [
36
36
  { name = "David A. Greene", email = "dag@obbligato.org" },
37
37
  ]
@@ -95,7 +95,7 @@ cov = [
95
95
  ]
96
96
 
97
97
  [[tool.hatch.envs.all.matrix]]
98
- python = ["3.7", "3.8", "3.9", "3.10", "3.11"]
98
+ python = ["3.9", "3.10", "3.11"]
99
99
 
100
100
  [tool.hatch.envs.lint]
101
101
  detached = true
@@ -18,5 +18,5 @@
18
18
  # You should have received a copy of the GNU Affero General Public License along
19
19
  # with git-project. If not, see <https://www.gnu.org/licenses/>.
20
20
 
21
- git-project >= 0.0.27
22
- progressbar
21
+ git-project >= 0.0.30
22
+ pytest-console-scripts
@@ -125,13 +125,28 @@ class Artifact(SubstitutableConfigObject):
125
125
  def get_managing_command(cls):
126
126
  return 'artifact'
127
127
 
128
+ def rm(self, git, project, clargs, string):
129
+ """Remove the paths associated with this Artifact.
130
+
131
+ git: An object to query the repository and make config changes.
132
+
133
+ project: The currently active Project.
134
+
135
+ clargs: Command-line arguments
136
+
137
+ string: The string on which to perform substitution.
138
+
139
+ """
140
+ for path in self.iter_multival('itempath'):
141
+ path = self.substitute_value(git, poject, clargs, path)
142
+
128
143
  def command_artifact_add(git, gitproject, project, clargs):
129
144
  """Implement git-project artifact add."""
130
145
  ident = clargs.subsection
131
146
  path = clargs.path
132
147
 
133
148
  artifact = Artifact.get(git, project.get_section(), ident)
134
- artifact.add_item('path', path)
149
+ artifact.add_item('itempath', path)
135
150
 
136
151
  def command_artifact_rm(git, gitproject, project, clargs):
137
152
  """Implement git-project artifact rm."""
@@ -141,9 +156,9 @@ def command_artifact_rm(git, gitproject, project, clargs):
141
156
 
142
157
  if hasattr(clargs, 'path') and clargs.path:
143
158
  path = clargs.path
144
- artifact.rm_item('path', path)
159
+ artifact.rm_item('itempath', path)
145
160
  else:
146
- artifact.rm_items('path')
161
+ artifact.rm_items('itempath')
147
162
 
148
163
  class ArtifactPlugin(Plugin):
149
164
  """
@@ -313,7 +328,7 @@ the final git config section that will hold the artifact path.
313
328
  self._subsection)
314
329
 
315
330
  if artifact:
316
- for path in artifact.iter_multival('path'):
331
+ for path in artifact.iter_multival('itempath'):
317
332
  fullpath = artifact.substitute_value(self._git, project, path)
318
333
  run_command_with_shell(f'rm -rf {fullpath}',
319
334
  show_command=True)
@@ -90,8 +90,7 @@ class RunConfig(ConfigObject):
90
90
  **kwargs)
91
91
 
92
92
  class RunPlugin(Plugin):
93
- """
94
- The run command executes commands via a shell.
93
+ """The run command executes commands via a shell.
95
94
 
96
95
  Summary:
97
96
 
@@ -108,7 +107,7 @@ class RunPlugin(Plugin):
108
107
  example:
109
108
 
110
109
  git <project> run --make-alias build
111
- git <project> add build all "make -C {path} all"
110
+ git <project> add build all "make -C {git_workdir} all"
112
111
  git <project> build all
113
112
 
114
113
  Note that an alias will prevent ``run'' from invoking the command so in the
@@ -125,15 +124,15 @@ class RunPlugin(Plugin):
125
124
  In general any project config {key} will be replaced with its value before
126
125
  the command is executed. Substitution occurs recursively, so if a {key}
127
126
  value itself contains a substitution string, it will be replaced as well.
128
- There are a few special case substitutions. The {path} key will be replaced
129
- by the absolute path to the root of the current workarea. The {branch} key
130
- will be replaced by the currently-active branch nme. In addition the {run}
131
- (or {build}, etc. aliases) will be replaced by their names. Again, an
132
- example will make this more clear:
127
+ There are a few special case substitutions. The {git_workdir} key will be
128
+ replaced by the absolute path to the root of the current workarea. The
129
+ {branch} key will be replaced by the currently-active branch nme. In
130
+ addition the {run} (or {build}, etc. aliases) will be replaced by their
131
+ names. Again, an example will make this more clear:
133
132
 
134
- git <project> config cmd "make -C {path} BLDDIR=/path/to/{build} {build}"
135
- git project add build all "{cmd}"
136
- git project add build some "{cmd}"
133
+ git <project> config cmd "make -C {git_workdir} BLDDIR=/path/to/{build}
134
+ {build}" git project add build all "{cmd}" git project add build some
135
+ "{cmd}"
137
136
 
138
137
  We have configured two different build flavors, each which place build
139
138
  results in separate directories and invoke different targets. Substitution
@@ -142,6 +141,41 @@ class RunPlugin(Plugin):
142
141
  git project build all -> make -C /cur/workarea BLDDIR=/path/to/all all
143
142
  git project build some -> make -C /cur/workarea BLDDIR=/path/to/some some
144
143
 
144
+ Extra options passed to the run command may be referenced in the command
145
+ string:
146
+
147
+ git project add build extra "echo {options}"
148
+ git project build extra hello world! -> echo hello world!
149
+
150
+ Individual options may also be referenced:
151
+
152
+ git project add build extra "echo {options_1} {options_0}"
153
+ git project build extra hello world! -> echo world! hello
154
+
155
+ A special dash-separated "key" string composed of option values may be
156
+ generated:
157
+
158
+ git project add build any "make {option_key}"
159
+ git project build any target debug -> make target-debug
160
+
161
+ A special {option_keysep} substitution will result in a - if there are
162
+ options and the empty string otherwisa:
163
+
164
+ git project add build build any "make my{option_keysep}{option_key}"
165
+ git project build any target debug -> make my-target-debug
166
+ git project build any -> make my
167
+
168
+ Other substitutions may be used in options:
169
+
170
+ git project add build branch "make {options}"
171
+ git project build branch {branch} -> make dev # On the dev branch
172
+
173
+ A special substitution {option_names} is a space-separated list of option
174
+ values with no additional substitutions:
175
+
176
+ git project add build branch "make {option_names} {options}"
177
+ git project build branch {branch} -> make branch dev # On the dev branch
178
+
145
179
  Some plugins may add scoping rules to the project config, such that a scope
146
180
  nested inside the project may override the global project config key value.
147
181
  For example the worktree plugin adds a ``worktree'' scope. The worktree may
@@ -358,7 +392,10 @@ class RunPlugin(Plugin):
358
392
  'option_keysep': '-' if len(clargs.options) > 0 else ''
359
393
  }
360
394
 
361
- run.run(git, project, formats)
395
+ for i, option in enumerate(clargs.options):
396
+ formats[f'options_{i}'] = option
397
+
398
+ return run.run(git, project, formats)
362
399
 
363
400
  run_parser.set_defaults(func=command_run)
364
401
 
@@ -0,0 +1,8 @@
1
+ ============================= test session starts ==============================
2
+ platform darwin -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0
3
+ rootdir: /Users/dag/projects/git-project-core-plugins/master
4
+ configfile: pyproject.toml
5
+ plugins: console-scripts-1.4.1
6
+ collected 17 items
7
+
8
+ tests/test_worktree.py ...............
@@ -95,10 +95,10 @@ def test_artifact_get(reset_directory,
95
95
  artifact = Artifact.get(git,
96
96
  project.get_section(),
97
97
  'worktree',
98
- path='{builddir}')
98
+ itempath='{builddir}')
99
99
 
100
100
  assert artifact._section == 'project.artifact.worktree'
101
- assert artifact.path == '{builddir}'
101
+ assert artifact.itempath == '{builddir}'
102
102
 
103
103
  def test_artifact_add(git_project_runner,
104
104
  git):
@@ -114,7 +114,7 @@ def test_artifact_add(git_project_runner,
114
114
  '{builddir}')
115
115
 
116
116
  check_config_file('project.artifact.worktree',
117
- 'path',
117
+ 'itempath',
118
118
  {'{builddir}'})
119
119
 
120
120
  def test_artifact_rm_item(git_project_runner,
@@ -138,7 +138,7 @@ def test_artifact_rm_item(git_project_runner,
138
138
  '{installdir}')
139
139
 
140
140
  check_config_file('project.artifact.worktree',
141
- 'path',
141
+ 'itempath',
142
142
  {'{builddir}', '{installdir}'})
143
143
 
144
144
  git_project_runner.run('.*',
@@ -149,7 +149,7 @@ def test_artifact_rm_item(git_project_runner,
149
149
  '\\\\{builddir\\\\}')
150
150
 
151
151
  check_config_file('project.artifact.worktree',
152
- 'path',
152
+ 'itempath',
153
153
  {'{installdir}'})
154
154
 
155
155
  def test_artifact_rm_items(git_project_runner,
@@ -174,7 +174,7 @@ def test_artifact_rm_items(git_project_runner,
174
174
  '{installdir}')
175
175
 
176
176
  check_config_file('project.artifact.worktree',
177
- 'path',
177
+ 'itempath',
178
178
  {'{builddir}', '{installdir}'})
179
179
 
180
180
  git_project_runner.run('.*',
@@ -184,7 +184,7 @@ def test_artifact_rm_items(git_project_runner,
184
184
  'worktree')
185
185
 
186
186
  check_config_file('project.artifact.worktree',
187
- 'path',
187
+ 'itempath',
188
188
  {'{builddir}, ''{installdir}'},
189
189
  section_present = False)
190
190
 
@@ -383,3 +383,26 @@ def test_run_substitute_empty_option_name_key(git_project_runner,
383
383
  '.*',
384
384
  'run',
385
385
  'test')
386
+
387
+ def test_run_substitute_option_positions(git_project_runner,
388
+ git,
389
+ capsys):
390
+ workdir = git.get_working_copy_root()
391
+
392
+ git_project_runner.chdir(workdir)
393
+
394
+ # Add a run.
395
+ git_project_runner.run('.*',
396
+ '',
397
+ 'add',
398
+ 'run',
399
+ 'test',
400
+ '{git_workdir}/buildit {options_1} {run} {options_0}')
401
+
402
+ # Check run invocation.
403
+ git_project_runner.run(re.escape(f'{workdir}/buildit foo test master'),
404
+ '.*',
405
+ 'run',
406
+ 'test',
407
+ '{branch}',
408
+ 'foo')
@@ -456,6 +456,7 @@ def test_worktree_add(git,
456
456
  assert os.path.exists(workarea.parent / 'test')
457
457
  assert git.branch_name_to_refname('test') == 'refs/heads/test'
458
458
 
459
+
459
460
  def test_worktree_add_subdir(git,
460
461
  git_project_runner,
461
462
  tmp_path_factory):
@@ -472,10 +473,107 @@ def test_worktree_add_subdir(git,
472
473
  '',
473
474
  'worktree',
474
475
  'add',
475
- '../user/test',
476
+ '../user/test2',
477
+ 'master')
478
+
479
+ assert os.path.exists(workarea.parent / 'user' / 'test2')
480
+ os.chdir(workarea.parent / 'user' / 'test2')
481
+ git = git_project.Git() # Reinitialize in new workarea.
482
+ assert git.get_current_branch() == 'user/test2'
483
+
484
+
485
+ def test_worktree_rm(git, git_project_runner, tmp_path_factory):
486
+ workarea = git.get_working_copy_root()
487
+
488
+ os.chdir(workarea)
489
+
490
+ git = git_project.Git() # Reinitialize in new workarea.
491
+
492
+ assert os.path.exists(workarea / '.git')
493
+ assert os.path.exists(workarea / 'MergedRemote.txt')
494
+
495
+ git_project_runner.chdir(workarea)
496
+
497
+ git_project_runner.run('.*',
498
+ '',
499
+ 'worktree',
500
+ 'add',
501
+ '../user/test_rm',
502
+ 'master')
503
+
504
+ assert os.path.exists(workarea.parent / 'user' / 'test_rm')
505
+ os.chdir(workarea.parent / 'user' / 'test_rm')
506
+ git = git_project.Git() # Reinitialize in new workarea.
507
+ assert git.get_current_branch() == 'user/test_rm'
508
+
509
+ assert os.path.exists(workarea.parent / 'user' / 'test_rm')
510
+
511
+ os.chdir(workarea)
512
+ git_project_runner.chdir(workarea)
513
+
514
+ git_project_runner.run('.*',
515
+ '',
516
+ 'worktree',
517
+ 'rm',
518
+ 'test_rm')
519
+
520
+ assert not os.path.exists(workarea.parent / 'user' / 'test_rm')
521
+
522
+
523
+ def test_worktree_add_in_workarea(git,
524
+ git_project_runner,
525
+ tmp_path_factory):
526
+ workarea = git.get_working_copy_root()
527
+
528
+ os.chdir(workarea)
529
+
530
+ assert os.path.exists(workarea / '.git')
531
+ assert os.path.exists(workarea / 'MergedRemote.txt')
532
+
533
+ git_project_runner.chdir(workarea)
534
+
535
+ git_project_runner.run('.*',
536
+ '',
537
+ 'worktree',
538
+ 'add',
539
+ 'test_workarea',
476
540
  'master')
477
541
 
478
- assert os.path.exists(workarea.parent / 'user' / 'test')
479
- os.chdir(workarea.parent / 'user' / 'test')
542
+ assert os.path.exists(workarea / 'test_workarea')
543
+ os.chdir(workarea / 'test_workarea')
480
544
  git = git_project.Git() # Reinitialize in new workarea.
481
- assert git.get_current_branch() == 'user/test'
545
+ assert git.get_current_branch() == 'test_workarea'
546
+
547
+
548
+ def test_worktree_rm_in_workarea(git, git_project_runner, tmp_path_factory):
549
+ workarea = git.get_working_copy_root()
550
+
551
+ os.chdir(workarea)
552
+
553
+ assert os.path.exists(workarea / '.git')
554
+ assert os.path.exists(workarea / 'MergedRemote.txt')
555
+
556
+ git_project_runner.chdir(workarea)
557
+
558
+ git_project_runner.run('.*',
559
+ '',
560
+ 'worktree',
561
+ 'add',
562
+ 'test_rm_workarea',
563
+ 'master')
564
+
565
+ assert os.path.exists(workarea / 'test_rm_workarea')
566
+ os.chdir(workarea / 'test_rm_workarea')
567
+ git = git_project.Git() # Reinitialize in new workarea.
568
+ assert git.get_current_branch() == 'test_rm_workarea'
569
+
570
+ os.chdir(workarea)
571
+ git_project_runner.chdir(workarea)
572
+
573
+ git_project_runner.run('.*',
574
+ '',
575
+ 'worktree',
576
+ 'rm',
577
+ 'test_rm_workarea')
578
+
579
+ assert not os.path.exists(workarea / 'test_rm_workarea')
@@ -1 +0,0 @@
1
- gitdir: /Users/dag/projects/git-project-core-plugins/.git/worktrees/master/
@@ -1,16 +0,0 @@
1
- # file generated by setuptools_scm
2
- # don't change, don't track in version control
3
- TYPE_CHECKING = False
4
- if TYPE_CHECKING:
5
- from typing import Tuple, Union
6
- VERSION_TUPLE = Tuple[Union[int, str], ...]
7
- else:
8
- VERSION_TUPLE = object
9
-
10
- version: str
11
- __version__: str
12
- __version_tuple__: VERSION_TUPLE
13
- version_tuple: VERSION_TUPLE
14
-
15
- __version__ = version = '0.0.22'
16
- __version_tuple__ = version_tuple = (0, 0, 22)
@@ -1,38 +0,0 @@
1
- ============================= test session starts ==============================
2
- platform darwin -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0
3
- rootdir: /Users/dag/projects/git-project-core-plugins/master
4
- configfile: pyproject.toml
5
- plugins: console-scripts-1.4.1
6
- collected 56 items
7
-
8
- tests/test_artifact.py ....... [ 12%]
9
- tests/test_branch.py .... [ 19%]
10
- tests/test_clone.py .... [ 26%]
11
- tests/test_config.py .... [ 33%]
12
- tests/test_help.py ... [ 39%]
13
- tests/test_init.py . [ 41%]
14
- tests/test_run.py ................ [ 69%]
15
- tests/test_worktree.py ................. [100%]
16
-
17
- =============================== warnings summary ===============================
18
- tests/test_artifact.py: 9 warnings
19
- tests/test_config.py: 7 warnings
20
- tests/test_help.py: 8 warnings
21
- tests/test_run.py: 33 warnings
22
- tests/test_worktree.py: 11 warnings
23
- /Users/dag/projects/git-project/master/src/git_project/test_support/common.py:453: DeprecationWarning: script_runner commands should be passed as a single sequence, not as multiple arguments.
24
- Replace `script_runner.run(a, b, c)` calls with `script_runner.run([a, b, c])`
25
- result = self.runner.run(self.command, *args, cwd=self.directory, **kwargs)
26
-
27
- tests/test_branch.py::test_branch_status[inprocess]
28
- /Users/dag/projects/git-project-core-plugins/master/tests/test_branch.py:118: DeprecationWarning: script_runner commands should be passed as a single sequence, not as multiple arguments.
29
- Replace `script_runner.run(a, b, c)` calls with `script_runner.run([a, b, c])`
30
- ret = script_runner.run('git-project', 'branch', 'status', '--all')
31
-
32
- tests/test_branch.py::test_branch_prune_script[inprocess]
33
- /Users/dag/projects/git-project-core-plugins/master/tests/test_branch.py:178: DeprecationWarning: script_runner commands should be passed as a single sequence, not as multiple arguments.
34
- Replace `script_runner.run(a, b, c)` calls with `script_runner.run([a, b, c])`
35
- ret = script_runner.run('git-project',
36
-
37
- -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
38
- ======================= 56 passed, 70 warnings in 18.20s =======================