Skip to content

Commit 950ea16

Browse files
committed
pylock: rename is_valid_pylock_file_name
1 parent 9fe5622 commit 950ea16

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/pip/_internal/commands/lock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
with_cleanup,
1111
)
1212
from pip._internal.cli.status_codes import SUCCESS
13-
from pip._internal.models.pylock import is_valid_pylock_file_name
13+
from pip._internal.models.pylock import is_valid_pylock_path
1414
from pip._internal.operations.build.build_tracker import get_build_tracker
1515
from pip._internal.req.req_install import (
1616
check_legacy_setup_py_options,
@@ -155,7 +155,7 @@ def run(self, options: Values, args: List[str]) -> int:
155155
base_dir = Path.cwd()
156156
else:
157157
output_file_path = Path(options.output_file)
158-
if not is_valid_pylock_file_name(output_file_path):
158+
if not is_valid_pylock_path(output_file_path):
159159
logger.warning(
160160
"%s is not a valid lock file name.",
161161
output_file_path,

src/pip/_internal/models/pylock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"Pylock",
4141
"PylockValidationError",
4242
"PylockUnsupportedVersionError",
43-
"is_valid_pylock_file_name",
43+
"is_valid_pylock_path",
4444
]
4545

4646
T = TypeVar("T")
@@ -63,7 +63,7 @@ def __init__(self, value: Any) -> None: ...
6363
PYLOCK_FILE_NAME_RE = re.compile(r"^pylock\.([^.]+)\.toml$")
6464

6565

66-
def is_valid_pylock_file_name(path: Path) -> bool:
66+
def is_valid_pylock_path(path: Path) -> bool:
6767
return path.name == "pylock.toml" or bool(PYLOCK_FILE_NAME_RE.match(path.name))
6868

6969

tests/unit/test_pylock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
PylockUnsupportedVersionError,
1616
PylockValidationError,
1717
_exactly_one,
18-
is_valid_pylock_file_name,
18+
is_valid_pylock_path,
1919
)
2020

2121

@@ -29,7 +29,7 @@
2929
],
3030
)
3131
def test_pylock_file_name(file_name: str, valid: bool) -> None:
32-
assert is_valid_pylock_file_name(Path(file_name)) is valid
32+
assert is_valid_pylock_path(Path(file_name)) is valid
3333

3434

3535
def test_exactly_one() -> None:

0 commit comments

Comments
 (0)