Skip to content
Browse files

- strip flags as well

  • Loading branch information...
1 parent b9b917e commit df439b7a1a31145c37b38b4dfc528ca49f933018 @jordansissel committed Dec 4, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/fpm/package/python.rb
View
8 lib/fpm/package/python.rb
@@ -178,7 +178,13 @@ def load_package_info(setup_py)
# Best I can tell, requirements.txt are a superset of what
# is already supported as 'dependencies' in setup.py
# So we'll parse them the same way below.
- metadata["dependencies"] = File.read(requirements_txt).split("\n").map(&:strip).reject {|l| l =~ /^\s*#/}
+
+ # requirements.txt can have dependencies, flags, and comments.
+ # We only want the comments, so remove comment and flag lines.
+ metadata["dependencies"] = File.read(requirements_txt).split("\n") \
+ .reject { |l| l =~ /^\s*#/ } \
+ .reject { |l| l =~ /^-/ } \
+ .map(&:strip)
end
self.dependencies += metadata["dependencies"].collect do |dep|

0 comments on commit df439b7

Please sign in to comment.
Something went wrong with that request. Please try again.