本文整理汇总了Python中setuptools.command.easy_install.main函数的典型用法代码示例。如果您正苦于以下问题:Python main函数的具体用法?Python main怎么用?Python main使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了main函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: win_install_deps
def win_install_deps(options):
"""
Install all Windows Binary automatically
This can be removed as wheels become available for these packages
"""
download_dir = path('downloaded').abspath()
if not download_dir.exists():
download_dir.makedirs()
win_packages = {
# required by transifex-client
"Py2exe": dev_config['WINDOWS']['py2exe'],
"Nose": dev_config['WINDOWS']['nose'],
# the wheel 1.9.4 installs but pycsw wants 1.9.3, which fails to compile
# when pycsw bumps their pyproj to 1.9.4 this can be removed.
"PyProj": dev_config['WINDOWS']['pyproj'],
"lXML": dev_config['WINDOWS']['lxml']
}
failed = False
for package, url in win_packages.iteritems():
tempfile = download_dir / os.path.basename(url)
print "Installing file ... " + tempfile
grab_winfiles(url, tempfile, package)
try:
easy_install.main([tempfile])
except Exception as e:
failed = True
print "install failed with error: ", e
os.remove(tempfile)
if failed and sys.maxsize > 2**32:
print "64bit architecture is not currently supported"
print "try finding the 64 binaries for py2exe, nose, and pyproj"
elif failed:
print "install failed for py2exe, nose, and/or pyproj"
else:
print "Windows dependencies now complete. Run pip install -e geonode --use-mirrors"
开发者ID:atenekom,项目名称:geonode,代码行数:35,代码来源:pavement.py
示例2: win_install_deps
def win_install_deps(options):
"""
Install all Windows Binary automatically
This can be removed as wheels become available for these packages
"""
download_dir = path('downloaded').abspath()
if not download_dir.exists():
download_dir.makedirs()
win_packages = {
# required by transifex-client
"Py2exe": dev_config['WINDOWS']['py2exe'],
"Nose": dev_config['WINDOWS']['nose'],
# the wheel 1.9.4 installs but pycsw wants 1.9.3, which fails to compile
# when pycsw bumps their pyproj to 1.9.4 this can be removed.
"PyProj": dev_config['WINDOWS']['pyproj'],
"lXML": dev_config['WINDOWS']['lxml']
}
failed = False
for package, url in win_packages.iteritems():
tempfile = download_dir / os.path.basename(url)
print "Installing file ... " + tempfile
grab_winfiles(url, tempfile, package)
try:
easy_install.main([tempfile])
except Exception, e:
failed = True
print "install failed with error: ", e
os.remove(tempfile)
开发者ID:Geode,项目名称:geonode,代码行数:28,代码来源:pavement.py
示例3: test_no_setup_cfg
def test_no_setup_cfg(self):
# makes sure easy_install as a command (main)
# doesn't use a setup.cfg file that is located
# in the current working directory
dir = tempfile.mkdtemp()
setup_cfg = open(os.path.join(dir, "setup.cfg"), "w")
setup_cfg.write("[easy_install]\nfind_links = http://example.com")
setup_cfg.close()
setup_py = open(os.path.join(dir, "setup.py"), "w")
setup_py.write(SETUP_PY)
setup_py.close()
from setuptools.dist import Distribution
def _parse_command_line(self):
msg = "Error: a local setup.cfg was used"
opts = self.command_options
if "easy_install" in opts:
assert "find_links" not in opts["easy_install"], msg
return self._old_parse_command_line()
Distribution._old_parse_command_line = Distribution.parse_command_line
Distribution.parse_command_line = _parse_command_line
old_wd = os.getcwd()
try:
os.chdir(dir)
main([])
finally:
os.chdir(old_wd)
shutil.rmtree(dir)
Distribution.parse_command_line = Distribution._old_parse_command_line
开发者ID:JJJJunior,项目名称:Research,代码行数:32,代码来源:test_easy_install.py
示例4: win_install_deps
def win_install_deps(options):
"""
Install all Windows Binary automatically
This can be removed as wheels become available for these packages
"""
download_dir = path('downloaded').abspath()
if not download_dir.exists():
download_dir.makedirs()
win_packages = {
#required by transifex-client
"Py2exe": "http://superb-dca2.dl.sourceforge.net/project/py2exe/py2exe/0.6.9/py2exe-0.6.9.win32-py2.7.exe",
"Nose": "https://s3.amazonaws.com/geonodedeps/nose-1.3.3.win32-py2.7.exe",
#the wheel 1.9.4 installs but pycsw wants 1.9.3, which fails to compile
#when pycsw bumps their pyproj to 1.9.4 this can be removed.
"PyProj": "https://pyproj.googlecode.com/files/pyproj-1.9.3.win32-py2.7.exe"
}
failed = False
for package, url in win_packages.iteritems():
tempfile = download_dir / os.path.basename(url)
grab_winfiles(url, tempfile, package)
try:
easy_install.main([tempfile])
except Exception, e:
failed = True
print "install failed with error: ", e
os.remove(tempfile)
开发者ID:GavinDu,项目名称:geonode,代码行数:26,代码来源:pavement.py
示例5: check_evoque_qpy
def check_evoque_qpy():
try:
import evoque
except ImportError:
prompt='Goliat uses evoque as template engine.\n\n'+\
'Would you like to install evoque now?'
if userquery(prompt)=="Yes":
currdir=os.getcwd()
os.chdir('evoque-0.4')
from subprocess import Popen, PIPE
p=Popen('python2.6 setup.py {0}'.format(args[0]).split(' '), stdout=PIPE, stderr=PIPE)
print '\n{0}ing Goliat Evoque\n'.format(args[0].capitalize())
ret=p.communicate()
if len(ret[1]):
print ret[1]
print '\nQuitting.'
sys.exit(1)
print ret[0]
print '\nContinue.\n'
os.chdir(currdir)
#from setuptools.command.easy_install import main
#main(['evoque'])
#print '\nContinue.\n'
try:
import qpy
except ImportError:
prompt='Goliat uses qpy with evoque.\n\n'+\
'Would you like to install qpy now?'
if userquery(prompt)=="Yes":
from setuptools.command.easy_install import main
main(['qpy'])
print '\nContinue.\n'
开发者ID:DamnWidget,项目名称:goliat,代码行数:33,代码来源:setup.py
示例6: win_install_deps
def win_install_deps(options):
"""
Install all Windows Binary automatically
"""
download_dir = path('downloaded').abspath()
if not download_dir.exists():
download_dir.makedirs()
win_packages = {
"PIL": "https://pypi.python.org/packages/2.7/P/Pillow/Pillow-2.5.1.win32-py2.7.exe",
"Py2exe": "http://superb-dca2.dl.sourceforge.net/project/py2exe/py2exe/0.6.9/py2exe-0.6.9.win32-py2.7.exe",
"Nose": "https://s3.amazonaws.com/geonodedeps/nose-1.3.3.win32-py2.7.exe",
"LXML": "https://pypi.python.org/packages/2.7/l/lxml/lxml-3.3.5.win32-py2.7.exe",
"GDAL": "https://s3.amazonaws.com/geonodedeps/GDAL-1.11.0.win32-py2.7.exe",
"PyProj": "https://pyproj.googlecode.com/files/pyproj-1.9.3.win32-py2.7.exe",
"Shapely": "https://pypi.python.org/packages/2.7/S/Shapely/Shapely-1.3.0.win32-py2.7.exe",
"Psycopg2": "http://www.stickpeople.com/projects/python/win-psycopg/psycopg2-2.4.5.win32-py2.7-pg9.1.3-release.exe"
}
for package, url in win_packages.iteritems():
tempfile = download_dir / os.path.basename(url)
grab_winfiles(url, tempfile, package)
try:
easy_install.main([tempfile])
except:
print "install failed"
os.remove(tempfile)
print "Windows dependencies now complete. Run pip install -e geonode --use-mirrors"
开发者ID:isralopez,项目名称:geonode,代码行数:27,代码来源:pavement.py
示例7: install
def install(name):
sys.stdout = sys.stderr = ei_stdout = StringIO()
try:
easy_install.main(["--install-dir", packages_dir,
"--exclude-scripts",
name])
except SystemExit as e:
output = ei_stdout.getvalue()
tb = StringIO()
traceback.print_exc(8, tb)
return {
"success": False,
"error": unicode(e),
"traceback": tb.getvalue(),
"output": output,
}
finally:
sys.stdout = sys.__stdout__
sys.stderr = sys.__stderr__
for name in os.listdir(packages_dir):
path = os.path.join(packages_dir, name)
if path not in sys.path:
sys.path.insert(0, path)
return {
"success": True,
"output": ei_stdout.getvalue(),
}
开发者ID:blockext,项目名称:tangerine,代码行数:29,代码来源:installer.py
示例8: easyInstall
def easyInstall(package):
"""
Generic method to install a package using the easy_install module, only if
required.
"""
sys.stdout.write('\nSearching for installed %s ... ' % package)
sys.stdout.flush()
notFound = False
try:
__import__(package)
sys.stdout.write('[FOUND]')
except ImportError:
sys.stdout.write('[NOT FOUND]')
notFound = True
if notFound:
sys.stdout.write('\nInstalling %s:\n' % package)
try:
easy_install.main( ["-U", package] )
sys.stdout.write('[OK]\n')
except:
print "\nUnexpected error when trying to easy_install %s:\n" % (package), sys.exc_info()[0], sys.exc_info()[1]
raise
sys.stdout.flush()
开发者ID:raycecarr,项目名称:TweetDreams,代码行数:25,代码来源:install.py
示例9: install_extension
def install_extension(self, install_url, package_name):
"""Install an extension from a remote source.
Installs an extension from a remote URL containing the
extension egg. Installation may fail if a malformed install_url
or package_name is passed, which will cause an InstallExtensionError
exception to be raised. It is also assumed that the extension is not
already installed.
"""
try:
easy_install.main(["-U", install_url])
# Update the entry points.
dist = pkg_resources.get_distribution(package_name)
dist.activate()
pkg_resources.working_set.add(dist)
except pkg_resources.DistributionNotFound:
raise InstallExtensionError(_("Invalid package name."))
except SystemError:
raise InstallExtensionError(
_('Installation failed (probably malformed URL).'))
# Refresh the extension manager.
self.load(True)
开发者ID:halvorlu,项目名称:djblets,代码行数:25,代码来源:manager.py
示例10: DoEasyUninstall
def DoEasyUninstall(name):
"""
Execute the easy_install command to unlink the given egg.
What this is really doing is switching the egg to be in
multiple-version mode, however this is the first step in deleting
an egg as described here:
http://peak.telecommunity.com/DevCenter/EasyInstall#uninstalling-packages
"""
from setuptools.command import easy_install
args = ['--site-dirs', zenPath('ZenPacks'),
'-d', zenPath('ZenPacks'),
#'--record', tempPath,
'--quiet',
'-m',
name]
#Try to run the easy install command. If this fails with an attribute
#error, then we know that easy_install doesn't know about this ZenPack and
#we can continue normally
try:
easy_install.main(args)
except AttributeError:
log.info("%s not found by easy_install. Continuing to remove." % name)
pass
开发者ID:bbc,项目名称:zenoss-prodbin,代码行数:25,代码来源:ZenPackCmd.py
示例11: run
def run(self):
# Workaround for problem in six that prevents installation when part of
# of some package requirements
_easy_install.main(['-U', 'six'])
_install.run(self)
self.execute(
_post_install, (self.install_lib,),
msg="\nRunning post install tasks...")
开发者ID:jidar,项目名称:opencafe,代码行数:9,代码来源:setup.py
示例12: FetchZenPack
def FetchZenPack(dmd, zenPackName):
"""
Use easy_install to retrieve the given zenpack and any dependencies.
easy_install will install the eggs, but does not install them into
Zenoss as ZenPacks.
Return a list of distributions just installed that appear to be
ZenPacks.
NB: This should be refactored. It shares most of its code with
DoEasyInstall()
"""
from setuptools.command import easy_install
# Make sure $ZENHOME/ZenPacks exists
CreateZenPacksDir()
# Create the proper package index URL.
index_url = "%s/%s/%s/" % (ZENPACKS_BASE_URL, dmd.uuid, ZVersion.VERSION)
# Create temp file for easy_install to write results to
_, tempPath = tempfile.mkstemp(prefix="zenpackcmd-easyinstall")
# eggPaths is a set of paths to eggs that were installed. We need to
# add them to the current workingset so we can discover their
# entry points.
eggPaths = set()
try:
# Execute the easy_install
args = [
"--site-dirs",
zenPath("ZenPacks"),
"-d",
zenPath("ZenPacks"),
"-i",
index_url,
"--allow-hosts",
urlparse(index_url).hostname,
"--record",
tempPath,
"--quiet",
zenPackName,
]
easy_install.main(args)
# Collect the paths for eggs that were installed
f = open(tempPath, "r")
marker = ".egg/"
markerOffset = len(marker) - 1
for l in f.readlines():
i = l.find(marker)
if i > 0:
eggPaths.add(l[: i + markerOffset])
finally:
os.remove(tempPath)
# Add any installed eggs to the current working set
zpDists = []
for path in eggPaths:
zpDists += AddDistToWorkingSet(path)
return zpDists
开发者ID:jpeacock-zenoss,项目名称:zenoss-prodbin,代码行数:57,代码来源:ZenPackCmd.py
示例13: installModule
def installModule(self, module):
try:
easy_install.main([module])
except:
print colored('''[%s] [-] Error installing %s module. Possibly setuptools module is not installed.
Please visit https://pypi.python.org/pypi/setuptools to download setuptools, and try again.
Exiting...''' % (time.strftime('%H:%M:%S'), module), 'red')
exit()
else:
print colored('[%s] [+] %s module has been sucessfully installed' %(time.strftime('%H:%M:%S'), module), 'green')
开发者ID:HugoSTorres,项目名称:Barry_CS-471,代码行数:10,代码来源:classes.py
示例14: easy
def easy(eas=easy_pack):
color="BLUE"
message = forma.line("Install i moduli di Python: ")
print (colorstr(message, color))
for i in eas:
temp_message= "Installazione di "+i+" in corso: "
message = forma.line(temp_message)
print (colorstr(message, color))
easy_install.main(["-U", i])
message = forma.line("moduuli installati correttamente!!")
print (colorstr(message, color))
开发者ID:stanzinofree,项目名称:Digital_Archive_Creator,代码行数:11,代码来源:setup_modules.py
示例15: install_with_easyinstall
def install_with_easyinstall(package):
try:
__import__(package)
in_system.append(package)
except ImportError:
print 'Installing ' + package + '...'
try:
easy_install.main(['-U', package])
installed.append(package)
except Exception:
problematic.append(package)
开发者ID:Xifax,项目名称:ransukan,代码行数:11,代码来源:install.py
示例16: install_dependencies
def install_dependencies():
from setuptools.command import easy_install
import pkg_resources
easy_install.main( ['setuptools',
'sqlalchemy',
'alembic',
'tornado >= 3.1',
'simplejson >= 1.9.2',
'WTForms >= 2.0',
'WTForms-Components',
'pillow'
])
开发者ID:ka2er,项目名称:domoweb,代码行数:12,代码来源:install.py
示例17: find_module
def find_module(self, fullname, path=None):
if fullname in self.domain_modules:
return self
if fullname in self.tried_modules:
return None
else:
self.tried_modules.add(fullname)
try:
main([fullname])
return self
except:
return None
开发者ID:mdipierro,项目名称:autoinstaller,代码行数:12,代码来源:autoinstaller.py
示例18: run
def run(self):
develop.develop.run(self)
# create symlink to legacy MaKaC dir
# this is so that the ".egg-link" created by the "develop" command works
if sys.platform in ["linux2", "darwin"] and not os.path.exists('MaKaC'):
os.symlink('indico/MaKaC', 'MaKaC')
# install dev dependencies
env = pkg_resources.Environment()
easy_install.main(read_requirements_file(os.path.join(os.path.dirname(__file__), 'requirements.dev.txt')))
env.scan()
开发者ID:pferreir,项目名称:indico-backup,代码行数:12,代码来源:setup.py
示例19: run
def run(self):
develop.develop.run(self)
# create symlink to legacy MaKaC dir
# this is so that the ".egg-link" created by the "develop" command works
if sys.platform in ["linux2", "darwin"] and not os.path.exists('MaKaC'):
os.symlink('indico/MaKaC', 'MaKaC')
# install dev dependencies
env = pkg_resources.Environment()
easy_install.main(DEVELOP_REQUIRES)
env.scan()
开发者ID:Json-Andriopoulos,项目名称:indico,代码行数:12,代码来源:setup.py
示例20: install_dependencies
def install_dependencies():
from setuptools.command import easy_install
easy_install.main( ['setuptools',
'django == 1.4',
'django-tastypie == 0.9.11',
'django-tables2',
'simplejson >= 1.9.2',
'httplib2 >= 0.6.0',
'Distutils2',
'CherryPy >= 3.2.2',
'south',
'manifesto',
'requests'])
开发者ID:capof,项目名称:domoweb,代码行数:13,代码来源:install.py
注:本文中的setuptools.command.easy_install.main函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论