Skip to content

Commit

Permalink
- Use the correct path ("setup.py") since we are chdiring to that file's
Browse files Browse the repository at this point in the history
  directory. Fixes jordansissel#180
  • Loading branch information
jls committed Mar 21, 2012
1 parent 50ea546 commit 0c60ec8
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/fpm/package/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down

0 comments on commit 0c60ec8

Please sign in to comment.