Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
add function small_installation + parameter skip
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Aug 13, 2014
1 parent e5362e9 commit 9455621
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 15 deletions.
6 changes: 5 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Description
This module contains functions which install a module from pipy, using pip or from a setup::

from pymyinstall import datascientist
datascientist ("install")
datascientist("install", full = True)
Or::

Expand All @@ -45,6 +45,10 @@ This project contains various helper about logging functions, unit tests and hel
Versions
--------

* **v0.5 - 2014/08/13**
* **new:** a couple of new modules in the full set of modules
* **new:** a subset of modules to work with ipython
* **add:** add parameter ``skip`` to function ``datascientist``
* **v0.4 - 2014/07/27**
* **new:** add a function to install SQLiteSpy, see :func:`install_sqlitespy <installhelper.install_custom_sqlitespy.install_sqlitespy>`
* **new:** add a function to install SciTE, see :func:`install_scite <installhelper.install_custom_scite.install_scite>`
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
subversion = 1

project_var_name = "pymyinstall"
sversion = "0.4"
sversion = "0.5"
versionPython = "%s.%s" % (sys.version_info.major, sys.version_info.minor)
path = "Lib/site-packages/" + project_var_name
readme = 'README.rst'
Expand Down
24 changes: 16 additions & 8 deletions src/pymyinstall/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@endcode
"""

__version__ = "0.4"
__version__ = "0.5"
__author__ = "Xavier Dupré"
__github__ = "https://github.com/sdpython/pymyinstall"
__url__ = "http://www.xavierdupre.fr/app/pymyinstall/helpsphinx/index.html"
Expand Down Expand Up @@ -43,6 +43,8 @@ def datascientist( folder = "install",
shortcuts = True,
fLOG = print,
browser = None,
skip = [],
full = False,
additional_path = []):
"""
Expand All @@ -59,11 +61,13 @@ def datascientist( folder = "install",
@param pandoc install pandoc
@param shortcuts add shortcuts on the desktop (scite, ipython, spyder)
@param browser browser to use for the notebooks if not the default one (ie, firefox, chrome)
@param skip to skip some modules if they fail
@param full if True, install many modules including the ones used to generate the documentation
@example(Install manything for a Data Scientist)
@code
from pymyinstall import datascientist
datascientist ("install")
datascientist ("install", full=True)
@endcode
@endexample
Expand All @@ -79,8 +83,12 @@ def datascientist( folder = "install",
"""
if modules :
for _ in complete_installation() :
_.install(temp_folder=folder)
modules = complete_installation() if full else small_installation()
for _ in modules :
if _.name in skip or _.mname in skip :
fLOG("skip module", _.name, " import name:", _.mname)
else :
_.install(temp_folder=folder)

if website :
get_install_list()
Expand All @@ -98,13 +106,13 @@ def datascientist( folder = "install",
install_sqlitespy(folder, fLOG = fLOG)

if shortcuts :
if ipython : add_shortcut_to_desktop_for_ipython(ipython_folder)
if scite : add_shortcut_to_desktop_for_scite(scite)
if ipython : add_shortcut_to_desktop_for_module("spyder")
if ipython : add_shortcut_to_desktop_for_ipython(ipython_folder)
if scite : add_shortcut_to_desktop_for_scite(scite)
if ipython : add_shortcut_to_desktop_for_module("spyder")
if sqlitespy: add_shortcut_to_desktop_for_sqlitespy(sqlitespy)


from .installhelper.install_cmd import run_cmd, ModuleInstall, complete_installation, unzip_files, add_shortcut_to_desktop_for_module
from .installhelper.install_cmd import run_cmd, ModuleInstall, complete_installation, unzip_files, add_shortcut_to_desktop_for_module, small_installation
from .installhelper.install_custom import download_from_sourceforge, download_file, download_page
from .installhelper.install_manual import get_install_list, open_tool_on_browser
from .setuphelper.ipython_helper import setup_ipython, add_shortcut_to_desktop_for_ipython
Expand Down
68 changes: 64 additions & 4 deletions src/pymyinstall/installhelper/install_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,8 @@ def add_shortcut_to_desktop_for_module(name):

def complete_installation():
"""
returns a list of module to install to get
returns a list of modules to install, an rich set
to work with data and more
@return a list of modules to install
Expand Down Expand Up @@ -624,6 +625,7 @@ def complete_installation():
ModuleInstall("prettyplotlib", "pip"),
ModuleInstall("bokeh", "pip"),
ModuleInstall("shapely", "pip"),
ModuleInstall("vispy", "pip"),
#
ModuleInstall("rpy2", "exe"),
ModuleInstall("pythonnet", "exe", mname="clr"),
Expand All @@ -637,7 +639,7 @@ def complete_installation():
ModuleInstall("markupsafe", "pip"),
ModuleInstall("requests", "pip"),
ModuleInstall("Kivy", "exe"),
ModuleInstall("PyQt", "exe", mname="pyqt"),
ModuleInstall("PyQt", "exe", mname="PyQt4"),
ModuleInstall("spyder", "exe", script="spyder.bat"),
#
ModuleInstall("py4j", "pip"),
Expand All @@ -657,6 +659,7 @@ def complete_installation():
ModuleInstall("sphinx_bootstrap_theme", "pip"),
#
ModuleInstall("dbfreader", "pip"), # to read dbase format
ModuleInstall("antlr4-python3-runtime", "pip", mname="antlr4"),

#
#ModuleInstall("pyrsslocal", "github", "sdpython"),
Expand All @@ -676,8 +679,65 @@ def complete_installation():

return mod

if __name__ == "__main__" :
import pyreadline
def small_installation():
"""
returns a list of modules to work with pandas and ipython.
@return a list of modules to install
To install them:
@code
for _ in complete_installation() :
_.install(temp_folder="install")
@endcode
"""
mod = [
ModuleInstall("setuptools", "exe"),
#
ModuleInstall("six", "pip"),
ModuleInstall("lxml", "exe"),
ModuleInstall("jinja2", "pip"),
ModuleInstall("pygments", "pip"),
ModuleInstall("pyparsing", "pip"),
ModuleInstall("python-dateutil","pip", "dateutil"),
ModuleInstall("html5lib", "pip"),
ModuleInstall("beautifulsoup4", "pip", mname="bs4"),
ModuleInstall("coverage", "pip"),
ModuleInstall("pytz", "pip"),
ModuleInstall("pyreadline", "pip",mname="pyreadline"),
#
ModuleInstall("openpyxl", "pip", version="1.8.6"),
#
ModuleInstall("tornado", "exe"),
ModuleInstall("pyzmq", "exe", mname="zmq"),
#
ModuleInstall("pycparser", "exe"),
ModuleInstall("Cython", "exe"),
ModuleInstall("numpy", "exe"),
ModuleInstall("matplotlib", "exe"),
#
ModuleInstall("pandas", "exe"),
ModuleInstall("scikit-learn", "exe", mname="sklearn"),
ModuleInstall("ipython", "exe"),
#
ModuleInstall("ggplot", "pip"),
ModuleInstall("plotly", "pip"),
#
ModuleInstall("pyquickhelper", "github", "sdpython"),
ModuleInstall("pyensae", "github", "sdpython"),
#
ModuleInstall("requests", "pip"),
ModuleInstall("PyQt", "exe", mname="PyQt4"),
ModuleInstall("spyder", "exe", script="spyder.bat"),
#
#
ModuleInstall("dbfreader", "pip"), # to read dbase format
]

if sys.platform.startswith("win"):
mod.append ( ModuleInstall("pywin32", "exe", mname = "win32com") )
mod.append ( ModuleInstall("winshell", "pip") )

return mod


2 changes: 1 addition & 1 deletion src/pymyinstall/installhelper/install_custom_scite.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys, re, platform, os, urllib, urllib.request, imp, zipfile,time, subprocess

from .install_cmd import run_cmd, ModuleInstall, unzip_files
from .install_custom import download_page
from .install_custom import download_page, download_from_sourceforge
from .link_shortcuts import add_shortcut_to_desktop, suffix

def IsSciteInstalled(dest_folder):
Expand Down

0 comments on commit 9455621

Please sign in to comment.