From a963c129cc74ea1a1770a26d53d3b39e7dc8e0cb Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Mon, 30 Mar 2026 13:20:42 +0545 Subject: [PATCH] Remove deprecated pkg_resources dependency Replace pkg_resources.parse_requirements with direct file reading that: - Strips whitespace and filters blank lines - Skips comment lines (starting with #) - Handles inline comments (text after #) --- setup.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index a8fcb29..63e1008 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,6 @@ from importlib.util import module_from_spec, spec_from_file_location from pathlib import Path -from pkg_resources import parse_requirements from setuptools import find_packages, setup _PATH_ROOT = os.path.dirname(__file__) @@ -20,8 +19,8 @@ def _load_py_module(fname, pkg="litai"): def _load_requirements(path_dir: str = _PATH_ROOT, file_name: str = "requirements.txt") -> list: - reqs = parse_requirements(open(os.path.join(path_dir, file_name)).readlines()) - return list(map(str, reqs)) + with open(os.path.join(path_dir, file_name)) as f: + return [line.split("#")[0].strip() for line in f if line.strip() and not line.startswith("#")] about = _load_py_module("__about__.py")