Skip to content

Commit

Permalink
feat: remove the need for PYTHONPATH
Browse files Browse the repository at this point in the history
  • Loading branch information
rauno56 committed Jul 2, 2024
1 parent 13aeb95 commit 32f001e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions inventory/distribution/systemd.service
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Type=simple
User=odigos
Group=odigos
Environment="PORT=8082"
# Not required, but here for testing PYTONPATH detection in the future(not in effect)
Environment="PYTHONPATH=/opt/odigos-demo-inventory/site-packages"
Environment="PYTHONDONTWRITEBYTECODE=1"
Environment="PYTHONUNBUFFERED=1"
Expand Down
9 changes: 7 additions & 2 deletions inventory/inventory/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import os
import sys

# append known location for deps in distributed packages
dep_location = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', 'site-packages'))
sys.path.append(dep_location)

from flask import Flask, request, jsonify
import time
import signal
import sys
import os

PORT = os.environ["PORT"] if "PORT" in os.environ else 8080

Expand Down

0 comments on commit 32f001e

Please sign in to comment.