diff --git a/depaudit/parsers/python.py b/depaudit/parsers/python.py index 6a6d88b..2add666 100644 --- a/depaudit/parsers/python.py +++ b/depaudit/parsers/python.py @@ -107,7 +107,7 @@ class PythonParser(Parser): content = file_path.read_text(encoding="utf-8") install_requires_match = re.search( - r"install_requires\s*=\s*\[(^\]]*)\]", content, re.DOTALL + r"install_requires\s*=\s*\[([^\]]*)\]", content, re.DOTALL ) if install_requires_match: deps_str = install_requires_match.group(1) @@ -118,11 +118,11 @@ class PythonParser(Parser): self._create_dependency(file_path, name, version) ) - name_match = re.search(r'name\s*=\s*["']([^"']+)["']', content) + name_match = re.search(r"name\s*=\s*[\"']([^\"']+)[\"']", content) if name_match: manifest.project_name = name_match.group(1) - version_match = re.search(r'version\s*=\s*["']([^"']+)["']', content) + version_match = re.search(r"version\s*=\s*[\"']([^\"']+)[\"']", content) if version_match: manifest.project_version = version_match.group(1) @@ -146,7 +146,7 @@ class PythonParser(Parser): def _parse_pipfile(self, file_path: Path, manifest: ParsedManifest) -> None: content = file_path.read_text(encoding="utf-8") - name_match = re.search(r'name\s*=\s*["']([^"']+)["']', content) + name_match = re.search(r"name\s*=\s*[\"']([^\"']+)[\"']", content) if name_match: manifest.project_name = name_match.group(1)