Permalink
Browse files

pip package updated

  • Loading branch information...
1 parent e43110c commit 9f5b929d924a3ddf5ead42abb72b13360bb0067c @adorepump committed Jun 5, 2012
Showing with 43 additions and 18 deletions.
  1. BIN pip/pip.1.1.1.nupkg
  2. BIN pip/pip.1.1.nupkg
  3. +4 −2 pip/pip.nuspec
  4. +39 −16 pip/tools/chocolateyInstall.ps1
View
Binary file not shown.
View
Binary file not shown.
View
@@ -3,7 +3,7 @@
<metadata>
<id>pip</id>
<title>Pip(Python) Installs Packages</title>
- <version>1.1</version>
+ <version>1.1.1</version>
<authors>The pip developers</authors>
<owners>Elliando Dias</owners>
<summary>pip is a tool for installing and managing Python packages, such as those found in the Python Package Index</summary>
@@ -17,6 +17,8 @@
<dependencies>
<dependency id="easy.install" version="" />
</dependencies>
- <releaseNotes></releaseNotes>
+ <releaseNotes>
+ By default, it will install the packages virtualenv, fabric, ipython and django
+ </releaseNotes>
</metadata>
</package>
@@ -1,5 +1,30 @@
#import-module C:\Chocolatey\chocolateyInstall\helpers\chocolateyInstaller
+function Get-RegistryValue($key, $value) {
+ $item = (Get-ItemProperty $key $value -ErrorAction SilentlyContinue)
+ if ($item -ne $null) { return $item.$value } else { return $null }
+}
+
+function Get-Python-Home() {
+ $result = $null
+
+ $filename = Get-RegistryValue "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Python.exe" '(default)'
+
+ if ($filename -eq $null) {
+ $filename = Get-RegistryValue "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Python.exe" '(default)'
+ }
+
+ if ($filename -ne $null) {
+ $file = Get-ChildItem $filename
+ $result = $file.DirectoryName
+ }
+
+ return $result
+}
+
+
+$global:python_home = Get-Python-Home
+
$extras = @{
'name' = 'virtualenv';
'description' = 'virtualenv is a tool to create isolated Python environments';
@@ -19,29 +44,33 @@ $extras = @{
'name' = 'ipython';
'description' = 'IPython provides a rich toolkit to help you make the most out of using Python';
'url' = 'http://ipython.org'
+}, @{
+ 'name' = 'django';
+ 'description' = 'Django is a high-level Python Web framework';
+ 'url' = 'https://www.djangoproject.com';
+ 'block' = {
+ $django_bin = Join-Path $global:python_home 'lib\site-packages\django\bin'
+ Install-ChocolateyPath $django_bin 'User'
+ }
}
+
# @{'name'= 'buildout'; 'url' = 'http://www.buildout.org'; 'package' = 'zc.buildout' }
+# https://www.djangoproject.com' pip install -g Django
function CreateFolder ([string]$Path) {
New-Item -Path $Path -type directory -Force
}
-function get-Confirmation() {
- $names = $extras | ForEach-Object { $_.name} | Sort-Object
- $str = [string]::join(', ', $names)
- $res = Read-Host "Would you like to install common packages $str ? (y/n)"
- return ($res.ToLower() -eq 'y')
-}
-
function install-extras() {
+ Write-Host "Installing default packages"
$extras | ForEach-Object {
$name = $_.name
$url = $_.url
$description = $_.description
$package = if ($_.ContainsKey('package')) { $_.package } else { $name }
$block = if ($_.ContainsKey('block')) { $_.block } else { $null }
- $cmd = "pip install $package"
+ $cmd = "pip install $package" # pip install -g $package
Write-Host "Installing package '$name'
description: $description
url: $url
@@ -60,12 +89,7 @@ function install-extras() {
function chocolatey-install() {
try {
easy_install pip
-
- $yesConfirmation = get-Confirmation
-
- if ($yesConfirmation) {
- install-extras
- }
+ install-extras
Write-ChocolateySuccess 'pip'
} catch {
@@ -74,5 +98,4 @@ function chocolatey-install() {
}
}
-#install-extras
-chocolatey-install
+chocolatey-install

0 comments on commit 9f5b929

Please sign in to comment.