Compare commits

...

3 Commits
main ... pr/947

Author SHA1 Message Date
Marcin Kliks 8d1a441081 Removed file:/// prefix to use local dir
Pip uses just local dir name for installation purposes
2017-07-20 21:58:39 -07:00
Marcin Kliks c795e147f7 Skipped "-e", to just copy sdist contents 2017-07-20 21:58:12 -07:00
Marcin 'vi4m' Kliks 4827cd6bb9 Local project path support for virtualenv target.
Sometimes you don't want to upload to pypi server just
to make distro package. Special flag --local-project-path
just does this - pip install -e.
2017-07-20 21:55:09 -07:00
1 changed files with 13 additions and 1 deletions

View File

@ -15,6 +15,10 @@ class FPM::Package::Virtualenv < FPM::Package
option "--package-name-prefix", "PREFIX", "Name to prefix the package " \
"name with.", :default => "virtualenv"
option "--local-project-path", "DIRECTORY",
"Local python project path",
:default => ""
option "--install-location", "DIRECTORY", "DEPRECATED: Use --prefix instead." \
" Location to which to install the virtualenv by default.",
:default => "/usr/share/python" do |path|
@ -135,7 +139,15 @@ class FPM::Package::Virtualenv < FPM::Package
target_args << package
end
pip_args = [python_exe, pip_exe, "install", "-i", attributes[:virtualenv_pypi]] << extra_index_url_args << find_links_url_args << target_args
# Installing from local project path has an advantage to now having to upload
# python package to pypi server just to make distro package.
if attributes[:virtualenv_local_project_path]
logger.debug("Installing from local project path.")
pip_args = [python_exe, pip_exe, "install", attributes[:virtualenv_local_project_path]] << extra_index_url_args << find_links_url_args
else
logger.debug("Installing from PyPi server.")
pip_args = [python_exe, pip_exe, "install", "-i", attributes[:virtualenv_pypi]] << extra_index_url_args << find_links_url_args << target_args
end
safesystem(*pip_args.flatten)
if attributes[:virtualenv_setup_install?]