Skip to content
This repository was archived by the owner on May 19, 2023. It is now read-only.

Commit 1ba2d19

Browse files
committed
Merge branch 'python'
Significant changes: * Bump version to 0.2 * Install GNU Make (cherry-picked from the msysGit repository) * Mention that R should be installed before running our installer * python: swc-windows-installer.py: Bump version to 0.2 swc-windows-installer.py: Fix "it's hash" -> "its hash" typo swc-windows-installer.py: Add install_msysgit_binary and install Make swc-windows-installer.py: Add a trailing paren to get_r_bin_directory.__doc__ Replace 'Anaconda CE' -> 'Anaconda' Mention that R should be installed before running our installer Conflicts: README.md (due to different usage instructions between the Python branch and the Inno branch).
2 parents 479b79b + ec469fa commit 1ba2d19

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,18 @@ Using
3131
=====
3232

3333
Just have your students download and double-click the compiled
34-
installer. If you're using [R][], you'll have to install R before
35-
running this installer (because this installer searches likely paths
36-
to find R's `bin` directory). Otherwise, you can run it whenever you
37-
like (e.g. either before or after installing [Python][]).
34+
installer. If you're using [R][], you'll have to [install
35+
R][R-install] before running this installer (because this installer
36+
searches likely paths to find R's `bin` directory). Otherwise, you
37+
can run it whenever you like (e.g. either before or after installing
38+
[Python][]).
3839

3940
[msysGit]: http://msysgit.github.io/
4041
[nano]: http://www.nano-editor.org/
4142
[SQLite]: http://www.sqlite.org/
4243
[nosetests]: https://nose.readthedocs.org/en/latest/usage.html
4344
[R]: http://www.r-project.org/
45+
[R-install]: http://cran.r-project.org/bin/windows/base/rw-FAQ.html#Installation-and-Usage
4446
[Python]: https://www.python.org/
4547
[py2exe]: http://py2exe.org/
4648
[inno]: http://www.jrsoftware.org/isinfo.php

swc-windows-installer.py

+24-6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Helps mimic a *nix environment on Windows with as little work as possible.
66
77
The script:
8+
* Installs GNU Make and makes it accessible from msysGit
89
* Installs nano and makes it accessible from msysGit
910
* Installs SQLite and makes it accessible from msysGit
1011
* Creates a ~/nano.rc with links to syntax highlighting configs
@@ -14,11 +15,13 @@
1415
To use:
1516
1617
1. Install Python, IPython, and Nose. An easy way to do this is with
17-
the Anaconda CE Python distribution
18-
http://continuum.io/anacondace.html
18+
the Anaconda Python distribution
19+
http://continuum.io/downloads
1920
2. Install msysGit
2021
https://github.com/msysgit/msysgit/releases
21-
3. Run swc-windows-installer.py.
22+
3. Install R (if your workshop uses R)
23+
http://cran.r-project.org/bin/windows/base/rw-FAQ.html#Installation-and-Usage
24+
4. Run swc-windows-installer.py.
2225
You should be able to simply double click the file in Windows
2326
2427
"""
@@ -41,7 +44,7 @@
4144
import zipfile
4245

4346

44-
__version__ = '0.1'
47+
__version__ = '0.2'
4548

4649
LOG = logging.getLogger('swc-windows-installer')
4750
LOG.addHandler(logging.StreamHandler())
@@ -62,7 +65,7 @@ def open3(file, mode='r', newline=None):
6265

6366

6467
def download(url, sha1):
65-
"""Download a file and verify it's hash"""
68+
"""Download a file and verify its hash"""
6669
LOG.debug('download {}'.format(url))
6770
r = _urlopen(url)
6871
byte_content = r.read()
@@ -141,6 +144,18 @@ def zip_install(url, sha1, install_directory):
141144
LOG.info('existing installation at {}'.format(install_directory))
142145

143146

147+
def install_msysgit_binary(name, sha1, install_directory,
148+
tag='Git-1.9.4-preview20140815'):
149+
"""Download and install a binary from msysGit's bin directory"""
150+
bytes = download(
151+
url='https://github.com/msysgit/msysgit/raw/{}/bin/{}'.format(
152+
tag, name),
153+
sha1=sha1)
154+
LOG.info('installing {} into {}'.format(name, install_directory))
155+
with open(os.path.join(install_directory, name), 'wb') as f:
156+
f.write(bytes)
157+
158+
144159
def install_nano(install_directory):
145160
"""Download and install the nano text editor"""
146161
zip_install(
@@ -197,7 +212,7 @@ def create_nosetests_entry_point(python_scripts_directory):
197212

198213

199214
def get_r_bin_directory():
200-
"""Locate the R bin directory (if R is installed
215+
"""Locate the R bin directory (if R is installed)
201216
"""
202217
version_re = re.compile('^R-(\d+)[.](\d+)[.](\d+)$')
203218
paths = {}
@@ -263,6 +278,9 @@ def main():
263278
nanorc_dir = os.path.join(swc_dir, 'share', 'nanorc')
264279
sqlite_dir = os.path.join(swc_dir, 'lib', 'sqlite')
265280
create_nosetests_entry_point(python_scripts_directory=bin_dir)
281+
install_msysgit_binary(
282+
name='make.exe', sha1='ad11047985c33ff57074f8e09d347fe122e047a4',
283+
install_directory=bin_dir)
266284
install_nano(install_directory=nano_dir)
267285
install_nanorc(install_directory=nanorc_dir)
268286
install_sqlite(install_directory=sqlite_dir)

0 commit comments

Comments
 (0)