From 199d6ff329c4fcdf846f4c3bcaa58d5a19f7cb97 Mon Sep 17 00:00:00 2001 From: AN Long Date: Tue, 9 Jun 2026 21:31:06 +0900 Subject: [PATCH] Skip dev dependencies in setup.py so pip install only pulls runtime deps --- setup.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 57568e03..9b15847b 100644 --- a/setup.py +++ b/setup.py @@ -13,16 +13,25 @@ def parse_requirements(): - """Parse requirements from requirements.txt.""" + """Parse runtime requirements from requirements.txt. + + Lines from the "# dev" marker onward are skipped, so `pip install + python-okx` only pulls runtime dependencies. `pip install -r + requirements.txt` still installs everything (pip treats the marker as a + plain comment), keeping the dev/test setup unchanged. + """ requirements = [] req_path = os.path.join(HERE, "requirements.txt") - + if not os.path.exists(req_path): return requirements - + with open(req_path, "r", encoding="utf-8") as f: for line in f: line = line.strip() + # Stop at the dev-dependency section marker + if line.lower().startswith("# dev"): + break # Skip empty lines and comments if not line or line.startswith("#"): continue @@ -30,7 +39,7 @@ def parse_requirements(): if "#" in line: line = line.split("#")[0].strip() requirements.append(line) - + return requirements