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

Commit

Permalink
update setup for tdm
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Sep 8, 2015
1 parent 8c86910 commit d71f532
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/pymyinstall/installhelper/__init__.py
Expand Up @@ -9,7 +9,7 @@
from .install_custom_7z import install_7z
from .install_custom_julia import install_julia
from .install_custom_mingw import install_mingw
from .install_custom_tgm_gcc import install_tgm_gcc
from .install_custom_tdm_gcc import install_tdm_gcc
from .install_custom_pandoc import install_pandoc
from .install_custom_putty import install_putty
from .install_custom_python import install_python
Expand Down
@@ -1,6 +1,6 @@
"""
@file
@brief Various functions to install `TGM-GCC <http://tdm-gcc.tdragon.net/>`_.
@brief Various functions to install `TDM-GCC <http://tdm-gcc.tdragon.net/>`_.
"""
from __future__ import print_function
import sys
Expand All @@ -10,9 +10,9 @@
from .install_custom import download_page, download_from_sourceforge


def install_tgm_gcc(dest_folder=".", fLOG=print, install=False, version=None):
def install_tdm_gcc(dest_folder=".", fLOG=print, install=False, version=None):
"""
install `TGM-GCC <http://tdm-gcc.tdragon.net/>`_ (only on Windows)
install `TDM-GCC <http://tdm-gcc.tdragon.net/>`_ (only on Windows)
@param dest_folder where to download the setup
@param fLOG logging function
Expand All @@ -30,7 +30,7 @@ def install_tgm_gcc(dest_folder=".", fLOG=print, install=False, version=None):
raise ValueError("cannot specify a version")
if not sys.platform.startswith("win"):
raise NotImplementedError(
"TGM-GCC can only be installed on Windows at the moment")
"TDM-GCC can only be installed on Windows at the moment")

url = "http://tdm-gcc.tdragon.net/download"
page = download_page(url, is406=True)
Expand All @@ -46,7 +46,7 @@ def install_tgm_gcc(dest_folder=".", fLOG=print, install=False, version=None):
newurl = "http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/{0}/download?use_mirror=autoselect".format(
name)
outfile = os.path.join(dest_folder, name)
fLOG("tgm-gcc, download from ", newurl)
fLOG("tdm-gcc, download from ", newurl)
file = download_from_sourceforge(
newurl,
outfile,
Expand Down
2 changes: 1 addition & 1 deletion src/pymyinstall/packaged/packaged_config_3_extended.py
Expand Up @@ -223,7 +223,7 @@ def extended_set():
purpose="ploting, Multidimensional data visualzation across files", usage="DATA/ML"),
#
# javascript graphs
ModuleInstall("pandas_highcharts", "pip",
ModuleInstall("pandas-highcharts", "pip", mname="pandas_highcharts",
purpose="plotting in javascript and pandas", usage="VIZ"),
#
ModuleInstall(
Expand Down
2 changes: 1 addition & 1 deletion src/pymyinstall/packaged/packaged_config_4_ml.py
Expand Up @@ -285,7 +285,7 @@ def ensae_set():
ModuleInstall(
"azureml", "pip", purpose="Python wrapper for Azure ML API (Azure ML Pipeline)", usage="AZURE"),
ModuleInstall(
"azure_batch_apps", "pip", usage="AZURE", mname="batchapps",
"azure-batch-apps", "pip", usage="AZURE", mname="batchapps",
purpose="Python wrapper for Azure ML API (Azure ML Pipeline)"),
#
#
Expand Down
8 changes: 4 additions & 4 deletions src/pymyinstall/win_installer/win_setup_main.py
Expand Up @@ -82,7 +82,7 @@ def win_python_setup(folder="dist/win_python_setup_" + architecture(),
download_only=False,
no_setup=False,
notebooks=None,
selection={"R", "mingw", "tgm"},
selection={"R", "mingw", "tdm"},
documentation=True,
last_function=None,
r_packages=True,
Expand Down Expand Up @@ -115,7 +115,7 @@ def win_python_setup(folder="dist/win_python_setup_" + architecture(),
* `R <http://www.r-project.org/>`_
* `Julia <http://julialang.org/>`_
* `MinGW <http://www.mingw.org/>`_
* `TGM-GCC <http://tdm-gcc.tdragon.net/>`_
* `TDM-GCC <http://tdm-gcc.tdragon.net/>`_
* `VS <https://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx>`_
By default, only R is included. Julia requires too much work.
Expand Down Expand Up @@ -160,7 +160,7 @@ def last_function(inno_script, folders, verbose=False, fLOG=print):
* 7z setup needs a last click to complete
* pandoc needs a last click to complete
* R must be manually installed in the right folder
* TGM-GCC is manually installed in the right folder
* TDM-GCC is manually installed in the right folder
* Julia produces a file exe, for the time being it must be done manually
* MinGW is also installed manually, the command line is different from others tools,
once it is installed, you should run the command line::
Expand Down Expand Up @@ -250,7 +250,7 @@ def last_function(inno_script, folders, verbose=False, fLOG=print):
selection = set(_.lower() for _ in selection)

_allowed = {"pandoc", "7z", "scite", "putty",
"sqlitespy", "scite", "python", "tgm", "vs", "r"}
"sqlitespy", "scite", "python", "tdm", "vs", "r"}
for s in selection:
s_ = s.split("==")[0]
if s_ not in _allowed:
Expand Down
35 changes: 17 additions & 18 deletions src/pymyinstall/win_installer/win_setup_main_helper.py
Expand Up @@ -18,7 +18,7 @@
from ..installhelper.install_custom_sqlitespy import install_sqlitespy
from ..installhelper.install_custom_python import install_python
from ..installhelper.install_custom_mingw import install_mingw
from ..installhelper.install_custom_tgm_gcc import install_tgm_gcc
from ..installhelper.install_custom_tdm_gcc import install_tdm_gcc
from ..installhelper.install_custom_7z import install_7z
from ..installhelper.install_custom_vs import install_vs
from ..installhelper.install_custom import download_page
Expand Down Expand Up @@ -117,10 +117,10 @@ def is_here(program):
operations.append(("download", r))
fLOG("done")

if not is_here("tgm") and "tgm" in selection:
fLOG("--- download", "tgm")
r = install_tgm_gcc(dest_folder=folder, fLOG=fLOG,
install=False, version=selection.get("tgm", None))
if not is_here("tdm") and "tdm" in selection:
fLOG("--- download", "tdm")
r = install_tdm_gcc(dest_folder=folder, fLOG=fLOG,
install=False, version=selection.get("tdm", None))
operations.append(("download", r))
fLOG("done")

Expand Down Expand Up @@ -198,7 +198,7 @@ def win_install(folders,
verbose=False,
fLOG=print,
names=[
"Julia", "Scite", "7z", "TGM", "MinGW", "R", "pandoc", "Python", "SQLiteSpy", "VS", "Putty"],
"Julia", "Scite", "7z", "TDM", "MinGW", "R", "pandoc", "Python", "SQLiteSpy", "VS", "Putty"],
selection=None):
"""
Install setups
Expand Down Expand Up @@ -232,23 +232,20 @@ def location(file):
return None

def find_exe(loc, name):
exes = []
for root, dirnames, filenames in os.walk(loc):
for filename in fnmatch.filter(filenames, '*.exe'):
exes.append(os.path.join(root, filename))

name = name.lower()
if name.lower() == "mingw":
name = "gcc"
elif name.lower() == "tdm":
name = "gcc"
exp = name + ".exe"
found = None

for exe in exes:
file = os.path.split(exe)[-1].lower()
if file == exp:
found = exe
break
return found
for root, dirnames, filenames in os.walk(loc):
for filename in fnmatch.filter(filenames, '*.exe'):
exe = os.path.join(root, filename)
file = os.path.split(exe)[-1].lower()
if file == exp:
return exe
return None

# we sort to get 7z installed first as it is needed for exe files
cands = os.listdir(download_folder)
Expand All @@ -274,6 +271,8 @@ def find_exe(loc, name):
else:
fLOG("--- install", cand, " in ", loc)
full = os.path.join(download_folder, cand)
if 'tdm' in cand and 'gcc' in cand:
raise WinInstallException("TM must be manually installed from the setup\n{0}\nin\n{1}".format(full, loc))
ext = os.path.splitext(cand)[-1]
filename = os.path.split(cand)[-1]
func = dfunc.get(filename, dfunc[ext])
Expand Down

0 comments on commit d71f532

Please sign in to comment.