mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 15:37:56 -05:00
Add pip_install_extra property to buildsystems/pip Add py3_azure_cli package Add az fake package Convert azure_cli to a fake package
24 lines
978 B
Ruby
24 lines
978 B
Ruby
Encoding.default_external = Encoding::UTF_8
|
|
Encoding.default_internal = Encoding::UTF_8
|
|
require 'package'
|
|
|
|
class Pip < Package
|
|
property :pip_install_extras
|
|
|
|
def self.install
|
|
puts 'Checking for pip updates'.orange if @opt_verbose
|
|
system 'python3 -s -m pip install -U pip', exception: false
|
|
puts "Installing #{name.gsub('py3_', '')} python module. This may take a while...".lightblue
|
|
system "MAKEFLAGS=-j#{CREW_NPROC} python -s -m pip install #{name.gsub('py3_', '')}", exception: false
|
|
@pip_files = `python3 -s -m pip show -f #{name.gsub('py3_', '')}`.chomp
|
|
@pip_files_base = @pip_files[/(?<=Location: ).*/, 0].concat('/')
|
|
@pip_files_lines = @pip_files[/(?<=Files:\n)[\W|\w]*/, 0].split
|
|
@pip_files_lines.each do |pip_file|
|
|
@pip_path = File.expand_path("#{@pip_files_base}#{pip_file}")
|
|
@destpath = "#{CREW_DEST_DIR.chomp('/')}#{@pip_path}"
|
|
FileUtils.install @pip_path, @destpath
|
|
end
|
|
eval @pip_install_extras
|
|
end
|
|
end
|