Skip to content

Commit

Permalink
BREAK: detect automatically if repo has notebooks (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer authored Oct 14, 2024
1 parent e78be08 commit 1fb5e51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ repos:
args:
- --allow-labels
- --dependabot=update
- --no-notebooks
- --no-prettierrc
- --no-pypi
- --repo-name=policy
Expand Down
11 changes: 4 additions & 7 deletions src/compwa_policy/check_dev_files/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
)
from compwa_policy.check_dev_files.deprecated import remove_deprecated_tools
from compwa_policy.utilities.executor import Executor
from compwa_policy.utilities.match import git_ls_files, matches_patterns
from compwa_policy.utilities.precommit import ModifiablePrecommit

if TYPE_CHECKING:
Expand All @@ -55,7 +56,9 @@ def main(argv: Sequence[str] | None = None) -> int:
is_python_repo = not args.no_python
if not args.repo_title:
args.repo_title = args.repo_name
has_notebooks = not args.no_notebooks
has_notebooks = any(
matches_patterns(file, ["**/*.ipynb"]) for file in git_ls_files(untracked=True)
)
use_gitpod = args.gitpod
dev_python_version = __get_python_version(args.dev_python_version)
package_managers: set[conda.PackageManagerChoice] = set(
Expand Down Expand Up @@ -272,12 +275,6 @@ def _create_argparse() -> ArgumentParser:
default=False,
help="Do not run test job on macOS",
)
parser.add_argument(
"--no-notebooks",
action="store_true",
default=False,
help="This repository does not contain Jupyter notebooks",
)
parser.add_argument(
"--no-pypi",
action="store_true",
Expand Down

0 comments on commit 1fb5e51

Please sign in to comment.