Skip to content

Commit

Permalink
Improve syntax in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Nov 29, 2020
1 parent e290519 commit d17b4e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
14 changes: 9 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ probably has dependencies, say on `requests
declare the dependencies and launch the script in a context where
those dependencies have been resolved.

First, add a ``__requires__`` directive at the head of the script::
First, add a ``__requires__`` directive at the head of the script:

.. code-block:: python
#!/usr/bin/env python
Expand All @@ -191,7 +193,9 @@ The format for requirements must follow `PEP 508 <https://www.python.org/dev/pep

``pip-run`` also recognizes a global ``__index_url__`` attribute. If present,
this value will supply ``--index-url`` to pip with the attribute value,
allowing a script to specify a custom package index::
allowing a script to specify a custom package index:

.. code-block:: python
#!/usr/bin/env python
Expand All @@ -207,17 +211,17 @@ Supplying parameters to Pip
If you've been using ``pip-run``, you may have defined some requirements
in the ``__requires__`` of a script, but now you wish to install those
to a more permanent environment. pip-run provides a routine to facilitate
this case:
this case::

$ python -m pip_run.read-deps script.py
my_dependency

If you're on Unix, you may pipe this result directly to pip:
If you're on Unix, you may pipe this result directly to pip::

$ pip install $(python -m pip_run.read-deps script.py)

And since `pipenv <https://docs.pipenv.org/>`_ uses the same syntax,
the same technique works for pipenv:
the same technique works for pipenv::

$ pipenv install $(python -m pip_run.read-deps script.py)

Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ docs =
rst.linker >= 1.9

# local
pygments

[options.entry_points]
console_scripts =
Expand Down

0 comments on commit d17b4e8

Please sign in to comment.