|
7 | 7 | from dataclasses import dataclass
|
8 | 8 | from pathlib import Path
|
9 | 9 | from tempfile import NamedTemporaryFile
|
10 |
| -from typing import TYPE_CHECKING, List, MutableMapping, Optional, Type, Union |
| 10 | +from typing import TYPE_CHECKING, ClassVar, List, MutableMapping, Optional, Type, Union |
11 | 11 |
|
12 | 12 | if TYPE_CHECKING: # pragma: no-coverage
|
13 | 13 | from bumpversion.config import Config
|
@@ -44,9 +44,9 @@ def __repr__(self):
|
44 | 44 | class SourceCodeManager:
|
45 | 45 | """Base class for version control systems."""
|
46 | 46 |
|
47 |
| - _TEST_USABLE_COMMAND: List[str] = [] |
48 |
| - _COMMIT_COMMAND: List[str] = [] |
49 |
| - _ALL_TAGS_COMMAND: List[str] = [] |
| 47 | + _TEST_USABLE_COMMAND: ClassVar[List[str]] = [] |
| 48 | + _COMMIT_COMMAND: ClassVar[List[str]] = [] |
| 49 | + _ALL_TAGS_COMMAND: ClassVar[List[str]] = [] |
50 | 50 |
|
51 | 51 | @classmethod
|
52 | 52 | def commit(cls, message: str, current_version: str, new_version: str, extra_args: Optional[list] = None) -> None:
|
@@ -201,9 +201,9 @@ def __repr__(self):
|
201 | 201 | class Git(SourceCodeManager):
|
202 | 202 | """Git implementation."""
|
203 | 203 |
|
204 |
| - _TEST_USABLE_COMMAND = ["git", "rev-parse", "--git-dir"] |
205 |
| - _COMMIT_COMMAND = ["git", "commit", "-F"] |
206 |
| - _ALL_TAGS_COMMAND = ["git", "tag", "--list"] |
| 204 | + _TEST_USABLE_COMMAND: ClassVar[List[str]] = ["git", "rev-parse", "--git-dir"] |
| 205 | + _COMMIT_COMMAND: ClassVar[List[str]] = ["git", "commit", "-F"] |
| 206 | + _ALL_TAGS_COMMAND: ClassVar[List[str]] = ["git", "tag", "--list"] |
207 | 207 |
|
208 | 208 | @classmethod
|
209 | 209 | def assert_nondirty(cls) -> None:
|
@@ -295,9 +295,9 @@ def tag(cls, name: str, sign: bool = False, message: Optional[str] = None) -> No
|
295 | 295 | class Mercurial(SourceCodeManager):
|
296 | 296 | """Mercurial implementation."""
|
297 | 297 |
|
298 |
| - _TEST_USABLE_COMMAND = ["hg", "root"] |
299 |
| - _COMMIT_COMMAND = ["hg", "commit", "--logfile"] |
300 |
| - _ALL_TAGS_COMMAND = ["hg", "log", '--rev="tag()"', '--template="{tags}\n"'] |
| 298 | + _TEST_USABLE_COMMAND: ClassVar[List[str]] = ["hg", "root"] |
| 299 | + _COMMIT_COMMAND: ClassVar[List[str]] = ["hg", "commit", "--logfile"] |
| 300 | + _ALL_TAGS_COMMAND: ClassVar[List[str]] = ["hg", "log", '--rev="tag()"', '--template="{tags}\n"'] |
301 | 301 |
|
302 | 302 | @classmethod
|
303 | 303 | def latest_tag_info(cls, tag_pattern: str) -> SCMInfo:
|
|
0 commit comments