Name: pipx Version: 1.17.2 Release: %autorelease Summary: Install and run Python applications in isolated environments # SPDX License: MIT URL: https://pipx.pypa.io # We need to use the GitHub source archive instead of the PyPI sdist in order # to get the script to generate the man page. %global forgeurl https://github.com/pypa/pipx Source: %{forgeurl}/archive/%{version}/pipx-%{version}.tar.gz BuildSystem: pyproject BuildOption(install): --assert-license pipx BuildOption(generate_buildrequires): --extras uv BuildArch: noarch BuildRequires: /usr/bin/register-python-argcomplete %description 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, 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. %pyproject_extras_subpkg --name pipx uv %generate_buildrequires -p export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' %build -p export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' %build -a # Generate shell completions. “pipx completions” says: # # Add the appropriate command to your shell's config file # so that it is run on startup. You will likely have to restart # or re-login for the autocompletion to start working. # # bash: # eval "$(register-python-argcomplete pipx)" # # zsh: # To activate completions in zsh, first make sure compinit is marked for # autoload and run autoload: # # autoload -U compinit && compinit # # Afterwards you can enable completions for pipx: # # eval "$(register-python-argcomplete pipx)" # # NOTE: If your version of argcomplete is earlier than v3, you may need to # have bashcompinit enabled in zsh by running: # # autoload -U bashcompinit # bashcompinit # # # tcsh: # eval `register-python-argcomplete --shell tcsh pipx` # # fish: # # Not required to be in the config file, only run once # register-python-argcomplete --shell fish pipx >~/.config/fish/completions/pipx.fish for sh in bash tcsh fish do # We don’t need to be able to import pipx for this command to work. register-python-argcomplete --shell "${sh}" pipx > "pipx.${sh}" done # See the “man” environment in tox.toml. PYTHONPATH="${PWD}/src" %{python3} scripts/generate_man.py %install -a install -D --preserve-timestamps --mode=0644 \ --target='%{buildroot}%{_mandir}/man1' build/man/pipx.1 install -D --preserve-timestamps --mode=0644 \ --target='%{buildroot}%{bash_completions_dir}' pipx.bash install -D --preserve-timestamps --mode=0644 \ --target='%{buildroot}%{fish_completions_dir}' pipx.fish # It seems that there is not a reasonable way to install tcsh completions # system-wide, so we just make the completions file available for interested # users. install -D --preserve-timestamps --mode=0644 pipx.tcsh \ '%{buildroot}%{_datadir}/pipx/pipx-completion.tcsh' # Install the same generated bash completion for zsh install -D --preserve-timestamps --mode=0644 pipx.bash \ '%{buildroot}%{zsh_completions_dir}/_pipx' %check -a # It’s just not practical to run the tests. For most of them, we need either # (by default) a bundle of sample wheels from PyPI–which is arch-specific, as # some of them have compiled extensions—or network access. Previously, we tried # to disentangle the tests that did not require PyPI packages, but this has # become onerous. # # Instead, we “smoke-test” the installation by running the command-line tool # and confirming it can print its help output without crashing. # Make sure the source copy of the package is not in the Python path. mkdir --parents empty cd empty %{py3_test_envvars} pipx --help >/dev/null %files -f %{pyproject_files} %doc docs/README.md %doc docs/changelog.rst %{_bindir}/pipx %{_mandir}/man1/pipx.1* %{bash_completions_dir}/pipx.bash %{fish_completions_dir}/pipx.fish %{zsh_completions_dir}/_pipx %{_datadir}/pipx/ %changelog %autochangelog