Skip to content

Commit b1cc18d

Browse files
committed
Add support for dep-checker's --work-dir option in pre_commit.py
1 parent fdf95d4 commit b1cc18d

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

repo_helper/files/ci_cd.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ def make_github_manylinux(repo_path: pathlib.Path, templates: jinja2.Environment
183183
:param templates:
184184
"""
185185

186+
# TODO: deploys from other supported platforms for not pure python
187+
186188
file = PathPlus(repo_path / ".github" / "workflows" / "manylinux_build.yml")
187189
file.parent.maybe_make(parents=True)
188190

repo_helper/files/pre_commit.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,15 @@ def make_pre_commit(repo_path: pathlib.Path, templates: jinja2.Environment) -> L
257257
hooks=[{"id": "yapf-isort", "exclude": yapf_isort_excludes}],
258258
)
259259

260+
dep_checker_args = [templates.globals["import_name"].replace('.', '/')]
261+
262+
if templates.globals["source_dir"]:
263+
dep_checker_args.extend(["--work-dir", templates.globals["source_dir"]])
264+
260265
dep_checker = Repo(
261266
repo=make_github_url("domdfcoding", "dep_checker"),
262-
rev="v0.3.1",
263-
hooks=[{"id": "dep_checker", "args": [templates.globals["import_name"].replace('.', '/')]}]
267+
rev="v0.4.1",
268+
hooks=[{"id": "dep_checker", "args": dep_checker_args}]
264269
)
265270

266271
pre_commit_file = PathPlus(repo_path / ".pre-commit-config.yaml")

tests/test_files/test_testing_/test_make_pre_commit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ repos:
6565
exclude: ^(doc-source/conf|__pkginfo__|make_conda_recipe|setup)\.py$
6666

6767
- repo: https://github.com/domdfcoding/dep_checker
68-
rev: v0.3.1
68+
rev: v0.4.1
6969
hooks:
7070
- id: dep_checker
7171
args:

0 commit comments

Comments
 (0)