Skip to content
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
4 changes: 3 additions & 1 deletion generate_dependency_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Reads pyproject.toml files and creates a Mermaid diagram showing internal package dependencies.
"""

import re
import tomllib
from pathlib import Path
from typing import Dict, List, Set
Expand Down Expand Up @@ -34,7 +35,8 @@ def extract_dependencies(pyproject_data: Dict, package_names: Set[str]) -> Set[s
if 'project' in pyproject_data and 'dependencies' in pyproject_data['project']:
for dep in pyproject_data['project']['dependencies']:
# Extract package name (before any version specifier)
dep_name = dep.split('>=')[0].split('==')[0].split('<')[0].strip()
# Use regex to handle multiple version specifiers (e.g., "package>=1.0,<2.0")
dep_name = re.split(r'[><=!~]', dep)[0].strip()

# Only include if it's one of our internal packages
if dep_name in package_names:
Expand Down