package-dev-tools 0.8.7__tar.gz → 0.8.8__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.
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/PKG-INFO +1 -1
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/pyproject.toml +1 -1
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/utils/git.py +14 -25
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools.egg-info/PKG-INFO +1 -1
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/LICENSE +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/README.md +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/bin/pre-commit/bump-version +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/bin/pre-commit/check-version +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/setup.cfg +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/__init__.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/actions/__init__.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/actions/instantiate_new_project/__init__.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/actions/instantiate_new_project/cleanup_readme.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/actions/instantiate_new_project/cleanup_workflows.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/actions/instantiate_new_project/instantiate_new_project.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/actions/instantiate_new_project/substitute_template_name/__init__.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/actions/instantiate_new_project/substitute_template_name/project.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/actions/instantiate_new_project/substitute_template_name/substitute_template_name.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/actions/template_sync/__init__.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/actions/template_sync/git.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/actions/template_sync/merge.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/actions/template_sync/sync.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/actions/template_sync/trigger.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/cli/__init__.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/cli/check_coverage.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/cli/check_shields.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/cli/cleanup_readme.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/cli/export_pre_commit_config.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/cli/extract_info.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/cli/instantiate_new_project.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/cli/substitute_template_name.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/cli/sync_template.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/cli/trigger_template_sync.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/models/__init__.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/models/path.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/pre_commit/__init__.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/pre_commit/check_coverage.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/pre_commit/check_import.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/pre_commit/check_shields.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/pre_commit/expand_docstrings.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/pre_commit/export_config.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/py.typed +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/utils/__init__.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/utils/badge.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/utils/package.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/utils/python_versions.py +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools.egg-info/SOURCES.txt +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools.egg-info/dependency_links.txt +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools.egg-info/entry_points.txt +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools.egg-info/requires.txt +0 -0
- {package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools.egg-info/top_level.txt +0 -0
|
@@ -1,29 +1,17 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import shlex
|
|
3
3
|
import shutil
|
|
4
|
-
import subprocess
|
|
5
4
|
from collections.abc import Iterator
|
|
6
5
|
from dataclasses import dataclass, field
|
|
7
6
|
from functools import cache
|
|
8
7
|
from typing import Any
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
from cli.commands.
|
|
9
|
+
import cli
|
|
10
|
+
from cli.commands.commands import CommandItem
|
|
12
11
|
|
|
13
12
|
from package_dev_tools.models import Path
|
|
14
13
|
|
|
15
14
|
|
|
16
|
-
@cache
|
|
17
|
-
def resolve_git_binary() -> str:
|
|
18
|
-
paths = (
|
|
19
|
-
path
|
|
20
|
-
for p in os.get_exec_path()
|
|
21
|
-
if (path := shutil.which("git", path=str(p)))
|
|
22
|
-
and not path.startswith(str(Path.home()))
|
|
23
|
-
)
|
|
24
|
-
return shlex.quote(next(paths, shutil.which("git") or "git"))
|
|
25
|
-
|
|
26
|
-
|
|
27
15
|
@dataclass
|
|
28
16
|
class GitInterface:
|
|
29
17
|
path: Path = field(default_factory=Path.cwd)
|
|
@@ -48,20 +36,21 @@ class GitInterface:
|
|
|
48
36
|
return (Path(relative_path) for relative_path in output.splitlines())
|
|
49
37
|
|
|
50
38
|
def capture_output(self, *args: CommandItem, **kwargs: Any) -> str:
|
|
51
|
-
return self.create_runner(*args, **kwargs).capture_output()
|
|
52
|
-
|
|
53
|
-
def run(
|
|
54
|
-
self,
|
|
55
|
-
*args: CommandItem,
|
|
56
|
-
check: bool = True,
|
|
57
|
-
) -> subprocess.CompletedProcess[str]: # pragma: nocover
|
|
58
|
-
return self.create_runner(*args, check=check).run()
|
|
59
|
-
|
|
60
|
-
def create_runner(self, *args: CommandItem, **kwargs: Any) -> Runner[str]:
|
|
61
39
|
git_args = f"{resolve_git_binary()} {args[0]}", *args[1:]
|
|
62
|
-
return
|
|
40
|
+
return cli.capture_output(*git_args, cwd=self.path, **kwargs)
|
|
63
41
|
|
|
64
42
|
def configure(self) -> None:
|
|
65
43
|
git_configuration = {"name": self.git_name, "email": self.git_email}
|
|
66
44
|
for attribute, value in git_configuration.items():
|
|
67
45
|
self.capture_output(f"config user.{attribute} {value}")
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@cache
|
|
49
|
+
def resolve_git_binary() -> str:
|
|
50
|
+
paths = (
|
|
51
|
+
path
|
|
52
|
+
for p in os.get_exec_path()
|
|
53
|
+
if (path := shutil.which("git", path=str(p)))
|
|
54
|
+
and not path.startswith(str(Path.home()))
|
|
55
|
+
)
|
|
56
|
+
return shlex.quote(next(paths, shutil.which("git") or "git"))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/actions/__init__.py
RENAMED
|
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
|
{package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/cli/check_coverage.py
RENAMED
|
File without changes
|
{package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/cli/check_shields.py
RENAMED
|
File without changes
|
{package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/cli/cleanup_readme.py
RENAMED
|
File without changes
|
|
File without changes
|
{package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/cli/extract_info.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/cli/sync_template.py
RENAMED
|
File without changes
|
|
File without changes
|
{package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/models/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/pre_commit/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/pre_commit/check_import.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools/utils/python_versions.py
RENAMED
|
File without changes
|
{package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools.egg-info/requires.txt
RENAMED
|
File without changes
|
{package_dev_tools-0.8.7 → package_dev_tools-0.8.8}/src/package_dev_tools.egg-info/top_level.txt
RENAMED
|
File without changes
|