Compare commits
2 Commits
main
...
issue/1831
| Author | SHA1 | Date |
|---|---|---|
|
|
399dca6e9c | |
|
|
69f45e7437 |
|
|
@ -162,13 +162,22 @@ class FPM::Package::Python < FPM::Package
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
setup_cmd += [
|
setup_cmd << want_pkg
|
||||||
"--build",
|
|
||||||
target,
|
|
||||||
want_pkg,
|
|
||||||
]
|
|
||||||
|
|
||||||
safesystem(*setup_cmd)
|
safesystem(*setup_cmd)
|
||||||
|
|
||||||
|
# Pip removed the --build flag sometime in 2021, it seems: https://github.com/pypa/pip/issues/8333
|
||||||
|
# A workaround for pip removing the `--build` flag. Previously, `pip download --build ...` would leave
|
||||||
|
# behind a directory with the Python package extracted and ready to be used.
|
||||||
|
# For example, `pip download ... Django` puts `Django-4.0.4.tar.tz` into the build_path directory.
|
||||||
|
# If we expect `pip` to leave an unknown-named file in the `build_path` directory, let's check for
|
||||||
|
# a single file and unpack it. I don't know if it will /always/ be a .tar.gz though.
|
||||||
|
files = ::Dir.glob(File.join(build_path, "*.tar.gz"))
|
||||||
|
if files.length != 1
|
||||||
|
raise "Unexpected directory layout after `pip download ...`. This might be an fpm bug? The directory is #{build_path}"
|
||||||
|
end
|
||||||
|
|
||||||
|
safesystem("tar", "-zxf", files[0], "-C", target)
|
||||||
else
|
else
|
||||||
# no pip, use easy_install
|
# no pip, use easy_install
|
||||||
logger.debug("no pip, defaulting to easy_install", :easy_install => attributes[:python_easyinstall])
|
logger.debug("no pip, defaulting to easy_install", :easy_install => attributes[:python_easyinstall])
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,7 @@ describe FPM::Package::Python do
|
||||||
|
|
||||||
# Hardcode /usr/local/bin here. On newer Python 3's I cannot figure out how to
|
# Hardcode /usr/local/bin here. On newer Python 3's I cannot figure out how to
|
||||||
# determine the script_dir at installation time. easy_install's method is gone.
|
# determine the script_dir at installation time. easy_install's method is gone.
|
||||||
path = subject.staging_path("/usr/local/bin/django-admin.py")
|
path = subject.staging_path("/usr/local/bin/django-admin")
|
||||||
|
|
||||||
# Read the first line (the hashbang line) of the django-admin.py script
|
# Read the first line (the hashbang line) of the django-admin.py script
|
||||||
fd = File.new(path, "r")
|
fd = File.new(path, "r")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue