Skip to content

Commit d32745a

Browse files
committed
Make setup.py robust: Handle missing requirements.txt with fallback
1 parent 76a1fba commit d32745a

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@ def read_readme():
1212

1313
# Read requirements
1414
def read_requirements():
15-
with open("requirements.txt", "r", encoding="utf-8") as fh:
15+
requirements_path = os.path.join(os.path.dirname(__file__), "requirements.txt")
16+
if not os.path.exists(requirements_path):
17+
# Fallback to default requirements if file not found
18+
return [
19+
"httpx>=0.24.0",
20+
"pydantic>=2.0.0",
21+
"typing-extensions>=4.5.0",
22+
]
23+
with open(requirements_path, "r", encoding="utf-8") as fh:
1624
return [line.strip() for line in fh if line.strip() and not line.startswith("#")]
1725

1826
setup(

0 commit comments

Comments
 (0)