Skip to content

Commit 7a99e5e

Browse files
authored
refactor!: Move run() and core functions to utils (#343)
This is not to be considered a stable API in the near future - though we're open to it after they're stable and battle-tested.
2 parents 01643ce + 85dba41 commit 7a99e5e

File tree

17 files changed

+26
-20
lines changed

17 files changed

+26
-20
lines changed

CHANGES

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ $ pip install --user --upgrade --pre libvcs
1313

1414
- _Add your latest changes from PRs here_
1515

16+
### Breaking changes
17+
18+
- {issue}`343`: `libvcs.cmd.core` (including {func}`~libvcs.utils.run.run`) have been moved to
19+
`libvcs.utils.run`. It will be supported as an unstable, internal API.
20+
1621
### Internals
1722

1823
- `StrOrPath` -> `StrPath`

docs/cmd/core.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/cmd/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@ versions.
1919
git
2020
hg
2121
svn
22-
core
2322
```

docs/internals/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ exc
1414
types
1515
dataclasses
1616
query_list
17+
run
1718
subprocess
1819
```

docs/internals/run.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# `libvcs.utils.run`
2+
3+
```{eval-rst}
4+
.. autoapimodule:: libvcs.utils.run
5+
:members:
6+
:show-inheritance:
7+
:undoc-members:
8+
:exclude-members: StrOrBytesPath, StrPath, logger
9+
```

libvcs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Project package for libvcs."""
22
import logging
33

4-
from .cmd.core import CmdLoggingAdapter
4+
from .utils.run import CmdLoggingAdapter
55
from .projects.base import BaseProject
66
from .projects.git import GitProject
77
from .projects.hg import MercurialProject

libvcs/cmd/git.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import Any, Literal, Optional, Sequence, Union
44

55
from ..types import StrOrBytesPath, StrPath
6-
from .core import run
6+
from libvcs.utils.run import run
77

88
_CMD = Union[StrOrBytesPath, Sequence[StrOrBytesPath]]
99

libvcs/cmd/hg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import Optional, Sequence, Union
44

55
from ..types import StrOrBytesPath, StrPath
6-
from .core import run
6+
from libvcs.utils.run import run
77

88
_CMD = Union[StrOrBytesPath, Sequence[StrOrBytesPath]]
99

libvcs/cmd/svn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from typing import Literal, Optional, Sequence, Union
33

44
from ..types import StrOrBytesPath, StrPath
5-
from .core import run
5+
from libvcs.utils.run import run
66

77
_CMD = Union[StrOrBytesPath, Sequence[StrOrBytesPath]]
88

libvcs/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from faker import Faker
1212

13-
from libvcs.cmd.core import run, which
13+
from libvcs.utils.run import run, which
1414
from libvcs.projects.git import GitProject, GitRemoteDict
1515

1616
skip_if_git_missing = pytest.mark.skipif(

0 commit comments

Comments
 (0)