"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/fpm/package/python.rb" between
fpm-1.13.1.tar.gz and fpm-1.14.0.tar.gz

About: fpm tries to make it easy and quick to build packages such as rpms, debs, OSX packages, etc.

python.rb  (fpm-1.13.1):python.rb  (fpm-1.14.0)
skipping to change at line 83 skipping to change at line 83
"to appending 'build_scripts --executable PYTHON_EXECUTABLE' arguments " \ "to appending 'build_scripts --executable PYTHON_EXECUTABLE' arguments " \
"to 'setup.py install' command." "to 'setup.py install' command."
option "--disable-dependency", "python_package_name", option "--disable-dependency", "python_package_name",
"The python package name to remove from dependency list", "The python package name to remove from dependency list",
:multivalued => true, :attribute_name => :python_disable_dependency, :multivalued => true, :attribute_name => :python_disable_dependency,
:default => [] :default => []
option "--setup-py-arguments", "setup_py_argument", option "--setup-py-arguments", "setup_py_argument",
"Arbitrary argument(s) to be passed to setup.py", "Arbitrary argument(s) to be passed to setup.py",
:multivalued => true, :attribute_name => :python_setup_py_arguments, :multivalued => true, :attribute_name => :python_setup_py_arguments,
:default => [] :default => []
option "--internal-pip", :flag,
"Use the pip module within python to install modules - aka 'python -m pip'.
This is the recommended usage since Python 3.4 (2014) instead of invoking the 'p
ip' script",
:attribute_name => :python_internal_pip,
:default => true
private private
# Input a package. # Input a package.
# #
# The 'package' can be any of: # The 'package' can be any of:
# #
# * A name of a package on pypi (ie; easy_install some-package) # * A name of a package on pypi (ie; easy_install some-package)
# * The path to a directory containing setup.py # * The path to a directory containing setup.py
# * The path to a setup.py # * The path to a setup.py
skipping to change at line 133 skipping to change at line 137
if version.nil? if version.nil?
want_pkg = "#{package}" want_pkg = "#{package}"
else else
want_pkg = "#{package}==#{version}" want_pkg = "#{package}==#{version}"
end end
target = build_path(package) target = build_path(package)
FileUtils.mkdir(target) unless File.directory?(target) FileUtils.mkdir(target) unless File.directory?(target)
if attributes[:python_pip].nil? if attributes[:python_internal_pip?]
# no pip, use easy_install # XXX: Should we detect if internal pip is available?
logger.debug("no pip, defaulting to easy_install", :easy_install => attrib attributes[:python_pip] = [ attributes[:python_bin], "-m", "pip"]
utes[:python_easyinstall]) end
safesystem(attributes[:python_easyinstall], "-i",
attributes[:python_pypi], "--editable", "-U", # attributes[:python_pip] -- expected to be a path
"--build-directory", target, want_pkg) if attributes[:python_pip]
else
logger.debug("using pip", :pip => attributes[:python_pip]) logger.debug("using pip", :pip => attributes[:python_pip])
# TODO: Support older versions of pip # TODO: Support older versions of pip
pip = [attributes[:python_pip]] if pip.is_a?(String)
setup_cmd = [ setup_cmd = [
attributes[:python_pip], *attributes[:python_pip],
"download", "download",
"--no-clean", "--no-clean",
"--no-deps", "--no-deps",
"--no-binary", "--no-binary", ":all:",
":all:", "-d", build_path,
"-i", attributes[:python_pypi], "-i", attributes[:python_pypi],
] ]
if attributes[:python_trusted_host] if attributes[:python_trusted_host]
setup_cmd += [ setup_cmd += [
"--trusted-host", "--trusted-host",
attributes[:python_trusted_host], attributes[:python_trusted_host],
] ]
end end
setup_cmd += [ setup_cmd += [
"--build", "--build",
target, target,
want_pkg, want_pkg,
] ]
safesystem(*setup_cmd) safesystem(*setup_cmd)
else
# no pip, use easy_install
logger.debug("no pip, defaulting to easy_install", :easy_install => attrib
utes[:python_easyinstall])
safesystem(attributes[:python_easyinstall], "-i",
attributes[:python_pypi], "--editable", "-U",
"--build-directory", target, want_pkg)
end end
# easy_install will put stuff in @tmpdir/packagename/, so find that: # easy_install will put stuff in @tmpdir/packagename/, so find that:
# @tmpdir/somepackage/setup.py # @tmpdir/somepackage/setup.py
dirs = ::Dir.glob(File.join(target, "*")) dirs = ::Dir.glob(File.join(target, "*"))
if dirs.length != 1 if dirs.length != 1
raise "Unexpected directory layout after easy_install. Maybe file a bug? T he directory is #{build_path}" raise "Unexpected directory layout after easy_install. Maybe file a bug? T he directory is #{build_path}"
end end
return dirs.first return dirs.first
end # def download end # def download
 End of changes. 6 change blocks. 
11 lines changed or deleted 24 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)