diff --git a/CHANGELOG.md b/CHANGELOG.md index 0281cb2609..68bbf475ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,10 @@ +## dev + ## 1.3.0 - Check whether pip module exists in shared lib before performing any actions, such as `reinstall-all`. - Drop `setuptools` and `wheel` from the shared libraries. This results in less time consumption when the libraries are -automatically upgraded. + automatically upgraded. - Allow running `pip` with `pipx run` - Support PEP 723 run requirements in `pipx run`. - Imply `--include-apps` when running `pipx inject --include-deps` @@ -14,7 +16,8 @@ automatically upgraded. - Use the py launcher, if available, to select Python version with the `--python` option - Support including requirements in scripts run using `pipx run` (#916) - Pass `pip_args` to `shared_libs.upgrade()` -- Fallback to user's log path if the default log path (`$PIPX_HOME/logs`) is not writable to aid with pipx being used for multi-user (e.g. system-wide) installs of applications +- Fallback to user's log path if the default log path (`$PIPX_HOME/logs`) is not writable to aid with pipx being used + for multi-user (e.g. system-wide) installs of applications - Fix wrong interpreter usage when injecting local pip-installable dependencies into venvs - add pre-commit hook support - Don't show escaped backslashes for paths in console output @@ -31,7 +34,8 @@ automatically upgraded. ## 1.2.1 -- Fix compatibility to packaging 23.2+ by removing reliance on packaging's requirement validation logic and detecting a URL-based requirement in pipx. (#1070) +- Fix compatibility to packaging 23.2+ by removing reliance on packaging's requirement validation logic and detecting a + URL-based requirement in pipx. (#1070) ## 1.2.0 @@ -49,22 +53,26 @@ automatically upgraded. ## 1.1.0 - Fix encoding issue on Windows when pip fails to install a package -- Improve the behaviour of `shlex.split` on Windows, so paths on Windows can be handled peoperly when they are passed in `--pip-args`. (#794) +- Improve the behaviour of `shlex.split` on Windows, so paths on Windows can be handled peoperly when they are passed in + `--pip-args`. (#794) - Add `pipx environment` command (#793) - Add `list --short` option to list only package names (#804) -- [docs] Fix the command for [installing development version](https://pypa.github.io/pipx/installation/#install-pipx-development-versions). (#801) +- [docs] Fix the command for + [installing development version](https://pypa.github.io/pipx/installation/#install-pipx-development-versions). (#801) - [docs] Fix test status badge in readme file - [docs] Add more examples - [dev] Change github action job names - [docs] Add additional examples for installation from git repos - [packaging] Switch to [PEP 621](https://www.python.org/dev/peps/pep-0621/) -- Add a CACHEDIR.TAG to the cache directory to prevent it from being included in archives and backups. For more information about cache directory tags, see https://bford.info/cachedir +- Add a CACHEDIR.TAG to the cache directory to prevent it from being included in archives and backups. For more + information about cache directory tags, see https://bford.info/cachedir ## 1.0.0 - Support [argcomplete 2.0.0](https://pypi.org/project/argcomplete/2.0.0) (#790) - Include machinery to build a manpage for pipx with [argparse-manpage](https://pypi.org/project/argparse-manpage/). -- Add better handling for 'app not found' when a single app is present in the project, and an improved error message (#733) +- Add better handling for 'app not found' when a single app is present in the project, and an improved error message + (#733) - Fixed animations sending output to stdout, which can break JSON output. (#769) - Fix typo in `pipx upgrade-all` output @@ -76,36 +84,52 @@ automatically upgraded. - Fixed `pipx list` output phrasing to convey that python version displayed is the one with which package was installed. - Fixed `pipx install` to provide return code 0 if venv already exists, similar to pip’s behavior. (#736) -- [docs] Update ansible's install command in [Programs to Try document](https://pypa.github.io/pipx/programs-to-try/#ansible) to work with Ansible 2.10+ (#742) +- [docs] Update ansible's install command in + [Programs to Try document](https://pypa.github.io/pipx/programs-to-try/#ansible) to work with Ansible 2.10+ (#742) ## 0.16.4 -- Fix to `pipx ensurepath` to fix behavior in user locales other than UTF-8, to fix #644. The internal change is to use userpath v1.6.0 or greater. (#700) +- Fix to `pipx ensurepath` to fix behavior in user locales other than UTF-8, to fix #644. The internal change is to use + userpath v1.6.0 or greater. (#700) - Fix virtual environment inspection for Python releases that uses an int for its release serial number. (#706) - Fix PermissionError in windows when pipx manages itself. (#718) ## 0.16.3 -- Organization: pipx is extremely pleased to now be a project of the Python Packaging Authority (PyPA)! Note that our github URL has changed to [pypa/pipx](https://github.com/pypa/pipx) -- Fixed `pipx list --json` to return valid json with no venvs installed. Previously would return an empty string to stdout. (#681) -- Changed `pipx ensurepath` bash behavior so that only one of {`~/.profile`, `~/.bash\_profile`} is modified with the extra pipx paths, not both. Previously, if a `.bash_profile` file was created where one didn't exist, it could cause problems, e.g. #456. The internal change is to use userpath v1.5.0 or greater. (#684) -- Changed default nox tests, Github Workflow tests, and pytest behavior to use local pypi server with fixed lists of available packages. This allows greater test isolation (no network pypi access needed) and determinism (fixed available dependencies.) It also allows running the tests offline with some extra preparation beforehand (See [Running Unit Tests Offline](https://pypa.github.io/pipx/contributing/#running-unit-tests-offline)). The old style tests that use the internet to access pypi.org are still available using `nox -s tests_internet` or `pytest --net-pypiserver tests`. (#686) +- Organization: pipx is extremely pleased to now be a project of the Python Packaging Authority (PyPA)! Note that our + github URL has changed to [pypa/pipx](https://github.com/pypa/pipx) +- Fixed `pipx list --json` to return valid json with no venvs installed. Previously would return an empty string to + stdout. (#681) +- Changed `pipx ensurepath` bash behavior so that only one of {`~/.profile`, `~/.bash\_profile`} is modified with the + extra pipx paths, not both. Previously, if a `.bash_profile` file was created where one didn't exist, it could cause + problems, e.g. #456. The internal change is to use userpath v1.5.0 or greater. (#684) +- Changed default nox tests, Github Workflow tests, and pytest behavior to use local pypi server with fixed lists of + available packages. This allows greater test isolation (no network pypi access needed) and determinism (fixed + available dependencies.) It also allows running the tests offline with some extra preparation beforehand (See + [Running Unit Tests Offline](https://pypa.github.io/pipx/contributing/#running-unit-tests-offline)). The old style + tests that use the internet to access pypi.org are still available using `nox -s tests_internet` or + `pytest --net-pypiserver tests`. (#686) * Colorama is now only installed on Windows. (#691) ## 0.16.2.1 -- Changed non-venv-info warnings and notices from `pipx list` to print to stderr. This especially prevents `pipx list --json` from printing invalid json to stdout. (#680) -- Fixed bug that could cause uninstall on Windows with injected packages to uninstall too many apps from the local binary directory. (#679) +- Changed non-venv-info warnings and notices from `pipx list` to print to stderr. This especially prevents + `pipx list --json` from printing invalid json to stdout. (#680) +- Fixed bug that could cause uninstall on Windows with injected packages to uninstall too many apps from the local + binary directory. (#679) ## 0.16.2.0 -- Fixed bug #670 where uninstalling a venv could erroneously uninstall other apps from the local binary directory. (#672) +- Fixed bug #670 where uninstalling a venv could erroneously uninstall other apps from the local binary directory. + (#672) - Added `--json` switch to `pipx list` to output rich json-metadata for all venvs. - Ensured log files are utf-8 encoded to prevent Unicode encoding errors from occurring with emojis. (#646) - Fixed issue which made pipx incorrectly list apps as part of a venv when they were not installed by pipx. (#650) -- Fixed old regression that would prevent pipx uninstall from cleaning up linked binaries if the venv was old and did not have pipx metadata. (#651) -- Fixed bugs with suffixed-venvs on Windows. Now properly summarizes install, and actually uninstalls associated binaries for suffixed-venvs. (#653) +- Fixed old regression that would prevent pipx uninstall from cleaning up linked binaries if the venv was old and did + not have pipx metadata. (#651) +- Fixed bugs with suffixed-venvs on Windows. Now properly summarizes install, and actually uninstalls associated + binaries for suffixed-venvs. (#653) - Changed venv minimum python version to 3.6, removing python 3.5 which is End of Life. (#666) ## 0.16.1.0 @@ -116,30 +140,51 @@ automatically upgraded. - Better platform unicode detection to avoid errors and allow showing emojis when possible. (#614) - Don't emit show cursor or hide cursor codes if STDERR is not a tty. (#620) - Sped up `pipx list` (#624). -- pip errors no longer stream to the shell when pip fails during a pipx install. pip's output is now saved to a log file. In the shell, pipx will tell you the location of the log file and attempt to summarize why pip failed. (#625) +- pip errors no longer stream to the shell when pip fails during a pipx install. pip's output is now saved to a log + file. In the shell, pipx will tell you the location of the log file and attempt to summarize why pip failed. (#625) - For `reinstall-all`, fixed bug where missing python executable would cause error. (#634) - Fix regression which prevented pipx from working with pythonloc (and `__pypackages__` folder). (#636) ## 0.16.0.0 -- New venv inspection! The code that pipx uses to examine and determine metadata in an installed venv has been made faster, better, and more reliable. It now uses modern python libraries like `packaging` and `importlib.metadata` to examine installed venvs. It also now properly handles installed package extras. In addition, some problems pipx has had with certain characters (like periods) in package names should be remedied. +- New venv inspection! The code that pipx uses to examine and determine metadata in an installed venv has been made + faster, better, and more reliable. It now uses modern python libraries like `packaging` and `importlib.metadata` to + examine installed venvs. It also now properly handles installed package extras. In addition, some problems pipx has + had with certain characters (like periods) in package names should be remedied. - Added reinstall command for reinstalling a single venv. -- Changed `pipx run` on non-Windows systems to actually replace pipx process with the app process instead of running it as a subprocess. (Now using python's `os.exec*`) -- [bugfix] Fixed bug with reinstall-all command when package have been installed using a specifier. Now the initial specifier is used. +- Changed `pipx run` on non-Windows systems to actually replace pipx process with the app process instead of running it + as a subprocess. (Now using python's `os.exec*`) +- [bugfix] Fixed bug with reinstall-all command when package have been installed using a specifier. Now the initial + specifier is used. - [bugfix] Override display of `PIPX_DEFAULT_PYTHON` value when generating web documentation for `pipx install` #523 - [bugfix] Wrap help documentation for environment variables. - [bugfix] Fixed uninstall crash that could happen on Windows for certain packages -- [feature] Venv package name arguments now do not have to match exactly as pipx has them stored, but can be specified in any python-package-name-equivalent way. (i.e. case does not matter, and `.`, `-`, `_` characters are interchangeable.) -- [change] Venvs with a suffix: A suffix can contain any characters, but for purposes of uniqueness, python package name rules apply--upper- and lower-case letters are equivalent, and any number of `.`, `-`, or `_` characters in a row are equivalent. (e.g. if you have a suffixed venv `pylint_1.0A` you could not add another suffixed venv called `pylint--1-0a`, as it would not be a unique name.) -- [implementation detail] Pipx shared libraries (providing pip, setuptools, wheel to pipx) are no longer installed using pip arguments taken from the last regular pipx install. If you need to apply pip arguments to pipx's use of pip for its internal shared libraries, use PIP\_\* environment variables. -- [feature] Autocomplete for venv names is no longer restricted to an exact match to the literal venv name, but will autocomplete any logically-similar python package name (i.e. case does not matter, and `.`, `-`, `_` characters are all equivalent.) +- [feature] Venv package name arguments now do not have to match exactly as pipx has them stored, but can be specified + in any python-package-name-equivalent way. (i.e. case does not matter, and `.`, `-`, `_` characters are + interchangeable.) +- [change] Venvs with a suffix: A suffix can contain any characters, but for purposes of uniqueness, python package name + rules apply--upper- and lower-case letters are equivalent, and any number of `.`, `-`, or `_` characters in a row are + equivalent. (e.g. if you have a suffixed venv `pylint_1.0A` you could not add another suffixed venv called + `pylint--1-0a`, as it would not be a unique name.) +- [implementation detail] Pipx shared libraries (providing pip, setuptools, wheel to pipx) are no longer installed using + pip arguments taken from the last regular pipx install. If you need to apply pip arguments to pipx's use of pip for + its internal shared libraries, use PIP\_\* environment variables. +- [feature] Autocomplete for venv names is no longer restricted to an exact match to the literal venv name, but will + autocomplete any logically-similar python package name (i.e. case does not matter, and `.`, `-`, `_` characters are + all equivalent.) - pipx now reinstalls its internal shared libraries when the user executes `reinstall-all`. -- Made sure shell exit codes from every pipx command are correct. In the past some (like from `pipx upgrade`) were wrong. The exit code from `pipx runpip` is now the exit code from the `pip` command run. The exit code from `pipx list` will be 1 if one or more venvs have problems that need to be addressed. -- pipx now writes a log file for each pipx command executed to `$PIPX_HOME/logs`, typically `~/.local/pipx/logs`. pipx keeps the most recent 10 logs and deletes others. -- `pipx upgrade` and `pipx upgrade-all` now have a `--upgrade-injected` option which directs pipx to also upgrade injected packages. -- `pipx list` now detects, identifies, and suggests a remedy for venvs with old-internal data (internal venv names) that need to be updated. +- Made sure shell exit codes from every pipx command are correct. In the past some (like from `pipx upgrade`) were + wrong. The exit code from `pipx runpip` is now the exit code from the `pip` command run. The exit code from + `pipx list` will be 1 if one or more venvs have problems that need to be addressed. +- pipx now writes a log file for each pipx command executed to `$PIPX_HOME/logs`, typically `~/.local/pipx/logs`. pipx + keeps the most recent 10 logs and deletes others. +- `pipx upgrade` and `pipx upgrade-all` now have a `--upgrade-injected` option which directs pipx to also upgrade + injected packages. +- `pipx list` now detects, identifies, and suggests a remedy for venvs with old-internal data (internal venv names) that + need to be updated. - Added a "Troubleshooting" page to the pipx web documentation for common problems pipx users may encounter. -- pipx error, warning, and other messages now word-wrap so words are not split across lines. Their appearance is also now more consistent. +- pipx error, warning, and other messages now word-wrap so words are not split across lines. Their appearance is also + now more consistent. ## 0.15.6.0 @@ -148,21 +193,26 @@ automatically upgraded. - [bugfix] Fixed regression in list, inject, upgrade, reinstall-all commands when suffixed packages are used. - [bugfix] Do not reset package url during upgrade when main package is `pipx` - Updated help text to show description for `ensurepath` and `completions` help -- Added support for user-defined default python interpreter via new `PIPX_DEFAULT_PYTHON`. Helpful for use with pyenv among other uses. +- Added support for user-defined default python interpreter via new `PIPX_DEFAULT_PYTHON`. Helpful for use with pyenv + among other uses. - [bugfix] Fixed bug where extras were ignored with a PEP 508 package specification with a URL. ## 0.15.5.1 -- [bugfix] Fixed regression of 0.15.5.0 which erroneously made installing from a local path with package extras not possible. +- [bugfix] Fixed regression of 0.15.5.0 which erroneously made installing from a local path with package extras not + possible. ## 0.15.5.0 -- pipx now parses package specification before install. It removes (with warning) the `--editable` install option for any package specification that is not a local path. It also removes (with warning) any environment markers. +- pipx now parses package specification before install. It removes (with warning) the `--editable` install option for + any package specification that is not a local path. It also removes (with warning) any environment markers. - Disabled animation when we cannot determine terminal size or if the number of columns is too small. (Fixes #444) - [feature] Version of each injected package is now listed after name for `pipx list --include-injected` -- Change metadata recorded from version-specified install to allow upgrades in future. Adds pipx dependency on `packaging` package. +- Change metadata recorded from version-specified install to allow upgrades in future. Adds pipx dependency on + `packaging` package. - [bugfix] Prevent python error in case where package has no pipx metadata and advise user how to fix. -- [feature] `ensurepath` now also ensures that pip user binary path containing pipx itself is in user's PATH if pipx was installed using `pip install --user`. +- [feature] `ensurepath` now also ensures that pip user binary path containing pipx itself is in user's PATH if pipx was + installed using `pip install --user`. - [bugfix] For `pipx install`, fixed failure to install if user has `PIP_USER=1` or `user=true` in pip.conf. (#110) - [bugfix] Requiring userpath v1.4.1 or later so ensure Windows bug is fixed for `ensurepath` (#437) - [feature] log pipx version (#423) @@ -191,12 +241,15 @@ automatically upgraded. - [bugfix] Hide cursor while pipx runs - [feature] Add environment variable `USE_EMOJI` to allow enabling/disabling emojis (#376) - [refactor] Moved all commands to separate files within the commands module (#255). -- [bugfix] Ignore system shared libraries when installing shared libraries pip, wheel, and setuptools. This also fixes an incompatibility with Debian/Ubuntu's version of pip (#386). +- [bugfix] Ignore system shared libraries when installing shared libraries pip, wheel, and setuptools. This also fixes + an incompatibility with Debian/Ubuntu's version of pip (#386). ## 0.15.1.3 - [bugfix] On Windows, pipx now lists correct Windows apps (#217) -- [bugfix] Fixed a `pipx install` bug causing incorrect python binary to be used when using the optional --python argument in certain situations, such as running pipx from a Framework python on macOS and specifying a non-Framework python. +- [bugfix] Fixed a `pipx install` bug causing incorrect python binary to be used when using the optional --python + argument in certain situations, such as running pipx from a Framework python on macOS and specifying a non-Framework + python. ## 0.15.1.2 @@ -210,22 +263,34 @@ automatically upgraded. ## 0.15.1.0 - Add Python 3.8 to PyPI classifier and travis test matrix -- [feature] auto-upgrade shared libraries, including pip, if older than one month. Hide all pip warnings that a new version is available. (#264) +- [feature] auto-upgrade shared libraries, including pip, if older than one month. Hide all pip warnings that a new + version is available. (#264) - [bugfix] pass pip arguments to pip when determining package name (#320) ## 0.15.0.0 -Upgrade instructions: When upgrading to 0.15.0.0 or above from a pre-0.15.0.0 version, you must re-install all packages to take advantage of the new persistent pipx metadata files introduced in this release. These metadata files store pip specification values, injected packages, any custom pip arguments, and more in each main package's venv. You can do this by running `pipx reinstall-all` or `pipx uninstall-all`, then reinstalling manually. +Upgrade instructions: When upgrading to 0.15.0.0 or above from a pre-0.15.0.0 version, you must re-install all packages +to take advantage of the new persistent pipx metadata files introduced in this release. These metadata files store pip +specification values, injected packages, any custom pip arguments, and more in each main package's venv. You can do this +by running `pipx reinstall-all` or `pipx uninstall-all`, then reinstalling manually. - `install` now has no `--spec` option. You may specify any valid pip specification for `install`'s main argument. - `inject` will now accept pip specifications for dependency arguments -- Metadata is now stored for each application installed, including install options like `--spec`, and injected packages. This information allows upgrade, upgrade-all and reinstall-all to work properly even with non-pypi installed packages. (#222) -- `upgrade` options `--spec` and `--include-deps` were removed. Pipx now uses the original options used to install each application instead. (#222) -- `upgrade-all` options `--include-deps`, `--system-site-packages`, `--index-url`, `--editable`, and `--pip-args` were removed. Pipx now uses the original options used to install each application instead. (#222) -- `reinstall-all` options `--include-deps`, `--system-site-packages`, `--index-url`, `--editable`, and `--pip-args` were removed. Pipx now uses the original options used to install each application instead. (#222) +- Metadata is now stored for each application installed, including install options like `--spec`, and injected packages. + This information allows upgrade, upgrade-all and reinstall-all to work properly even with non-pypi installed packages. + (#222) +- `upgrade` options `--spec` and `--include-deps` were removed. Pipx now uses the original options used to install each + application instead. (#222) +- `upgrade-all` options `--include-deps`, `--system-site-packages`, `--index-url`, `--editable`, and `--pip-args` were + removed. Pipx now uses the original options used to install each application instead. (#222) +- `reinstall-all` options `--include-deps`, `--system-site-packages`, `--index-url`, `--editable`, and `--pip-args` were + removed. Pipx now uses the original options used to install each application instead. (#222) - Handle missing interpreters more gracefully (#146) -- Change `reinstall-all` to use system python by default for apps. Now use `--python` option to specify a different python version. -- Remove the PYTHONPATH environment variable when executing any command to prevent conflicts between pipx dependencies and package dependencies when pipx is installed via homebrew. Homebrew can use PYTHONPATH manipulation instead of virtual environments. (#233) +- Change `reinstall-all` to use system python by default for apps. Now use `--python` option to specify a different + python version. +- Remove the PYTHONPATH environment variable when executing any command to prevent conflicts between pipx dependencies + and package dependencies when pipx is installed via homebrew. Homebrew can use PYTHONPATH manipulation instead of + virtual environments. (#233) - Add printed summary after successful call to `pipx inject` - Support associating apps with Python 3.5 - Improvements to animation status text @@ -235,7 +300,8 @@ Upgrade instructions: When upgrading to 0.15.0.0 or above from a pre-0.15.0.0 ve ## 0.14.0.0 -- Speed up operations by using shared venv for `pip`, `setuptools`, and `wheel`. You can see more detail in the 'how pipx works' section of the documentation. (#164, @pfmoore) +- Speed up operations by using shared venv for `pip`, `setuptools`, and `wheel`. You can see more detail in the 'how + pipx works' section of the documentation. (#164, @pfmoore) - Breaking change: for the `inject` command, change `--include-binaries` to `--include-apps` - Change all terminology from `binary` to `app` or `application` - Improve argument parsing for `pipx run` and `pipx runpip` @@ -254,11 +320,13 @@ Upgrade instructions: When upgrading to 0.15.0.0 or above from a pre-0.15.0.0 ve ## 0.13.2.1 -- Remove virtual environment if installation did not complete. For example, if it was interrupted by ctrl+c or if an exception occurred for any reason. (#193) +- Remove virtual environment if installation did not complete. For example, if it was interrupted by ctrl+c or if an + exception occurred for any reason. (#193) ## 0.13.2.0 -- Add shell autocompletions. Also add `pipx completions` command to print instructions on how to add pipx completions to your shell. +- Add shell autocompletions. Also add `pipx completions` command to print instructions on how to add pipx completions to + your shell. - Un-deprecate `ensurepath`. Use `userpath` internally instead of instructing users to run the `userpath` cli command. - Improve detection of PIPX_BIN_DIR not being on PATH - Improve error message when an existing symlink exists in PIPX_BIN_DIR and points to the wrong location @@ -275,7 +343,8 @@ Upgrade instructions: When upgrading to 0.15.0.0 or above from a pre-0.15.0.0 ve - Deprecate `ensurepath` command. Use `userpath append ~/.local/bin` - Support redirects and proxies when downloading python files (i.e. `pipx run http://url/file.py`) -- Use tox for document generation and CI testing (CI tests are now functional rather than static tests on style and formatting!) +- Use tox for document generation and CI testing (CI tests are now functional rather than static tests on style and + formatting!) - Use mkdocs for documentation - Change default cache duration for `pipx run` from 2 to 14 days @@ -286,13 +355,16 @@ Upgrade instructions: When upgrading to 0.15.0.0 or above from a pre-0.15.0.0 ve ## 0.13.0.0 - Add `runpip` command to run arbitrary pip commands in pipx-managed virtual environments -- Do not raise error when running `pipx install PACKAGE` and the package has already been installed by pipx (#125). This is the cause of the major version change from 0.12 to 0.13. +- Do not raise error when running `pipx install PACKAGE` and the package has already been installed by pipx (#125). This + is the cause of the major version change from 0.12 to 0.13. - Add `--skip` argument to `upgrade-all` and `reinstall-all` commands, to let the user skip particular packages ## 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) +- 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) ## 0.12.3.2 @@ -305,14 +377,18 @@ Upgrade instructions: When upgrading to 0.15.0.0 or above from a pre-0.15.0.0 ve ## 0.12.3.0 -- Add `--include-deps` argument to include binaries of dependent packages when installing with pipx. This improves compatibility with packages that depend on other installed packages, such as `jupyter`. -- Speed up `pipx list` output (by running multiple processes in parallel) and by collecting all metadata in a single subprocess call +- Add `--include-deps` argument to include binaries of dependent packages when installing with pipx. This improves + compatibility with packages that depend on other installed packages, such as `jupyter`. +- Speed up `pipx list` output (by running multiple processes in parallel) and by collecting all metadata in a single + subprocess call - More aggressive cache directory removal when `--no-cache` is passed to `pipx run` - [dev] Move inline text passed to subprocess calls to their own files to enable autoformatting, linting, unit testing ## 0.12.2.0 -- Add support for PEP 582's `__pypackages__` (experimental). `pipx run BINARY` will first search in `__pypackages__` for binary, then fallback to installing from PyPI. `pipx run --pypackages BINARY` will raise an error if the binary is not found in `__pypackages__`. +- Add support for PEP 582's `__pypackages__` (experimental). `pipx run BINARY` will first search in `__pypackages__` for + binary, then fallback to installing from PyPI. `pipx run --pypackages BINARY` will raise an error if the binary is not + found in `__pypackages__`. - Fix regression when installing with `--editable` flag (#93) - [dev] improve unit tests @@ -320,8 +396,10 @@ Upgrade instructions: When upgrading to 0.15.0.0 or above from a pre-0.15.0.0 ve - Cache and reuse temporary Virtual Environments created with `pipx run` (#61) - Update binary discovery logic to find "scripts" like awscli (#91) -- Forward `--pip-args` to the pip upgrade command (previously the args were forwarded to install/upgrade commands for packages) (#77) -- When using environment variable PIPX_HOME, Virtual Environments will now be created at `$PIPX_HOME/venvs` rather than at `$PIPX_HOME`. +- Forward `--pip-args` to the pip upgrade command (previously the args were forwarded to install/upgrade commands for + packages) (#77) +- When using environment variable PIPX_HOME, Virtual Environments will now be created at `$PIPX_HOME/venvs` rather than + at `$PIPX_HOME`. - [dev] refactor into multiple files, add more unit tests ## 0.12.0.4 @@ -330,7 +408,9 @@ Upgrade instructions: When upgrading to 0.15.0.0 or above from a pre-0.15.0.0 ve ## 0.12.0.3 -- list python2 as supported language so that pip installs with python2 will no longer install the pipx on PyPI from the original pipx owner. Running pipx with python2 will fail, but at least it will not be as confusing as running the pipx package from the original owner. +- list python2 as supported language so that pip installs with python2 will no longer install the pipx on PyPI from the + original pipx owner. Running pipx with python2 will fail, but at least it will not be as confusing as running the pipx + package from the original owner. ## 0.12.0.2 @@ -355,7 +435,8 @@ Upgrade instructions: When upgrading to 0.15.0.0 or above from a pre-0.15.0.0 ve ## 0.11.0.0 -- Replace `pipx BINARY` with `pipx run BINARY` to run a binary in an ephemeral environment. This is a breaking API change so the major version has been incremented. (Issue #69) +- Replace `pipx BINARY` with `pipx run BINARY` to run a binary in an ephemeral environment. This is a breaking API + change so the major version has been incremented. (Issue #69) - upgrade pip when upgrading packages (Issue #72) - support --system-site-packages flag (Issue #64) diff --git a/README.md b/README.md index cd28d0257b..fc79214ff6 100644 --- a/README.md +++ b/README.md @@ -22,15 +22,13 @@ **Source Code**: https://github.com/pypa/pipx -_For comparison to other tools including pipsi, see [Comparison to Other Tools](https://pypa.github.io/pipx/comparisons/)._ +_For comparison to other tools including pipsi, see +[Comparison to Other Tools](https://pypa.github.io/pipx/comparisons/)._ ## Install pipx -> [!NOTE] -> It is not recommended to install `pipx` via `pipx`. If you'd like -> to do this anyway, take a look at the -> [`pipx-in-pipx`](https://github.com/mattsb42-meta/pipx-in-pipx) project and -> read about the limitations there. +> [!NOTE] It is not recommended to install `pipx` via `pipx`. If you'd like to do this anyway, take a look at the +> [`pipx-in-pipx`](https://github.com/mattsb42-meta/pipx-in-pipx) project and read about the limitations there. ### On macOS @@ -43,7 +41,7 @@ Upgrade pipx with `brew update && brew upgrade pipx`. ### On Linux -- Ubuntu 23.04 or above +- Ubuntu 23.04 or above ``` sudo apt update @@ -51,7 +49,7 @@ sudo apt install pipx pipx ensurepath ``` -- Ubuntu 22.04 or below +- Ubuntu 22.04 or below ``` python3 -m pip install --user pipx @@ -73,22 +71,22 @@ It is possible (even most likely) the above finishes with a WARNING looking simi WARNING: The script pipx.exe is installed in `\AppData\Roaming\Python\Python3x\Scripts` which is not on PATH ``` -If so, go to the mentioned folder, allowing you to run the pipx executable directly. -Enter the following line (even if you did not get the warning): +If so, go to the mentioned folder, allowing you to run the pipx executable directly. Enter the following line (even if +you did not get the warning): ``` .\pipx.exe ensurepath ``` -This will add both the above mentioned path and the `%USERPROFILE%\.local\bin` folder to your search path. -Restart your terminal session and verify `pipx` does run. +This will add both the above mentioned path and the `%USERPROFILE%\.local\bin` folder to your search path. Restart your +terminal session and verify `pipx` does run. Upgrade pipx with `py -m pip install --user --upgrade pipx`. ### Using pipx without installing (via zipapp) -You can also use pipx without installing it. -The zipapp can be downloaded from [Github releases](https://github.com/pypa/pipx/releases) and you can invoke it with a Python 3.7+ interpreter: +You can also use pipx without installing it. The zipapp can be downloaded from +[Github releases](https://github.com/pypa/pipx/releases) and you can invoke it with a Python 3.7+ interpreter: ``` python pipx.pyz ensurepath @@ -110,35 +108,49 @@ For more details, see the [installation instructions](https://pypa.github.io/pip ## Overview: What is `pipx`? -pipx is a tool to help you install and run end-user applications written in Python. It's roughly similar to macOS's `brew`, JavaScript's [npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b), and Linux's `apt`. +pipx is a tool to help you install and run end-user applications written in Python. It's roughly similar to macOS's +`brew`, JavaScript's [npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b), and +Linux's `apt`. -It's closely related to pip. In fact, it uses pip, but is focused on installing and managing Python packages that can be run from the command line directly as applications. +It's closely related to pip. In fact, it uses pip, but is focused on installing and managing Python packages that can be +run from the command line directly as applications. ### How is it Different from pip? -pip is a general-purpose package installer for both libraries and apps with no environment isolation. pipx is made specifically for application installation, as it adds isolation yet still makes the apps available in your shell: pipx creates an isolated environment for each application and its associated packages. +pip is a general-purpose package installer for both libraries and apps with no environment isolation. pipx is made +specifically for application installation, as it adds isolation yet still makes the apps available in your shell: pipx +creates an isolated environment for each application and its associated packages. pipx does not ship with pip, but installing it is often an important part of bootstrapping your system. ### Where Does `pipx` Install Apps From? -By default, pipx uses the same package index as pip, [PyPI](https://pypi.org/). pipx can also install from all other sources pip can, such as a local directory, wheel, git url, etc. +By default, pipx uses the same package index as pip, [PyPI](https://pypi.org/). pipx can also install from all other +sources pip can, such as a local directory, wheel, git url, etc. -Python and PyPI allow developers to distribute code with "console script entry points". These entry points let users call into Python code from the command line, effectively acting like standalone applications. +Python and PyPI allow developers to distribute code with "console script entry points". These entry points let users +call into Python code from the command line, effectively acting like standalone applications. -pipx is a tool to install and run any of these thousands of application-containing packages in a safe, convenient, and reliable way. **In a way, it turns Python Package Index (PyPI) into a big app store for Python applications.** Not all Python packages have entry points, but many do. +pipx is a tool to install and run any of these thousands of application-containing packages in a safe, convenient, and +reliable way. **In a way, it turns Python Package Index (PyPI) into a big app store for Python applications.** Not all +Python packages have entry points, but many do. -If you would like to make your package compatible with pipx, all you need to do is add a [console scripts](https://python-packaging.readthedocs.io/en/latest/command-line-scripts.html#the-console-scripts-entry-point) entry point. If you're a poetry user, use [these instructions](https://python-poetry.org/docs/pyproject/#scripts). Or you're using hatch, [try this](https://hatch.pypa.io/latest/config/metadata/#cli). +If you would like to make your package compatible with pipx, all you need to do is add a +[console scripts](https://python-packaging.readthedocs.io/en/latest/command-line-scripts.html#the-console-scripts-entry-point) +entry point. If you're a poetry user, use [these instructions](https://python-poetry.org/docs/pyproject/#scripts). Or +you're using hatch, [try this](https://hatch.pypa.io/latest/config/metadata/#cli). ## Features `pipx` enables you to -- Expose CLI entrypoints of packages ("apps") installed to isolated environments with the `install` command. This guarantees no dependency conflicts and clean uninstalls! +- Expose CLI entrypoints of packages ("apps") installed to isolated environments with the `install` command. This + guarantees no dependency conflicts and clean uninstalls! - Easily list, upgrade, and uninstall packages that were installed with pipx - Run the latest version of a Python application in a temporary environment with the `run` command -Best of all, pipx runs with regular user permissions, never calling `sudo pip install` (you aren't doing that, are you? 😄). +Best of all, pipx runs with regular user permissions, never calling `sudo pip install` (you aren't doing that, are you? +😄). ### Walkthrough: Installing a Package and its Applications With `pipx` @@ -148,7 +160,10 @@ You can globally install an application by running pipx install PACKAGE ``` -This automatically creates a virtual environment, installs the package, and adds the package's associated applications (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.** +This automatically creates a virtual environment, installs the package, and adds the package's associated applications +(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: @@ -203,15 +218,22 @@ pipx install "git+https://github.com/psf/black.git#egg=black[jupyter]" This is an alternative to `pipx install`. -`pipx run` downloads and runs the above mentioned Python "apps" in a one-time, temporary environment, leaving your system untouched afterwards. +`pipx run` downloads and runs the above mentioned Python "apps" in a one-time, temporary environment, leaving your +system untouched afterwards. -This can be handy when you need to run the latest version of an app, but don't necessarily want it installed on your computer. +This can be handy when you need to run the latest version of an app, but don't necessarily want it installed on your +computer. -You may want to do this when you are initializing a new project and want to set up the right directory structure, when you want to view the help text of an application, or if you simply want to run an app in a one-off case and leave your system untouched afterwards. +You may want to do this when you are initializing a new project and want to set up the right directory structure, when +you want to view the help text of an application, or if you simply want to run an app in a one-off case and leave your +system untouched afterwards. -For example, the blog post [How to set up a perfect Python project](https://sourcery.ai/blog/python-best-practices/) uses `pipx run` to kickstart a new project with [cookiecutter](https://github.com/cookiecutter/cookiecutter), a tool that creates projects from project templates. +For example, the blog post [How to set up a perfect Python project](https://sourcery.ai/blog/python-best-practices/) +uses `pipx run` to kickstart a new project with [cookiecutter](https://github.com/cookiecutter/cookiecutter), a tool +that creates projects from project templates. -A nice side benefit is that you don't have to remember to upgrade the app since `pipx run` will automatically run a recent version for you. +A nice side benefit is that you don't have to remember to upgrade the app since `pipx run` will automatically run a +recent version for you. Okay, let's see what this looks like in practice! @@ -267,7 +289,8 @@ usage: pipx run [-h] [--no-cache] [--pypackages] [--spec SPEC] [--verbose] [--py pipx run: error: ambiguous option: --py could match --pypackages, --python ``` -To prevent this put double dash `--` before APP. It will make pipx to forward the arguments to the right verbatim to the application: +To prevent this put double dash `--` before APP. It will make pipx to forward the arguments to the right verbatim to the +application: ``` > pipx run -- pycowsay --py @@ -285,17 +308,21 @@ To prevent this put double dash `--` before APP. It will make pipx to forward th ``` -Re-running the same app is quick because pipx caches Virtual Environments on a per-app basis. The caches only last a few days, and when they expire, pipx will again use the latest version of the package. This way you can be sure you're always running a new version of the package without having to manually upgrade. +Re-running the same app is quick because pipx caches Virtual Environments on a per-app basis. The caches only last a few +days, and when they expire, pipx will again use the latest version of the package. This way you can be sure you're +always running a new version of the package without having to manually upgrade. ### Package with multiple apps, or the app name doesn't match the package name -If the app name does not match the package name, you can use the `--spec` argument to specify the `PACKAGE` name, and provide the `APP` to run separately: +If the app name does not match the package name, you can use the `--spec` argument to specify the `PACKAGE` name, and +provide the `APP` to run separately: ``` pipx run --spec PACKAGE APP ``` -For example, the [esptool](https://github.com/espressif/esptool) package doesn't provide an executable with the same name: +For example, the [esptool](https://github.com/espressif/esptool) package doesn't provide an executable with the same +name: ``` >> pipx run esptool @@ -316,7 +343,9 @@ pipx run --spec esptool espsecure.py pipx run --spec esptool esptool.py ``` -Note that the `.py` extension is not something you append to the executable name. It is part of the executable name, as provided by the package. This can be anything. For example, when working with the [pymodbus](https://github.com/pymodbus-dev/pymodbus) package: +Note that the `.py` extension is not something you append to the executable name. It is part of the executable name, as +provided by the package. This can be anything. For example, when working with the +[pymodbus](https://github.com/pymodbus-dev/pymodbus) package: ``` >> pipx run pymodbus[repl] @@ -337,7 +366,9 @@ pipx run --spec pymodbus[repl] pymodbus.simulator ### Running a specific version of a package -The `PACKAGE` argument above is actually a [requirement specifier](https://packaging.python.org/en/latest/glossary/#term-Requirement-Specifier). Therefore, you can also specify specific versions, version ranges, or extras. For example: +The `PACKAGE` argument above is actually a +[requirement specifier](https://packaging.python.org/en/latest/glossary/#term-Requirement-Specifier). Therefore, you can +also specify specific versions, version ranges, or extras. For example: ``` pipx run mpremote==1.20.0 @@ -370,7 +401,8 @@ pipx is working! ### Summary -That's it! Those are the most important commands `pipx` offers. To see all of pipx's documentation, run `pipx --help` or see the [docs](https://pypa.github.io/pipx/docs/). +That's it! Those are the most important commands `pipx` offers. To see all of pipx's documentation, run `pipx --help` or +see the [docs](https://pypa.github.io/pipx/docs/). ## Testimonials @@ -403,7 +435,10 @@ That's it! Those are the most important commands `pipx` offers. To see all of pi ## Credits -pipx was inspired by [pipsi](https://github.com/mitsuhiko/pipsi) and [npx](https://github.com/npm/npx). It was created by [Chad Smith](https://github.com/cs01/) and has had lots of help from [contributors](https://github.com/pypa/pipx/graphs/contributors). The logo was created by [@IrishMorales](https://github.com/IrishMorales). +pipx was inspired by [pipsi](https://github.com/mitsuhiko/pipsi) and [npx](https://github.com/npm/npx). It was created +by [Chad Smith](https://github.com/cs01/) and has had lots of help from +[contributors](https://github.com/pypa/pipx/graphs/contributors). The logo was created by +[@IrishMorales](https://github.com/IrishMorales). pipx is maintained by a team of volunteers (in alphabetical order) @@ -414,6 +449,6 @@ pipx is maintained by a team of volunteers (in alphabetical order) ## Contributing -Issues and Pull Requests are definitely welcome! Check out [Contributing](https://pypa.github.io/pipx/contributing/) to get started. -Everyone who interacts with the pipx project via codebase, issue tracker, chat rooms, or otherwise is expected to follow -the [PSF Code of Conduct](https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md). +Issues and Pull Requests are definitely welcome! Check out [Contributing](https://pypa.github.io/pipx/contributing/) to +get started. Everyone who interacts with the pipx project via codebase, issue tracker, chat rooms, or otherwise is +expected to follow the [PSF Code of Conduct](https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md). diff --git a/src/pipx/version.py b/src/pipx/version.py index 09af6a5f93..7b5bc5e52a 100644 --- a/src/pipx/version.py +++ b/src/pipx/version.py @@ -1,2 +1,2 @@ -__version_info__ = (1, 3, 0) +__version_info__ = (1, 3, 0, 1, "dev0") __version__ = ".".join(str(i) for i in __version_info__)