Skip to content
Browse files

- Use the correct path ("setup.py") since we are chdiring to that file's

  directory. Fixes #180
  • Loading branch information...
1 parent 443b757 commit 318e30587f57b32a4c218ed805619db1147fd769 @jordansissel committed Mar 21, 2012
Showing with 11 additions and 2 deletions.
  1. +11 −2 lib/fpm/package/python.rb
View
13 lib/fpm/package/python.rb
@@ -117,8 +117,17 @@ def load_package_info(setup_py)
# Add ./pyfpm/ to the python library path
pylib = File.expand_path(File.dirname(__FILE__))
- setup_cmd = "env PYTHONPATH=#{pylib} #{attributes[:python_bin]} #{setup_py} --command-packages=pyfpm get_metadata"
- output = ::Dir.chdir(File.dirname(setup_py)) { `#{setup_cmd}` }
+
+ # chdir to the directory holding setup.py because some python setup.py's assume that you are
+ # in the same directory.
+ output = ::Dir.chdir(File.dirname(setup_py)) do
+ setup_cmd = "env PYTHONPATH=#{pylib} #{attributes[:python_bin]} " \
+ "setup.py --command-packages=pyfpm get_metadata"
+ # Capture the output, which will be JSON metadata describing this python
+ # package. See fpm/lib/fpm/package/pyfpm/get_metadata.py for more
+ # details.
+ `#{setup_cmd}`
+ end
@logger.warn("json output from setup.py", :data => output)
metadata = JSON.parse(output[/\{.*\}/msx])

0 comments on commit 318e305

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