Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cs01 committed Mar 26, 2019
1 parent 53bcaab commit c0d91fc
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 19 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.12.4.0
* Add `runpip` command

0.12.3.3
* Update logic in determining a package's binaries during installation. This removes spurious binaries from the installation. (#104)
* Improve compatibility with Debian distributions by using `shutil.which` instead of `distutils.spawn.find_executable` (#102)
Expand Down
59 changes: 41 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<a href="https://travis-ci.org/pipxproject/pipx"><img src="https://travis-ci.org/pipxproject/pipx.svg?branch=master" /></a>

<a href="https://pypi.python.org/pypi/pipx/">
<img src="https://img.shields.io/badge/pypi-0.12.3.3-blue.svg" /></a>
<img src="https://img.shields.io/badge/pypi-0.12.4.0-blue.svg" /></a>
<a href="https://github.com/ambv/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
</p>

Expand All @@ -37,23 +37,23 @@ You can globally install a CLI application by running
pipx install PACKAGE
```

This automatically creates a virtual environment, installs the package, and adds the package's CLI entry points to a location on your `PATH`. For example, `pipx install cowsay` makes the `cowsay` command available globally, but sandboxes the cowsay package in its own virtual environment. **pipx never needs to run as sudo to do this.**
This automatically creates a virtual environment, installs the package, and adds the package's CLI entry points to a location on your `PATH`. For example, `pipx install pycowsay` makes the `pycowsay` command available globally, but sandboxes the pycowsay package in its own virtual environment. **pipx never needs to run as sudo to do this.**

Example:
```
>> pipx install cowsay
installed package cowsay 2.0, Python 3.6.7
>> pipx install pycowsay
installed package pycowsay 2.0, Python 3.6.7
These binaries are now globally available
- cowsay
- pycowsay
done! ✨ 🌟 ✨
>> pipx list
venvs are in /home/user/.local/pipx/venvs
binaries are exposed on your $PATH at /home/user/.local/bin
package cowsay 2.0, Python 3.6.7
- cowsay
package pycowsay 2.0, Python 3.6.7
- pycowsay
>> cowsay moooo
>> pycowsay moooo
_____
< moooo >
=====
Expand All @@ -73,7 +73,7 @@ pipx run BINARY [ARGS...]
This will install the package in an isolated, temporary directory and invoke the binary. Try it!

```
pipx run cowsay moo
pipx run pycowsay moo
```

Notice that you **don't need to execute any install commands to run the binary**.
Expand Down Expand Up @@ -121,7 +121,7 @@ pipx ensurepath
```
pipx --help
usage: pipx [-h] [--version]
{install,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall-all,list,run,ensurepath}
{install,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall-all,list,run,runpip,ensurepath}
...
Install and execute binaries from Python packages.
Expand All @@ -142,7 +142,7 @@ optional arguments:
subcommands:
Get help for commands with pipx COMMAND --help
{install,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall-all,list,run,ensurepath}
{install,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall-all,list,run,runpip,ensurepath}
install Install a package
inject Install packages into an existing Virtual Environment
upgrade Upgrade a package
Expand All @@ -157,6 +157,8 @@ subcommands:
temporary directory, then run a binary from it, or
invoke binary from local `__pypackages__` directory
(expiremental, see https://github.com/cs01/pythonloc)
runpip Run pip in an existing pipx-managed Virtual
Environment
ensurepath Ensure /home/$USER/.local/bin is on your PATH
environment variable by modifying your shell's
configuration file.
Expand Down Expand Up @@ -228,9 +230,9 @@ optional arguments:

#### `pipx install` examples
```
pipx install cowsay
pipx install --python python3.6 cowsay
pipx install --python python3.7 cowsay
pipx install pycowsay
pipx install --python python3.6 pycowsay
pipx install --python python3.7 pycowsay
pipx install --spec git+https://github.com/ambv/black black
pipx --spec git+https://github.com/ambv/black.git@branch-name black
pipx --spec git+https://github.com/ambv/black.git@git-hash black
Expand Down Expand Up @@ -301,11 +303,11 @@ pipx --python 3.7 --spec PACKAGE=1.7.3 run BINARY
pipx --spec git+https://url.git run BINARY # latest version on master is run
pipx --spec git+https://url.git@branch run BINARY
pipx --spec git+https://url.git@hash run BINARY
pipx run cowsay moo
pipx run pycowsay moo
pipx --version # prints pipx version
pipx run cowsay --version # prints cowsay version
pipx --python pythonX cowsay
pipx --spec cowsay==2.0 cowsay --version
pipx run pycowsay --version # prints pycowsay version
pipx --python pythonX pycowsay
pipx --spec pycowsay==2.0 pycowsay --version
pipx --spec git+https://github.com/ambv/black.git black
pipx --spec git+https://github.com/ambv/black.git@branch-name black
pipx --spec git+https://github.com/ambv/black.git@git-hash black
Expand Down Expand Up @@ -518,6 +520,27 @@ binaries are exposed on your $PATH at /Users/user/.local/bin
- pipx
```

### pipx runpip

```
pipx runpip --help
usage: pipx runpip [-h] [--verbose] package [pipargs [pipargs ...]]
Run pip in an existing pipx-managed Virtual Environment
positional arguments:
package Name of the existing pipx-managed Virtual Environment to run pip
in
pipargs Arguments to forward to pip command
optional arguments:
-h, --help show this help message and exit
--verbose
```



### pipx ensurepath

```
Expand Down
3 changes: 2 additions & 1 deletion generate_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def get_help(pipxcmd: Optional[str]) -> str:
cmd_help = {
"usage": get_help(None),
"ensurepath": get_help("ensurepath"),
"runpip": get_help("runpip"),
"install": get_help("install"),
"upgrade": get_help("upgrade"),
"upgradeall": get_help("upgrade-all"),
Expand All @@ -46,7 +47,7 @@ def get_help(pipxcmd: Optional[str]) -> str:
"reinstallall": get_help("reinstall-all"),
"list": get_help("list"),
"run": get_help("run"),
"version": __version__
"version": __version__,
}

with open("README.md", "wb") as f:
Expand Down
4 changes: 4 additions & 0 deletions templates/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ binaries are exposed on your $PATH at /Users/user/.local/bin
- pipx
```

### pipx runpip
{{runpip}}


### pipx ensurepath
{{ensurepath}}

Expand Down

0 comments on commit c0d91fc

Please sign in to comment.