Skip to content
This repository was archived by the owner on Jan 16, 2022. It is now read-only.

feat: Add option to pass the project directory to Poetry #1

Merged
merged 1 commit into from
Jul 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pre_commit_hooks/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
action="store_true",
help="Include credentials for extra indices.",
)
parser.add_argument(
"--project-directory",
action="store",
help="Directory which includes the pyproject.toml file.",
)
parser.add_argument("filename", help="Filename to check.")
args = parser.parse_args(argv)

Expand All @@ -35,7 +40,7 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
with open(args.filename, "w") as req:
exporter.export(
fmt="requirements.txt",
cwd=None,
cwd=args.project_directory,
output=req,
with_hashes=not args.without_hashes,
dev=args.dev,
Expand Down