Permalink
Browse files

requirements-parser doesn't parse "git+git" so write simple parser

  • Loading branch information...
robnagler committed May 19, 2018
1 parent 100934b commit 62c0e4a2fe2a50dc13912a47485ca258156b4c12
Showing with 12 additions and 5 deletions.
  1. +12 −4 pykern/pksetup.py
  2. +0 −1 setup.py
@@ -315,10 +315,17 @@ def install_requires():
Returns:
dict: parsed requirements.txt
"""
import requirements
res = []
#TODO(robnagler) deprecate this for literal install_requires
with open('requirements.txt', 'r') as f:
install_requires = [str(i.line) for i in requirements.parse(f) if i.name]
return install_requires
for line in f:
line = line.strip()
if not line or line.startswith('#'):
continue
assert not line.endswith('\\'), \
'does not support continuation lines'
res.append(line)
return res
def setup(**kwargs):
@@ -611,8 +618,9 @@ def _state(base, kwargs):
state['version'] = _version(base)
manifest = '''# OVERWRITTEN by pykern.pksetup every "python setup.py"
include LICENSE
include requirements.txt
'''
if os.path.exists('requirements.txt'):
manifest += 'include requirements.txt\n'
readme = _readme()
state['long_description'] = _read(readme)
manifest += 'include {}\n'.format(readme)
@@ -24,7 +24,6 @@
'pytz>=2015.4',
'pyyaml>=3.0',
'requests>=2.7',
'requirements-parser>=0.2.0',
'setuptools>=20.3',
'six>=1.9',
'Sphinx>=1.3.5',

0 comments on commit 62c0e4a

Please sign in to comment.