@@ -44,11 +44,26 @@ basis to help users test bleeding edge features or bug fixes::
44
44
Building from source
45
45
=====================
46
46
47
+ In the vast majority of cases, building scikit-learn for development purposes
48
+ can be done with::
49
+
50
+ pip install cython pytest flake8
51
+
52
+ Then, in the main repository::
53
+
54
+ pip install --editable .
55
+
56
+ Please read below for details and more advanced instructions.
57
+
58
+ Dependencies
59
+ ------------
60
+
47
61
Scikit-learn requires:
48
62
49
63
- Python (>= 3.5),
50
64
- NumPy (>= 1.11),
51
- - SciPy (>= 0.17).
65
+ - SciPy (>= 0.17),
66
+ - Joblib (>= 0.11).
52
67
53
68
.. note ::
54
69
@@ -93,12 +108,12 @@ If you want to build a stable version, you can ``git checkout <VERSION>``
93
108
to get the code for that particular version, or download an zip archive of
94
109
the version from github.
95
110
96
- If you have all the build requirements installed (see below for details), you
97
- can build and install the package in the following way.
111
+ Once you have all the build requirements installed (see below for details),
112
+ you can build and install the package in the following way.
98
113
99
114
If you run the development version, it is cumbersome to reinstall the
100
115
package each time you update the sources. Therefore it's recommended that you
101
- install in editable, which allows you to edit the code in-place. This
116
+ install in editable mode , which allows you to edit the code in-place. This
102
117
builds the extension in place and creates a link to the development directory
103
118
(see `the pip docs <https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs >`_)::
104
119
@@ -112,16 +127,16 @@ builds the extension in place and creates a link to the development directory
112
127
113
128
.. note ::
114
129
115
- If you decide to do an editable install you have to rerun ::
130
+ You will have to re-run ::
116
131
117
132
pip install --editable .
118
133
119
- every time the source code of a compiled extension is
120
- changed (for instance when switching branches or pulling changes from upstream).
134
+ every time the source code of a compiled extension is changed (for
135
+ instance when switching branches or pulling changes from upstream).
136
+ Compiled extensions are Cython files (ending in `.pyx ` or `.pxd `).
121
137
122
- On Unix-like systems, you can simply type ``make `` in the top-level folder to
123
- build in-place and launch all the tests. Have a look at the ``Makefile `` for
124
- additional utilities.
138
+ On Unix-like systems, you can equivalently type ``make in `` from the
139
+ top-level folder. Have a look at the ``Makefile `` for additional utilities.
125
140
126
141
Mac OSX
127
142
-------
@@ -284,58 +299,3 @@ build step::
284
299
python setup.py build --compiler=my_compiler install
285
300
286
301
where ``my_compiler `` should be one of ``mingw32 `` or ``msvc ``.
287
-
288
-
289
- .. _testing :
290
-
291
- Testing
292
- =======
293
-
294
- Testing scikit-learn once installed
295
- -----------------------------------
296
-
297
- Testing requires having `pytest <https://docs.pytest.org >`_ >=\ |PytestMinVersion |\ .
298
- Some tests also require having `pandas <https://pandas.pydata.org/> ` installed.
299
- After installation, the package can be tested by executing *from outside * the
300
- source directory::
301
-
302
- $ pytest sklearn
303
-
304
- This should give you a lot of output (and some warnings) but
305
- eventually should finish with a message similar to::
306
-
307
- =========== 8304 passed, 26 skipped, 4659 warnings in 557.76 seconds ===========
308
-
309
- Otherwise, please consider posting an issue into the `GitHub issue tracker
310
- <https://github.com/scikit-learn/scikit-learn/issues> `_ or to the
311
- :ref: `mailing_lists ` including the traceback of the individual failures
312
- and errors. Please include your operating system, your version of NumPy, SciPy
313
- and scikit-learn, and how you installed scikit-learn.
314
-
315
-
316
- Testing scikit-learn from within the source folder
317
- --------------------------------------------------
318
-
319
- Scikit-learn can also be tested without having the package
320
- installed. For this you must compile the sources inplace from the
321
- source directory::
322
-
323
- python setup.py build_ext --inplace
324
-
325
- Test can now be run using pytest::
326
-
327
- pytest sklearn
328
-
329
- This is automated by the commands::
330
-
331
- make in
332
-
333
- and::
334
-
335
- make test
336
-
337
-
338
- You can also install a symlink named ``site-packages/scikit-learn.egg-link ``
339
- to the development folder of scikit-learn with::
340
-
341
- pip install --editable .
0 commit comments