@@ -44,10 +44,10 @@ Specifying requirements
4444-----------------------
4545
4646Requirements are specified using the same form as expected by ``setuptools ``, e.g. ``flask ``, ``setuptools==2.1.2 ``,
47- ``Django>=1.4,<1.6 ``. These are specified using the `` -r `` option and may be specified multiple times. For example,
48- to start an environment with ``flask `` and ``psutil>1 ``::
47+ ``Django>=1.4,<1.6 ``. These are specified as arguments to pex and any number (including 0) may be specified.
48+ For example, to start an environment with ``flask `` and ``psutil>1 ``::
4949
50- $ pex -r flask -r 'psutil>1'
50+ $ pex flask 'psutil>1'
5151 Python 2.6.9 (unknown, Jan 2 2014, 14:52:48)
5252 [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)] on darwin
5353 Type "help", "copyright", "credits" or "license" for more information.
@@ -72,7 +72,7 @@ Entry points define how the environment is executed and may be specified using t
7272As mentioned above, if no entry points are specified, the default behavior is to emulate an
7373interpreter::
7474
75- $ pex -r flask
75+ $ pex flask
7676 Python 2.6.9 (unknown, Jan 2 2014, 14:52:48)
7777 [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)] on darwin
7878 Type "help", "copyright", "credits" or "license" for more information.
@@ -92,7 +92,7 @@ Like an interpreter, if a source file is specified, it is invoked::
9292 > app.run()
9393 > EOF
9494
95- $ pex -r flask -- ./flask_hello_world.py
95+ $ pex flask -- ./flask_hello_world.py
9696 * Running on http://127.0.0.1:5000/
9797
9898As an example of using a non-empty entry point, consider the Python ``pydoc ``
@@ -121,7 +121,7 @@ This can be emulated using the ``pex`` tool using ``-e pydoc``::
121121Arguments will be passed unescaped following ``-- `` on the command line. So in order to
122122get pydoc help on the ``flask.app `` package in Flask::
123123
124- $ pex -r flask -e pydoc -- flask.app
124+ $ pex flask -e pydoc -- flask.app
125125 Help on module flask.app in flask:
126126
127127 NAME
@@ -142,7 +142,7 @@ and Fabric respectively. This is roughly equivalent to running a script that do
142142This can be a powerful way to invoke Python applications without ever having to ``pip install ``
143143anything, for example a one-off invocation of Sphinx with the readthedocs theme available::
144144
145- $ pex -r sphinx -r sphinx_rtd_theme -e sphinx:main -- --help
145+ $ pex sphinx sphinx_rtd_theme -e sphinx:main -- --help
146146 Sphinx v1.2.2
147147 Usage: /var/folders/4d/9tz0cd5n2n7947xs21gspsxc0000gp/T/tmpLr8ibZ [options] sourcedir outdir [filenames...]
148148
@@ -163,7 +163,7 @@ exist for the duration of the pex command lifetime and immediately garbage colle
163163If the ``-o PATH `` option is specified, a PEX file of the environment is saved to disk at ``PATH ``. For example
164164we can package a standalone Sphinx as above::
165165
166- $ pex -r sphinx -r sphinx_rtd_theme -e sphinx:main -o sphinx.pex
166+ $ pex sphinx sphinx_rtd_theme -e sphinx:main -o sphinx.pex
167167
168168Instead of executing the environment, it is saved to disk::
169169
@@ -188,7 +188,7 @@ As before, entry points are not required, and if not specified the PEX will defa
188188an interpreter. If an alternate interpreter is specified with ``--python ``, e.g. pypy, it will be the
189189default hashbang in the PEX file::
190190
191- $ pex --python=pypy -r flask -o flask-pypy.pex
191+ $ pex --python=pypy flask -o flask-pypy.pex
192192
193193The hashbang of the PEX file specifies PyPy::
194194
@@ -208,17 +208,16 @@ and when invoked uses the environment PyPy::
208208Tailoring requirement resolution
209209--------------------------------
210210
211- By default, ``pex `` fetches artifacts from PyPI. This can be disabled with ``--no-pypi `` and
212- explicitly enabled with ``--pypi ``.
211+ By default, ``pex `` fetches artifacts from PyPI. This can be disabled with ``--no-index ``.
213212
214- If PyPI fetching is disabled, you will need to specify a search repository via ``--repo ``. This
213+ If PyPI fetching is disabled, you will need to specify a search repository via ``-f/--find-links ``. This
215214may be a directory on disk or a remote simple http server.
216215
217216For example, you can delegate artifact fetching and resolution to ``pip wheel `` for whatever
218217reason -- perhaps you're running a firewalled mirror -- but continue to package with pex::
219218
220219 $ pip wheel sphinx sphinx_rtd_theme
221- $ pex -r sphinx -r sphinx_rtd_theme -e sphinx:main --no-pypi --repo =wheelhouse -o sphinx.pex
220+ $ pex sphinx sphinx_rtd_theme -e sphinx:main --no-index --find-links =wheelhouse -o sphinx.pex
222221
223222
224223Tailoring PEX execution
0 commit comments