Skip to content

Commit f2182f5

Browse files
committed
Merge pull request pypa#177 from qwcode/develop_no_deps
updates to the develop mode section of the distribution tutorial
2 parents 43e81ec + eee7256 commit f2182f5

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

source/distributing.rst

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -526,33 +526,46 @@ For example::
526526
Working in "Development Mode"
527527
=============================
528528

529-
Although not required, it's common to locally install your project in "develop"
530-
or "editable" mode while you're working on it. This allows the project to be
529+
Although not required, it's common to locally install your project in "editable"
530+
or "develop" mode while you're working on it. This allows your project to be
531531
both installed and editable in project form.
532532

533-
Using "setup.py", run the following:
533+
Assuming you're in the root of your project directory, then run:
534534

535535
::
536536

537-
python setup.py develop
537+
pip install -e .
538538

539539

540-
Or you can achieve the same result using :ref:`pip`:
540+
Although somewhat cryptic, ``-e`` is short for ``--editable``, and ``.`` refers
541+
to the current working directory, so together, it means to install the current
542+
directory (i.e. your project) in editable mode. This will also install any
543+
dependencies declared with "install_requires" and any scripts declared with
544+
"console_scripts". Dependencies will not be installed in editable mode.
541545

542-
::
546+
It's fairly common to also want to install some of your dependencies in editable
547+
mode as well. For example, supposing your project requires "foo" and "bar", but
548+
you want "bar" installed from vcs in editable mode, then you could construct a
549+
requirements file like so::
543550

544-
pip install -e .
551+
-e .
552+
-e git+https://somerepo/bar.git#egg=bar
545553

554+
The first line says to install your project and any dependencies. The second
555+
line overrides the "bar" dependency, such that it's fulfilled from vcs, not
556+
PyPI. For more on requirements files, see the :ref:`Requirements File
557+
<pip:Requirements Files>` section in the pip docs. For more on vcs installs,
558+
see the :ref:`VCS Support <pip:VCS Support>` section of the pip docs.
546559

547-
Note that both commands will install any dependencies declared with
548-
"install_requires" and also any scripts declared with "console_scripts".
560+
Lastly, if you don't want to install any dependencies at all, you can run::
561+
562+
pip install -e . --no-deps
549563

550564

551565
For more information, see the `Development Mode
552566
<http://pythonhosted.org/setuptools/setuptools.html#development-mode>`_ section
553567
of the `setuptools docs <http://pythonhosted.org/setuptools/setuptools.html>`_.
554568

555-
556569
.. _`Packaging Your Project`:
557570

558571
Packaging your Project

0 commit comments

Comments
 (0)