Skip to content

Commit

Permalink
update manual
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <mianghong@gmail.com>
  • Loading branch information
frostming committed Nov 22, 2018
1 parent 0798091 commit fa648ff
Show file tree
Hide file tree
Showing 5 changed files with 2,765 additions and 218 deletions.
7 changes: 4 additions & 3 deletions docs/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,12 @@ To prevent pipenv from loading the ``.env`` file, set the ``PIPENV_DONT_LOAD_ENV
☤ Custom Script Shortcuts
-------------------------

Pipenv supports creating custom shortcuts in the (optional) ``[scripts]`` section of your Pipfile.
Pipenv supports creating custom shortcuts in the (optional) ``[scripts]`` section of your Pipfile.

You can then run ``pipenv run <shortcut name>`` in your terminal to run the command in the
context of your pipenv virtual environment even if you have not activated the pipenv shell first.
context of your pipenv virtual environment even if you have not activated the pipenv shell first.

For example, in your Pipfile::
For example, in your Pipfile::

[scripts]
printspam = "python -c \"print('I am a silly example, no one would need to do this')\""
Expand Down Expand Up @@ -397,6 +397,7 @@ Pipenv supports the usage of environment variables in values. For example::
Environment variables may be specified as ``${MY_ENVAR}`` or ``$MY_ENVAR``.
On Windows, ``%MY_ENVAR%`` is supported in addition to ``${MY_ENVAR}`` or ``$MY_ENVAR``.

.. _configuration-with-environment-variables:

☤ Configuration With Environment Variables
------------------------------------------
Expand Down
16 changes: 7 additions & 9 deletions docs/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,12 @@ in your ``Pipfile.lock`` for now, run ``pipenv lock --keep-outdated``. Make sur
☤ Specifying Versions of a Package
----------------------------------

You can specify versions of a package using the `Semantic Versioning scheme <https://semver.org/>`_
(i.e. ``major.minor.micro``).
You can specify versions of a package using the `Semantic Versioning scheme <https://semver.org/>`_
(i.e. ``major.minor.micro``).

For example, to install requests you can use: ::

$ pipenv install requests~=1.2 # equivalent to requests~=1.2.0
$ pipenv install requests~=1.2 # equivalent to requests~=1.2.0

Pipenv will install version ``1.2`` and any minor update, but not ``2.0``.

Expand All @@ -201,11 +201,11 @@ To make inclusive or exclusive version comparisons you can use: ::

$ pipenv install "requests>=1.4" # will install a version equal or larger than 1.4.0
$ pipenv install "requests<=2.13" # will install a version equal or lower than 2.13.0
$ pipenv install "requests>2.19" # will install 2.19.1 but not 2.19.0
$ pipenv install "requests>2.19" # will install 2.19.1 but not 2.19.0

.. note:: The use of ``" "`` around the package and version specification is highly recommended
.. note:: The use of ``" "`` around the package and version specification is highly recommended
to avoid issues with `Input and output redirection <https://robots.thoughtbot.com/input-output-redirection-in-the-shell>`_
in Unix-based operating systems.
in Unix-based operating systems.

The use of ``~=`` is preferred over the ``==`` identifier as the former prevents pipenv from updating the packages: ::

Expand Down Expand Up @@ -398,10 +398,8 @@ environment into production. You can use ``pipenv lock`` to compile your depende
your development environment and deploy the compiled ``Pipfile.lock`` to all of your
production environments for reproducible builds.

.. note:
.. note::

If you'd like a ``requirements.txt`` output of the lockfile, run ``$ pipenv lock -r``.
This will include all hashes, however (which is great!). To get a ``requirements.txt``
without hashes, use ``$ pipenv run pip freeze``.
.. _configuration-with-environment-variables:https://docs.pipenv.org/advanced/#configuration-with-environment-variables
2 changes: 1 addition & 1 deletion pipenv/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def cli(

if man:
if system_which("man"):
path = os.sep.join([os.path.dirname(__file__), "pipenv.1"])
path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "pipenv.1")
os.execle(system_which("man"), "man", path, os.environ)
return 0
else:
Expand Down
Loading

0 comments on commit fa648ff

Please sign in to comment.