Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Python_Packaging_Authority
pip
提交
97c152c4
P
pip
项目概览
镜像
/
Python_Packaging_Authority
/
pip
12 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
pip
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
97c152c4
编写于
10月 15, 2008
作者:
I
Ian Bicking
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[svn r20975] Rename occurrance of pyinstall to pip
上级
c2000d7d
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
73 addition
and
69 deletion
+73
-69
docs/conf.py
docs/conf.py
+2
-2
docs/index.txt
docs/index.txt
+32
-32
docs/news.txt
docs/news.txt
+3
-3
pip.py
pip.py
+19
-18
regen-docs
regen-docs
+1
-1
scripts/pip
scripts/pip
+3
-0
setup.py
setup.py
+7
-7
tests/test_all_pip.py
tests/test_all_pip.py
+3
-3
tests/test_pip.py
tests/test_pip.py
+3
-3
未找到文件。
docs/conf.py
浏览文件 @
97c152c4
...
...
@@ -34,7 +34,7 @@ source_suffix = '.txt'
master_doc
=
'index'
# General substitutions.
project
=
'p
yinstall
'
project
=
'p
ip
'
copyright
=
'2008, The Open Planning Project'
# The default replacements for |version| and |release|, also used in various
...
...
@@ -107,7 +107,7 @@ html_last_updated_fmt = '%b %d, %Y'
#html_copy_source = True
# Output file base name for HTML help builder.
htmlhelp_basename
=
'p
yinstall
docs'
htmlhelp_basename
=
'p
ip
docs'
# Options for LaTeX output
...
...
docs/index.txt
浏览文件 @
97c152c4
p
yinstall
===
======
p
ip
===
.. toctree::
...
...
@@ -13,12 +13,12 @@ pyinstall
Introduction
------------
p
yinstall
is a replacement for `easy_install
p
ip
is a replacement for `easy_install
<http://peak.telecommunity.com/DevCenter/EasyInstall>`_. It uses mostly the
same techniques for finding packages, so packages that were made
easy_installable should be p
yinstall
able as well.
easy_installable should be p
ip
able as well.
p
yinstall
is meant to improve on easy_install. Some of the improvements:
p
ip
is meant to improve on easy_install. Some of the improvements:
* All packages are downloaded before installation. Partially-completed
installation doesn't occur as a result.
...
...
@@ -26,7 +26,7 @@ pyinstall is meant to improve on easy_install. Some of the improvements:
* Care is taken to present useful output on the console.
* The reasons for actions are kept track of. For instance, if a package is
being installed, p
yinstall
keeps track of why that package was required.
being installed, p
ip
keeps track of why that package was required.
* Error messages should be useful.
...
...
@@ -38,21 +38,21 @@ pyinstall is meant to improve on easy_install. Some of the improvements:
* Maybe features like native support for other version control systems, or
uninstallation, will get added. (They might get added to easy_install, but I
think the chance for p
yinstall
is higher.)
think the chance for p
ip
is higher.)
Also, p
yinstall
will eventually be merged directly with poacheggs, making it
Also, p
ip
will eventually be merged directly with poacheggs, making it
simple to define fixed sets of requirements and reliably reproduce a set of
packages.
p
yinstall
is complementary with `virtualenv
p
ip
is complementary with `virtualenv
<http://pypi.python.org/pypi/virtualenv>`_, and it is encouraged that you use
virtualenv to isolate your installation.
Community
---------
The homepage for p
yinstall
is temporarily located `on PyPI
<http://pypi.python.org/pypi/p
yinstall
>`_ -- a more proper homepage
The homepage for p
ip
is temporarily located `on PyPI
<http://pypi.python.org/pypi/p
ip
>`_ -- a more proper homepage
will follow. Bugs can go on the `poacheggs Trac instance
<http://trac.openplans.org/poacheggs/>`_ (probably that will change
too). Discussion should happen on the `virtualenv email group
...
...
@@ -61,7 +61,7 @@ too). Discussion should happen on the `virtualenv email group
Differences From easy_install
-----------------------------
p
yinstall
cannot install some packages. Specifically:
p
ip
cannot install some packages. Specifically:
* It cannot install from eggs. It only installs from source. (Maybe this will
be changed sometime, but it's low priority.)
...
...
@@ -92,12 +92,12 @@ have to install a bunch of other optional pieces? Most of all, will you be able
to do it again?
If you've ever tried to setup an application on a new system, or with slightly
updated pieces, and had it fail, p
yinstall
requirements are for you. If you
haven't had this problem then you will eventually, so p
yinstall
requirements are
updated pieces, and had it fail, p
ip
requirements are for you. If you
haven't had this problem then you will eventually, so p
ip
requirements are
for you too -- requirements make explicit, repeatable installation of packages.
So what are requirements files? They are very simple: lists of packages to
install. Instead of running something like ``p
yinstall
MyApp`` and getting
install. Instead of running something like ``p
ip
MyApp`` and getting
whatever libraries come along, you can create a requirements file something like::
MyApp
...
...
@@ -112,12 +112,12 @@ tools that MyApp doesn't strictly require.
You can also include "editable" packages -- packages that are checked out from
subversion (in the future other VCS will be supported). These are just like
using the ``-e`` option to p
yinstall
. They look like::
using the ``-e`` option to p
ip
. They look like::
-e svn+http://myrepo/svn/MyApp#egg=MyApp
You have to start the URL with ``svn+`` (eventually you'll be able to use
``hg+`` etc), and you have to include ``#egg=Package`` so p
yinstall
knows what
``hg+`` etc), and you have to include ``#egg=Package`` so p
ip
knows what
to expect at that URL. You can also include ``@rev`` in the URL, e.g., ``@275``
to check out revision 275.
...
...
@@ -130,7 +130,7 @@ tell you what all the exact versions are.
To create a new requirements file from a known working environment, use::
$ p
yinstall.py --freeze=
stable-req.txt
$ p
ip freeze -o
stable-req.txt
This will write a listing of *all* installed libraries to ``stable-req.txt``
with exact versions for every library. You may want to edit the file down after
...
...
@@ -140,7 +140,7 @@ stable starting point for constructing your requirements file.
You can also give it an existing requirements file, and it will use that as a
sort of template for the new file. So if you do::
$ p
yinstall.py --freeze=
stable-req.txt -r devel-req.txt
$ p
ip freeze -o
stable-req.txt -r devel-req.txt
it will keep the packages listed in ``devel-req.txt`` in order and preserve
comments.
...
...
@@ -149,44 +149,44 @@ Bundles
-------
Another way to distribute a set of libraries is a bundle format (specific to
p
yinstall
). This format is not stable at this time (there simply hasn't been
p
ip
). This format is not stable at this time (there simply hasn't been
any feedback, nor a great deal of thought). A bundle file contains all the
source for your package, and you can have p
yinstall
install then all together.
source for your package, and you can have p
ip
install then all together.
Once you have the bundle file further network access won't be necessary. To
build a bundle file, do::
$ p
yinstall.py --
bundle=MyApp.pybundle MyApp
$ p
ip install
bundle=MyApp.pybundle MyApp
(Using a `requirements file`_ would be wise.) Then someone else can get the
file ``MyApp.pybundle`` and run::
$ p
yinstall.py
MyApp.pybundle
$ p
ip install
MyApp.pybundle
This is *not* a binary format. This only packages source. If you have binary
packages, then the person who installs the files will have to have a compiler,
any necessary headers installed, etc. Binary packages are hard, this is
relatively easy.
Using p
yinstall
With virtualenv
-------------------------
------
Using p
ip
With virtualenv
-------------------------
p
yinstall
is most nutritious when used with `virtualenv
<http://pypi.python.org/pypi/virtualenv>`_. One of the reasons p
yinstall
p
ip
is most nutritious when used with `virtualenv
<http://pypi.python.org/pypi/virtualenv>`_. One of the reasons p
ip
doesn't install "multi-version" eggs is that virtualenv removes much of the need
for it.
p
yinstall
does not have to be installed to use it, you can run ``python
p
yinstall.py
`` and it will work. This is intended to avoid the bootstrapping
problem of installation. You can also run p
yinstall
inside any virtualenv
p
ip
does not have to be installed to use it, you can run ``python
p
ip
`` and it will work. This is intended to avoid the bootstrapping
problem of installation. You can also run p
ip
inside any virtualenv
environment, like::
$ virtualenv new-env/
... creates new-env/ ...
$ p
yinstall.py
-E new-env/ MyPackage
$ p
ip install
-E new-env/ MyPackage
This is exactly equivalent to::
$ ./new-env/bin/python p
yinstall.py
MyPackage
$ ./new-env/bin/python p
ip install
MyPackage
Except, if you have ``virtualenv`` installed and the path ``new-env/``
doesn't exist, then a new virtualenv will be created.
docs/news.txt
浏览文件 @
97c152c4
News for p
yinstall
News for p
ip
==================
0.1.4
...
...
@@ -23,7 +23,7 @@ News for pyinstall
``mypackage/`` are the same directory.
* Added support for an environmental variable
``$P
YINSTALL
_DOWNLOAD_CACHE`` which will cache package downloads, so
``$P
IP
_DOWNLOAD_CACHE`` which will cache package downloads, so
future installations won't require large downloads. Network access
is still required, but just some downloads will be avoided when
using this.
...
...
@@ -53,7 +53,7 @@ News for pyinstall
0.1.1
-----
* Fixed a NameError exception when running p
yinstall
outside of a
* Fixed a NameError exception when running p
ip
outside of a
virtualenv environment.
* Added HTTP proxy support (from Prabhu Ramachandran)
...
...
p
yinstall
.py
→
p
ip
.py
浏览文件 @
97c152c4
...
...
@@ -144,7 +144,7 @@ parser.add_option(
'-E'
,
'--environment'
,
dest
=
'venv'
,
metavar
=
'DIR'
,
help
=
'virtualenv environment to run p
yinstall
in (either give the '
help
=
'virtualenv environment to run p
ip
in (either give the '
'interpreter or the environment base directory)'
)
parser
.
add_option
(
...
...
@@ -321,7 +321,7 @@ def main(initial_args=None):
if
log_fp
is
not
None
:
log_fp
.
close
()
if
exit
:
log_fn
=
'./p
yinstall
-log.txt'
log_fn
=
'./p
ip
-log.txt'
text
=
'
\n
'
.
join
(
complete_log
)
logger
.
fatal
(
'Storing complete log in %s'
%
log_fn
)
log_fp
=
open_logfile_append
(
log_fn
)
...
...
@@ -650,7 +650,7 @@ class InstallRequirement(object):
if
self
.
_temp_build_dir
is
not
None
:
return
self
.
_temp_build_dir
if
self
.
req
is
None
:
self
.
_temp_build_dir
=
tempfile
.
mkdtemp
(
'-build'
,
'p
yinstall
-'
)
self
.
_temp_build_dir
=
tempfile
.
mkdtemp
(
'-build'
,
'p
ip
-'
)
return
self
.
_temp_build_dir
if
self
.
editable
:
name
=
self
.
name
.
lower
()
...
...
@@ -690,10 +690,10 @@ class InstallRequirement(object):
if
self
.
editable
:
egg_base_option
=
[]
else
:
egg_info_dir
=
os
.
path
.
join
(
self
.
source_dir
,
'p
yinstall
-egg-info'
)
egg_info_dir
=
os
.
path
.
join
(
self
.
source_dir
,
'p
ip
-egg-info'
)
if
not
os
.
path
.
exists
(
egg_info_dir
):
os
.
makedirs
(
egg_info_dir
)
egg_base_option
=
[
'--egg-base'
,
'p
yinstall
-egg-info'
]
egg_base_option
=
[
'--egg-base'
,
'p
ip
-egg-info'
]
call_subprocess
(
[
sys
.
executable
,
'-c'
,
script
,
'egg_info'
]
+
egg_base_option
,
cwd
=
self
.
source_dir
,
filter_stdout
=
self
.
_filter_install
,
show_stdout
=
False
,
...
...
@@ -740,7 +740,7 @@ execfile(__file__)
if
self
.
editable
:
base
=
self
.
source_dir
else
:
base
=
os
.
path
.
join
(
self
.
source_dir
,
'p
yinstall
-egg-info'
)
base
=
os
.
path
.
join
(
self
.
source_dir
,
'p
ip
-egg-info'
)
filenames
=
os
.
listdir
(
base
)
if
self
.
editable
:
filenames
=
[
f
for
f
in
filenames
if
f
.
endswith
(
'.egg-info'
)]
...
...
@@ -800,7 +800,7 @@ execfile(__file__)
assert
self
.
source_dir
if
self
.
comes_from
==
'command line'
:
# We don't check the versions of things explicitly installed.
# This makes, e.g., "p
yinstall
Package==dev" possible
# This makes, e.g., "p
ip
Package==dev" possible
return
version
=
self
.
installed_version
if
version
not
in
self
.
req
:
...
...
@@ -962,7 +962,8 @@ execfile(__file__)
if
not
base
:
## FIXME: this doesn't seem right:
return
False
self
.
_is_bundle
=
os
.
path
.
exists
(
os
.
path
.
join
(
base
,
'pyinstall-manifest.txt'
))
self
.
_is_bundle
=
(
os
.
path
.
exists
(
os
.
path
.
join
(
base
,
'pip-manifest.txt'
))
or
os
.
path
.
exists
(
os
.
path
.
join
(
base
,
'pyinstall-manifest.txt'
)))
return
self
.
_is_bundle
def
bundle_requirements
(
self
):
...
...
@@ -1015,11 +1016,11 @@ execfile(__file__)
@
property
def
delete_marker_filename
(
self
):
assert
self
.
source_dir
return
os
.
path
.
join
(
self
.
source_dir
,
'p
yinstall
-delete-this-directory.txt'
)
return
os
.
path
.
join
(
self
.
source_dir
,
'p
ip
-delete-this-directory.txt'
)
DELETE_MARKER_MESSAGE
=
'''
\
This file is placed here by p
yinstall
to indicate the source was put
here by p
yinstall
.
This file is placed here by p
ip
to indicate the source was put
here by p
ip
.
Once this package is successfully installed this source code will be
deleted (unless you remove this file).
...
...
@@ -1176,8 +1177,8 @@ class RequirementSet(object):
md5_hash
=
link
.
md5_hash
target_url
=
link
.
url
.
split
(
'#'
,
1
)[
0
]
target_file
=
None
if
os
.
environ
.
get
(
'P
YINSTALL
_DOWNLOAD_CACHE'
):
target_file
=
os
.
path
.
join
(
os
.
environ
[
'P
YINSTALL
_DOWNLOAD_CACHE'
],
if
os
.
environ
.
get
(
'P
IP
_DOWNLOAD_CACHE'
):
target_file
=
os
.
path
.
join
(
os
.
environ
[
'P
IP
_DOWNLOAD_CACHE'
],
urllib
.
quote
(
target_url
,
''
))
if
(
target_file
and
os
.
path
.
exists
(
target_file
)
and
os
.
path
.
exists
(
target_file
+
'.content-type'
)):
...
...
@@ -1420,7 +1421,7 @@ class RequirementSet(object):
name
=
os
.
path
.
join
(
dirpath
,
'svn-checkout.txt'
)
name
=
self
.
_clean_zip_name
(
name
,
dir
)
zip
.
writestr
(
basename
+
'/'
+
name
,
_svn_checkout_text
(
svn_url
,
svn_rev
))
zip
.
writestr
(
'p
yinstall
-manifest.txt'
,
self
.
bundle_requirements
())
zip
.
writestr
(
'p
ip
-manifest.txt'
,
self
.
bundle_requirements
())
zip
.
close
()
# Unlike installation, this will always delete the build directories
logger
.
info
(
'Removing temporary build dir %s and source dir %s'
...
...
@@ -1431,9 +1432,9 @@ class RequirementSet(object):
BUNDLE_HEADER
=
'''
\
# This is a p
yinstall
bundle file, that contains many source packages
# This is a p
ip
bundle file, that contains many source packages
# that can be installed as a group. You can install this like:
# p
yinstall
this_file.zip
# p
ip
this_file.zip
# The rest of the file contains a list of all the packages included:
'''
...
...
@@ -1720,7 +1721,7 @@ def write_freeze(filename, requirement, find_links, find_tags=False):
f
.
write
(
'-f %s
\n
'
%
link
)
installations
=
{}
for
dist
in
pkg_resources
.
working_set
:
if
dist
.
key
in
(
'setuptools'
,
'p
yinstall
'
,
'python'
):
if
dist
.
key
in
(
'setuptools'
,
'p
ip
'
,
'python'
):
## FIXME: also skip virtualenv?
continue
req
=
FrozenRequirement
.
from_dist
(
dist
,
dependency_links
,
find_tags
=
find_tags
)
...
...
@@ -1753,7 +1754,7 @@ def write_freeze(filename, requirement, find_links, find_tags=False):
continue
f
.
write
(
str
(
installations
[
line_req
.
name
]))
del
installations
[
line_req
.
name
]
f
.
write
(
'## The following requirements were added by p
yinstall
--freeze:
\n
'
)
f
.
write
(
'## The following requirements were added by p
ip
--freeze:
\n
'
)
for
installation
in
sorted
(
installations
.
values
(),
key
=
lambda
x
:
x
.
name
):
f
.
write
(
str
(
installation
))
if
filename
!=
'-'
:
...
...
regen-docs
浏览文件 @
97c152c4
...
...
@@ -5,5 +5,5 @@ sphinx-build -E -b html docs/ docs/_build || exit 1
if
[
"
$1
"
=
"publish"
]
;
then
cd
docs/_build
echo
"Uploading files..."
tar
czvf -
.
| ssh flow.openplans.org
'ssh acura.openplans.org "cd /www/p
yinstall
.openplans.org/; tar xzvf -"'
tar
czvf -
.
| ssh flow.openplans.org
'ssh acura.openplans.org "cd /www/p
ip
.openplans.org/; tar xzvf -"'
fi
scripts/pip
0 → 100755
浏览文件 @
97c152c4
#!/usr/bin/env python
import
pip
pip
.
main
()
setup.py
浏览文件 @
97c152c4
...
...
@@ -9,17 +9,17 @@ version = '0.1.5'
doc_dir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'docs'
)
index_filename
=
os
.
path
.
join
(
doc_dir
,
'index.txt'
)
long_description
=
"""\
The main website for p
yinstall is `pyinstall
.openplans.org
<http://p
yinstall
.openplans.org>`_
The main website for p
ip is `pip
.openplans.org
<http://p
ip
.openplans.org>`_
"""
long_description
=
long_description
+
open
(
index_filename
).
read
().
split
(
'split here'
,
1
)[
1
]
setup
(
name
=
'p
yinstall
'
,
setup
(
name
=
'p
ip
'
,
version
=
version
,
description
=
"
Installer for Python packages
"
,
description
=
"
pip installs packages. Python packages. An easy_install replacement
"
,
long_description
=
long_description
,
classifiers
=
[
'Development Status :: 4 - Beta'
,
...
...
@@ -31,11 +31,11 @@ setup(name='pyinstall',
keywords
=
'easy_install distutils setuptools egg virtualenv'
,
author
=
'The Open Planning Project'
,
author_email
=
'python-virtualenv@groups.google.com'
,
url
=
'http://p
yinstall
.openplans.org'
,
url
=
'http://p
ip
.openplans.org'
,
license
=
'MIT'
,
py_modules
=
[
'p
yinstall
'
],
py_modules
=
[
'p
ip
'
],
## FIXME: is this the best way? (Works with distutils, but
## don't we really require setuptools anyway?)
scripts
=
[
'
pyinstall.py
'
],
scripts
=
[
'
scripts/pip
'
],
)
tests/test_all_p
yinstall
.py
→
tests/test_all_p
ip
.py
浏览文件 @
97c152c4
...
...
@@ -5,7 +5,7 @@ import os
import
subprocess
import
shutil
p
yinstall_fn
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
__file__
)),
'pyinstall
.py'
)
p
ip_fn
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
__file__
)),
'pip
.py'
)
def
all_projects
():
data
=
urllib2
.
urlopen
(
'http://pypi.python.org/pypi/'
).
read
()
...
...
@@ -16,7 +16,7 @@ def main(args=None):
if
args
is
None
:
args
=
sys
.
argv
[
1
:]
if
not
args
:
print
'Usage: test_all_p
yinstall
.py <output-dir>'
print
'Usage: test_all_p
ip
.py <output-dir>'
sys
.
exit
(
1
)
output
=
args
[
0
]
if
not
os
.
path
.
exists
(
output
):
...
...
@@ -45,7 +45,7 @@ def test_packages(output, pending_fn):
assert
not
code
,
"virtualenv failed"
print
'Trying installation of %s'
%
dest_dir
code
=
subprocess
.
call
([
os
.
path
.
join
(
dest_dir
,
'bin'
,
'python'
),
p
yinstall
_fn
,
package
])
p
ip
_fn
,
package
])
if
code
:
print
'Installation of %s failed'
%
package
print
'Now checking easy_install...'
...
...
tests/test_p
yinstall
.py
→
tests/test_p
ip
.py
浏览文件 @
97c152c4
...
...
@@ -21,9 +21,9 @@ def reset_env():
env
.
run
(
'%s/bin/easy_install'
%
env
.
base_path
,
'http://peak.telecommunity.com/snapshots/setuptools-0.7a1dev-r66388.tar.gz'
)
env
.
run
(
'mkdir'
,
'src'
)
def
run_p
yinstall
(
*
args
,
**
kw
):
def
run_p
ip
(
*
args
,
**
kw
):
import
sys
args
=
(
'python'
,
'../../p
yinstall.py
'
,
'-E'
,
env
.
base_path
)
+
args
args
=
(
'python'
,
'../../p
ip
'
,
'-E'
,
env
.
base_path
)
+
args
#print >> sys.__stdout__, 'running', ' '.join(args)
if
options
.
show_error
:
kw
[
'expect_error'
]
=
True
...
...
@@ -47,7 +47,7 @@ parser.add_option('--first', action='store_true',
parser
.
add_option
(
'--diff'
,
action
=
'store_true'
,
help
=
'Show diffs in doctest failures'
)
parser
.
add_option
(
'--show-error'
,
action
=
'store_true'
,
help
=
'Show the errors (use expect_error=True in run_p
yinstall
)'
)
help
=
'Show the errors (use expect_error=True in run_p
ip
)'
)
parser
.
add_option
(
'-v'
,
action
=
'store_true'
,
help
=
'Be verbose'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录