Skip to content

Commit

Permalink
Rename functions for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Feb 23, 2024
1 parent 43980cb commit 3f8367b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/pip_deepfreeze/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
get_temp_path_in_dir,
log_debug,
log_info,
make_frozen_requirements_path,
make_frozen_requirements_paths,
make_project_name_with_extras,
make_requirements_path,
make_requirements_paths,
normalize_req_line,
open_with_rollback,
run_commands,
Expand Down Expand Up @@ -55,7 +55,7 @@ def sync(
)
with merged_constraints_path.open(mode="w", encoding="utf-8") as constraints:
for req_line in prepare_frozen_reqs_for_upgrade(
make_requirements_paths(project_root, extras),
make_frozen_requirements_paths(project_root, extras),
constraints_path,
upgrade_all,
to_upgrade,
Expand All @@ -73,7 +73,7 @@ def sync(
python, project_root, extras
)
for extra, frozen_reqs in frozen_reqs_by_extra.items():
requirements_frozen_path = make_requirements_path(project_root, extra)
requirements_frozen_path = make_frozen_requirements_path(project_root, extra)
with open_with_rollback(requirements_frozen_path) as f:
print("# frozen requirements generated by pip-deepfreeze", file=f)
# output pip options in main requirements only
Expand Down
8 changes: 4 additions & 4 deletions src/pip_deepfreeze/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,16 @@ def run_commands(commands: Sequence[str], cwd: Path, command_type: str) -> None:
)


def make_requirements_path(project_root: Path, extra: Optional[str]) -> Path:
def make_frozen_requirements_path(project_root: Path, extra: Optional[str]) -> Path:
if extra:
return project_root / f"requirements-{extra}.txt"
else:
return project_root / "requirements.txt"


def make_requirements_paths(
def make_frozen_requirements_paths(
project_root: Path, extras: Sequence[str]
) -> Iterator[Path]:
yield make_requirements_path(project_root, None)
yield make_frozen_requirements_path(project_root, None)
for extra in extras:
yield make_requirements_path(project_root, extra)
yield make_frozen_requirements_path(project_root, extra)

0 comments on commit 3f8367b

Please sign in to comment.