Skip to content

Commit 087dea3

Browse files
authored
README: Update formatting and links (gregmalcolm#265)
1 parent 800cdf5 commit 087dea3

File tree

1 file changed

+51
-43
lines changed

1 file changed

+51
-43
lines changed

README.rst

Lines changed: 51 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@ language by making tests pass.
3232

3333
Most tests are *fixed* by filling the missing parts of assert functions. Eg:
3434

35+
.. code-block:: python
36+
3537
self.assertEqual(__, 1+2)
3638
3739
which can be fixed by replacing the __ part with the appropriate code:
3840

41+
.. code-block:: python
42+
3943
self.assertEqual(3, 1+2)
4044
4145
Occasionally you will encounter some failing tests that are already filled out.
@@ -50,11 +54,11 @@ a taste of Test Driven Development (TDD).
5054
Downloading Python Koans
5155
------------------------
5256

53-
Python Koans is available through git on Github:
57+
Python Koans is available on GitHub:
5458

55-
http://github.com/gregmalcolm/python_koans
59+
* https://github.com/gregmalcolm/python_koans
5660

57-
Either site will allow you to download the source as a zip/gz/bz2.
61+
You can clone with Git or download the source as a zip/gz/bz2.
5862

5963

6064
Installing Python Koans
@@ -63,25 +67,25 @@ Installing Python Koans
6367
Aside from downloading or checking out the latest version of Python Koans, you
6468
need to install the Python interpreter.
6569

66-
At this time of writing, we support Python3. The policy is to try to keep
70+
At this time of writing, we support Python 3. The policy is to try to keep
6771
current with the latest production version.
6872

6973
You should be able to work with newer Python versions, but older ones will
7074
likely give you problems.
7175

7276
You can download Python from here:
7377

74-
http://www.python.org/download
78+
* https://www.python.org/downloads/
7579

7680
After installing Python make sure the folder containing the python executable
7781
is in the system path. In other words, you need to be able to run Python from a
78-
command console. It will either be `python3` or for windows it will be `python.exe`.
82+
command console. It will either be ``python3`` or for Windows it will be ``python.exe``.
7983

8084
If you have problems, this may help:
8185

82-
http://www.python.org/about/gettingstarted
86+
* https://www.python.org/about/gettingstarted/
8387

84-
Windows users may also want to update the line in the batch file `run.bat` to
88+
Windows users may also want to update the line in the batch file ``run.bat`` to
8589
set the python path::
8690

8791
SET PYTHON_PATH=C:\Python39
@@ -92,19 +96,23 @@ Getting Started
9296

9397
Jake Hebbert has created a couple of screencasts available here:
9498

95-
http://www.youtube.com/watch?v=e2WXgXEjbHY&list=PL5Up_u-XkWgNcunP_UrTJG_3EXgbK2BQJ&index=1
99+
https://www.youtube.com/watch?v=e2WXgXEjbHY&list=PL5Up_u-XkWgNcunP_UrTJG_3EXgbK2BQJ&index=1
96100

97101
Or if you prefer to read:
98102

99-
From a \*nix terminal or windows command prompt run::
103+
From a \*nix terminal or Windows command prompt run::
104+
105+
.. code-block:: sh
100106
101107
python contemplate_koans.py
102108
103-
or::
109+
or:
110+
111+
.. code-block:: sh
104112
105113
python3 contemplate_koans.py
106114
107-
In my case I'm using Python 3 with windows, so I fire up my command
115+
In my case I'm using Python 3 with Windows, so I fire up my command
108116
shell (cmd.exe) and run this:
109117

110118
.. image:: https://user-images.githubusercontent.com/2614930/28401747-f723ff00-6cd0-11e7-9b9a-a6993b753cf6.png
@@ -114,11 +122,13 @@ Apparently a test failed::
114122
AssertionError: False is not True
115123

116124
It also tells me exactly where the problem is, it's an assert on line 12
117-
of .\\koans\\about_asserts.py. This one is easy, just change False to True to
125+
of ``.\\koans\\about_asserts.py``. This one is easy, just change ``False`` to ``True`` to
118126
make the test pass.
119127

120128
Sooner or later you will likely encounter tests where you are not sure what the
121-
expected value should be. For example::
129+
expected value should be. For example:
130+
131+
.. code-block:: python
122132
123133
class Dog:
124134
pass
@@ -138,40 +148,51 @@ Sniffer Support
138148
Sniffer allows you to run the tests continuously. If you modify any files files
139149
in the koans directory, it will rerun the tests.
140150

141-
To set this up, you need to install sniffer::
151+
To set this up, you need to install sniffer:
152+
153+
.. code-block:: sh
142154
143-
$ pip install sniffer
155+
python3 -m pip install sniffer
144156
145157
You should also run one of these libraries depending on your system. This will
146158
automatically trigger sniffer when a file changes, otherwise sniffer will have
147159
to poll to see if the files have changed.
148160

149-
On Linux::
161+
On Linux:
162+
163+
.. code-block:: sh
150164
151-
$ pip install pyinotify
165+
python3 -m pip install pyinotify
152166
153-
On Windows::
167+
On Windows:
154168

155-
$ pip install pywin32
169+
.. code-block:: sh
170+
171+
python3 -m pip install pywin32
156172
157173
Also available here:
158174
159175
https://github.com/mhammond/pywin32/releases
160176
161-
On Mac OS X::
177+
On macOS:
178+
179+
.. code-block:: sh
180+
181+
python3 -m pip install MacFSEvents
162182
163-
$ pip install MacFSEvents
183+
Once it is set up, you just run:
164184

165-
Once it is set up, you just run::
185+
.. code-block:: sh
166186
167-
$ sniffer
187+
sniffer
168188
169-
Just modify one of the koans files and you'll see that the tests are triggered automatically. Sniffer is controlled by `scent.py`
189+
Just modify one of the koans files and you'll see that the tests are triggered
190+
automatically. Sniffer is controlled by ``scent.py``.
170191

171192
Getting the Most From the Koans
172193
-------------------------------
173194

174-
Quoting the Ruby Koans instructions::
195+
Quoting the Ruby Koans instructions:
175196

176197
"In test-driven development the mantra has always been, red, green,
177198
refactor. Write a failing test and run it (red), make the test pass
@@ -182,28 +203,15 @@ Quoting the Ruby Koans instructions::
182203
and improve the code to better communicate its intent (refactor)."
183204

184205

185-
Content
186-
-------
187-
188-
The Python Koans is a made up of about 2/3 Ruby Koans ported material and 1/3
189-
Python specific tests. The content ported from Ruby Koans includes all the
190-
assignment projects.
191-
192-
Content for Python 3 is a little different to the Python 2 flavor due to big
193-
changes between the two different versions of the language. For example, in
194-
the Python 2 variant the differences between old and new style classes are
195-
covered. This loses relevance in in the Python 3 version, but there are some
196-
extra tests covering new functionality.
197-
198206

199207
Finding More Koan Projects
200208
--------------------------
201209

202210
There are number of other great Koan projects out there for various languages
203-
and frameworks. Most of them can be found in github. Also there is a little
204-
koans activity on bitbucket.
211+
and frameworks. Most of them can be found in GitHub. Also there is a little
212+
koans activity on Bitbucket.
205213

206-
* Github koan projects:
214+
* GitHub koan projects:
207215
https://github.com/search?q=koans&ref=cmdform
208216

209217
* Bitbucket koan projects:
@@ -228,7 +236,7 @@ Also thanks to everyone who has contributed to Python Koans! I got a great
228236
headstart by taking over a code base initiated by the combined Mikes of
229237
FPIP. So here's a little plug for their very cool Python podcast:
230238

231-
http://frompythonimportpodcast.com/
239+
* https://www.frompythonimportpodcast.com/
232240

233241
A big thanks also to Mike Pirnat @pirnat and Kevin Chase @kjc have pitched in
234242
as co-maintainers at various times

0 commit comments

Comments
 (0)