Skip to content

Commit

Permalink
Merge pull request #334 from jacebrowning/skip-build-dirs
Browse files Browse the repository at this point in the history
Update nested config lookup to ignore certain directories
  • Loading branch information
jacebrowning authored May 19, 2024
2 parents 7c9f462 + 11c1f0a commit f226377
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 3.5.1 (2024-05-19)

- Updated nested config lookup to ignore build and package directories.

# 3.5 (2024-04-27)

- Added `--no-scripts` option to skip install/update scripts.
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ idna==3.3 ; python_version >= "3.8" and python_version < "4.0"
importlib-metadata==4.12.0 ; python_version >= "3.8" and python_version < "4.0"
iniconfig==1.1.1 ; python_version >= "3.8" and python_version < "4.0"
isort==5.10.1 ; python_version >= "3.8" and python_version < "4.0"
jinja2==3.1.3 ; python_version >= "3.8" and python_version < "4.0"
jinja2==3.1.4 ; python_version >= "3.8" and python_version < "4.0"
lazy-object-proxy==1.4.3 ; python_version >= "3.8" and python_version < "4.0"
macfsevents==0.8.1 ; python_version >= "3.8" and python_version < "4.0" and sys_platform == "darwin"
macholib==1.16 ; python_version >= "3.8" and python_version < "4.0" and sys_platform == "darwin"
Expand Down
1 change: 1 addition & 0 deletions gitman/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def update(
config = load_config(root)
configs = [config] if config else []
configs.extend(find_nested_configs(root, depth, []))

if configs:
count = 0
common.newline()
Expand Down
14 changes: 7 additions & 7 deletions gitman/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,17 +431,17 @@ def find_nested_configs(

log.debug(f"Searching for nested project in: {root}")
for name in os.listdir(root):
if name.startswith("."):
if name[0] in {".", "_", "@"}:
continue
if name in {"build", "dist", "node_modules", "venv"}:
continue
path = os.path.join(root, name)
if os.path.isdir(path) and path not in skip_paths and not os.path.islink(path):
config = load_config(path, search=False)
if config:
if path in skip_paths:
continue
if os.path.isdir(path) and not os.path.islink(path):
if config := load_config(path, search=False):
configs.append(config)

if os.path.islink(path):
continue

if depth is not None:
configs.extend(find_nested_configs(path, depth - 1, skip_paths))
else:
Expand Down
1 change: 0 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]

name = "gitman"
version = "3.5"
version = "3.5.1"
description = "A language-agnostic dependency manager using Git."

license = "MIT"
Expand Down

0 comments on commit f226377

Please sign in to comment.