Skip to content

Commit 95007f2

Browse files
committed
refactor!: Move libvcs.util -> libvcs.cmd.core
1 parent 04e247d commit 95007f2

File tree

10 files changed

+11
-11
lines changed

10 files changed

+11
-11
lines changed

docs/states/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ See examples below of git, mercurial, and subversion.
4545
## Utility stuff
4646

4747
```{eval-rst}
48-
.. automodule:: libvcs.util
48+
.. automodule:: libvcs.cmd.core
4949
:members:
5050
```

libvcs/__init__.py

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

4+
from .cmd.core import CmdLoggingAdapter
45
from .states.base import BaseRepo
56
from .states.git import GitRepo
67
from .states.hg import MercurialRepo
78
from .states.svn import SubversionRepo
8-
from .util import CmdLoggingAdapter
99

1010
__all__ = [
1111
"GitRepo",

libvcs/util.py renamed to libvcs/cmd/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import sys
88
from typing import Callable, Optional, Union
99

10-
from . import exc
11-
from .types import StrOrBytesPath
10+
from .. import exc
11+
from ..types import StrOrBytesPath
1212

1313
logger = logging.getLogger(__name__)
1414

libvcs/conftest.py

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

1111
from faker import Faker
1212

13+
from libvcs.cmd.core import run, which
1314
from libvcs.states.git import GitRemoteDict, GitRepo
14-
from libvcs.util import run, which
1515

1616
skip_if_git_missing = pytest.mark.skipif(
1717
not which("git"), reason="git is not available"

libvcs/states/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
from typing import NamedTuple
55
from urllib import parse as urlparse
66

7+
from libvcs.cmd.core import CmdLoggingAdapter, mkdir_p, run
78
from libvcs.types import StrOrPath
8-
from libvcs.util import CmdLoggingAdapter, mkdir_p, run
99

1010
logger = logging.getLogger(__name__)
1111

tests/cmd/test_core.py

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

33
import pytest
44

5-
from libvcs.util import mkdir_p, which
5+
from libvcs.cmd.core import mkdir_p, which
66

77

88
def test_mkdir_p(tmp_path: pathlib.Path):

tests/states/test_conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import pytest
44

5+
from libvcs.cmd.core import which
56
from libvcs.conftest import CreateRepoCallbackFixtureProtocol
6-
from libvcs.util import which
77

88

99
@pytest.mark.skipif(not which("git"), reason="git is not available")

tests/states/test_git.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from pytest_mock import MockerFixture
1111

1212
from libvcs import exc
13+
from libvcs.cmd.core import run, which
1314
from libvcs.conftest import CreateRepoCallbackFixtureProtocol
1415
from libvcs.shortcuts import create_repo_from_pip_url
1516
from libvcs.states.git import (
@@ -19,7 +20,6 @@
1920
convert_pip_url as git_convert_pip_url,
2021
extract_status,
2122
)
22-
from libvcs.util import run, which
2323

2424
if not which("git"):
2525
pytestmark = pytest.mark.skip(reason="git is not available")

tests/states/test_hg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
import pytest
55

6+
from libvcs.cmd.core import run, which
67
from libvcs.shortcuts import create_repo, create_repo_from_pip_url
7-
from libvcs.util import run, which
88

99
if not which("hg"):
1010
pytestmark = pytest.mark.skip(reason="hg is not available")

tests/states/test_svn.py

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

55
import pytest
66

7+
from libvcs.cmd.core import which
78
from libvcs.conftest import CreateRepoCallbackFixtureProtocol
89
from libvcs.shortcuts import create_repo_from_pip_url
910
from libvcs.states.svn import SubversionRepo
10-
from libvcs.util import which
1111

1212
if not which("svn"):
1313
pytestmark = pytest.mark.skip(reason="svn is not available")

0 commit comments

Comments
 (0)