Skip to content

Commit

Permalink
ENH: run pip install checks in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Nov 20, 2023
1 parent 57157f5 commit 482ff35
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/repoma/pin_nb_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

import nbformat

from repoma.utilities.executor import Executor

from .errors import PrecommitError

__PIP_INSTALL_STATEMENT = "%pip install -q "
Expand All @@ -31,9 +33,11 @@ def check_pinned_requirements(filename: str) -> None:
cell_content = "".join(s.strip("\\") for s in src_lines)
if not cell_content.startswith(__PIP_INSTALL_STATEMENT):
continue
__check_install_statement(filename, cell_content)
__check_requirements(filename, cell_content)
__check_metadata(filename, cell["metadata"])
executor = Executor()
executor(__check_install_statement, filename, cell_content)
executor(__check_requirements, filename, cell_content)
executor(__check_metadata, filename, cell["metadata"])
executor.finalize()
return
msg = (
f'Notebook "{filename}" does not contain a pip install cell of the form'
Expand Down

0 comments on commit 482ff35

Please sign in to comment.