mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
don't read commented lines in pipfiles
This commit is contained in:
+5
-1
@@ -263,6 +263,10 @@ def which_pip(allow_global=False):
|
||||
|
||||
return which('pip')
|
||||
|
||||
def from_requirements_file(r):
|
||||
"""Returns a list of packages from an open requirements file."""
|
||||
return [p for p in r.read().split('\n') if p and not p.startswith('#')]
|
||||
|
||||
|
||||
|
||||
@click.group(invoke_without_command=True)
|
||||
@@ -297,7 +301,7 @@ def install(package_name=False, more_packages=False, r=False, dev=False, system=
|
||||
|
||||
# If -r provided, read in package names.
|
||||
if r:
|
||||
package_names = [p for p in r.read().split('\n') if p]
|
||||
package_names = from_requirements_file(r)
|
||||
|
||||
# Install all dependencies, if none was provided.
|
||||
if not package_names and package_name is False:
|
||||
|
||||
Reference in New Issue
Block a user