swc-installation-test-2.py: Prefer distro to platform.linux_distribution
[swc-setup-installation-test.git] / README.md
1 For learners
2 ============
3
4 This directory contains scripts for testing your machine to make sure
5 you have the software you'll need for your workshop installed.  See
6 the comments at the head of each script for more details, but you'll
7 basically want to see something like:
8
9     $ python swc-installation-test-1.py
10     Passed
11     $ python swc-installation-test-2.py
12     check virtual-shell...  pass
13     …
14     Successes:
15
16     virtual-shell Bourne Again Shell (bash) 4.2.37
17     …
18
19 If you see something like:
20
21     $ python swc-installation-test-2.py
22     check virtual-shell...  fail
23     …
24     check for command line shell (virtual-shell) failed:
25       command line shell (virtual-shell) requires at least one of the following dependencies
26       For instructions on installing an up-to-date version, see
27       http://software-carpentry.org/setup/
28       causes:
29       check for Bourne Again Shell (bash) failed:
30         could not find 'bash' executable for Bourne Again Shell (bash)
31         For instructions on installing an up-to-date version, see
32         http://software-carpentry.org/setup/
33     …
34
35 follow the suggestions to try and install any missing software.  For
36 additional troubleshooting information, you can use the `--verbose`
37 option:
38
39     $ python swc-installation-test-2.py --verbose
40     check virtual-shell...  fail
41     …
42     ==================
43     System information
44     ==================
45     os.name            : posix
46     …
47
48 For instructors
49 ===============
50
51 `swc-installation-test-1.py` is pretty simple, and just checks that
52 the students have a recent enough version of Python installed that
53 they'll be able to parse `swc-installation-test-2.py`.  The latter
54 checks for a list of dependencies and prints error messages if a
55 package is not installed, or if the installed version is not current
56 enough.  By default, the script checks for pretty much anything that
57 has ever been used at a Software Carpentry workshop, which is probably
58 not what you want for your particular workshop.
59
60 Before your workshop, you should go through
61 `swc-installation-test-2.py` and comment any dependencies you don't
62 need out of the `CHECKS` list.  You might also want to skim through
63 the minimum version numbers listed where particular dependencies are
64 defined (e.g. `('git', 'Git', (1, 7, 0), None)`).  For the most part,
65 fairly conservative values have been selected, so students with modern
66 machines should be fine.  If your workshop has stricter version
67 requirements, feel free to bump them accordingly.
68
69 Similarly, the virtual dependencies can be satisfied by any of several
70 packages.  If you don't want to support a particular package (e.g. if
71 you have no Emacs experience and don't want to be responsible for
72 students who show up with Emacs as their only editor), you can comment
73 out that particular `or_dependency`.
74
75 Finally, don't forget to post your modified scripts somewhere where
76 your students can download them!