Skip to content

Commit ebf1a0d

Browse files
committed
feat: Enhance dependency check to map package names to import names
1 parent 23dd290 commit ebf1a0d

3 files changed

Lines changed: 19 additions & 9 deletions

File tree

__pycache__/app.cpython-311.pyc

-2 Bytes
Binary file not shown.

pipeguard.log

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,3 +289,8 @@
289289
2025-06-17 19:41:08,947 - flask-limiter - INFO - ratelimit 30 per 1 minute (127.0.0.1) exceeded at endpoint: dashboard
290290
2025-06-17 19:41:08,947 - app - WARNING - Rate limit exceeded: 127.0.0.1 - http://localhost/
291291
2025-06-17 19:41:08,958 - app - INFO - Page not found: 127.0.0.1 - http://localhost/nonexistent
292+
2025-12-13 09:39:48,571 - werkzeug - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
293+
* Running on all addresses (0.0.0.0)
294+
* Running on http://127.0.0.1:8080
295+
* Running on http://10.174.65.177:8080
296+
2025-12-13 09:39:48,571 - werkzeug - INFO - Press CTRL+C to quit

run_local.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,24 @@ def check_dependencies():
4343
"""Check if all required dependencies are installed."""
4444
print("📦 Checking dependencies...")
4545

46-
required_packages = [
47-
'flask', 'pytest', 'google-cloud-firestore',
48-
'requests', 'python-dotenv', 'functions-framework'
49-
]
46+
# Map package names to their import names
47+
required_packages = {
48+
'flask': 'flask',
49+
'pytest': 'pytest',
50+
'google-cloud-firestore': 'google.cloud.firestore',
51+
'requests': 'requests',
52+
'python-dotenv': 'dotenv',
53+
'functions-framework': 'functions_framework'
54+
}
5055

5156
missing_packages = []
52-
for package in required_packages:
57+
for package_name, import_name in required_packages.items():
5358
try:
54-
__import__(package.replace('-', '_'))
55-
print(f" ✅ {package}")
59+
__import__(import_name)
60+
print(f" ✅ {package_name}")
5661
except ImportError:
57-
missing_packages.append(package)
58-
print(f" ❌ {package}")
62+
missing_packages.append(package_name)
63+
print(f" ❌ {package_name}")
5964

6065
if missing_packages:
6166
print(f"\n⚠️ Missing packages: {', '.join(missing_packages)}")

0 commit comments

Comments
 (0)