Skip to content

Commit c829061

Browse files
authored
Merge pull request #3865 from GandalfSaxe/patch-1
Move information on `pip install -e` to the top
2 parents 4c14740 + 40b4fe6 commit c829061

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

doc/en/goodpractices.rst

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,28 @@
44
Good Integration Practices
55
=================================================
66

7+
Install package with pip
8+
-------------------------------------------------
9+
10+
For development, we recommend to use virtualenv_ environments and pip_
11+
for installing your application and any dependencies
12+
as well as the ``pytest`` package itself. This ensures your code and
13+
dependencies are isolated from the system Python installation.
14+
15+
First you need to place a ``setup.py`` file in the root of your package with the following minimum content:
16+
17+
from setuptools import setup, find_packages
18+
19+
20+
setup(name="PACKAGENAME", packages=find_packages())
21+
22+
Where ``PACKAGENAME`` is the name of your package. You can then install your package in "editable" mode by running from the same directory::
23+
24+
pip install -e .
25+
26+
which lets you change your source code (both tests and application) and rerun tests at will.
27+
This is similar to running ``python setup.py develop`` or ``conda develop`` in that it installs
28+
your package using a symlink to your development code.
729

830
.. _`test discovery`:
931
.. _`Python test discovery`:
@@ -177,19 +199,6 @@ Note that this layout also works in conjunction with the ``src`` layout mentione
177199
tox
178200
------
179201

180-
For development, we recommend to use virtualenv_ environments and pip_
181-
for installing your application and any dependencies
182-
as well as the ``pytest`` package itself. This ensures your code and
183-
dependencies are isolated from the system Python installation.
184-
185-
You can then install your package in "editable" mode::
186-
187-
pip install -e .
188-
189-
which lets you change your source code (both tests and application) and rerun tests at will.
190-
This is similar to running ``python setup.py develop`` or ``conda develop`` in that it installs
191-
your package using a symlink to your development code.
192-
193202
Once you are done with your work and want to make sure that your actual
194203
package passes all tests you may want to look into `tox`_, the
195204
virtualenv test automation tool and its `pytest support

0 commit comments

Comments
 (0)