From 58668ee67a3eb6081b6781f9ceada849ae913579 Mon Sep 17 00:00:00 2001 From: Emmett McFaralne Date: Thu, 11 Jul 2024 09:47:27 -0400 Subject: [PATCH] disallow comments in pip installs --- setup.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index ff1fc61..713376c 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,9 @@ from setuptools import setup, find_packages +def read_requirements(file): + with open(file, encoding='utf-8') as f: + return [line.strip() for line in f if line.strip() and not line.startswith('#')] + setup( name='thepipe_api', version='1.0.2', @@ -16,14 +20,14 @@ 'Operating System :: OS Independent', ], python_requires='>=3.10', - install_requires=open('requirements.txt').read().splitlines(), + install_requires=read_requirements('requirements.txt'), include_package_data=True, entry_points={ 'console_scripts': [ 'thepipe=thepipe.__init__:main', ], }, - extras_require = { - 'local': open('local.txt').read().splitlines(), + extras_require={ + 'local': read_requirements('local.txt'), } -) \ No newline at end of file +)