## START: Set by rpmautospec ## (rpmautospec version 0.2.5) %define autorelease(e:s:pb:) %{?-p:0.}%{lua: release_number = 8; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{?dist} ## END: Set by rpmautospec %global forgeurl https://github.com/tiangolo/typer-cli %global tag %{version} # Temporarily disable since they are patched out due to click 8.x # incompatibility %bcond_with completions Name: python-typer-cli Version: 0.0.12 %forgemeta Release: %autorelease Summary: Run Typer scripts with completion, without creating a package License: MIT URL: https://typer.tiangolo.com/typer-cli Source0: %{forgesource} # Hand-written downstream man page in groff_man(7) format: Source1: typer.1 # Temporarily patch out shell completion support to work with typer 0.4.x and # click 8.x while we await a real upstream fix. Patch0: 0001-Patch-out-completion-to-work-with-typer-0.4.x-and-cl.patch BuildArch: noarch BuildRequires: python3-devel # Extra BR’s that could not be generated, from [tool.poetry.dev-dependencies] # in pyproject.toml. We do not include linters, formatters, or optional # coverage analysis tools, just the things we need to run the tests. In some # cases, we must loosen the version specifications. # pytest = "^6.0.1" BuildRequires: python3dist(pytest) >= 6.0.1 # pytest-cov = "^2.8.1" BuildRequires: (python3dist(pytest-cov) >= 2.8.1 with python3dist(pytest-cov) < 3.0) # BR’s for shell completion # # The shells for which we generate completions should be determined by those # supported by click. Some other packages with completion support which are # useful to reference are git, creds, and pipx. # # These shells are mentioned in the man page; please update that if adding # support for another shell. %if %{with completions} BuildRequires: pkgconfig(bash-completion) %global bashcompdir %(pkg-config --variable=completionsdir bash-completion 2>/dev/null) %global bashcomproot %(dirname %{bashcompdir} 2>/dev/null) BuildRequires: zsh %global zshcompdir %{_datadir}/zsh/site-functions %global zshcomproot %(dirname %{zshcompdir} 2>/dev/null) BuildRequires: pkgconfig(fish) %global fishcompdir %(pkg-config --variable=completionsdir fish 2>/dev/null) %global fishcomproot %(dirname %{fishcompdir} 2>/dev/null) %endif %global common_description %{expand: Run Typer scripts with completion, without having to create a package, using Typer CLI. There is an optional utility tool called Typer CLI, additional to Typer itself. Its main feature is to provide ✨ completion ✨ in the Terminal for your own small programs built with Typer. …without you having to create a complete installable Python package. It’s probably most useful if you have a small custom Python script using Typer (maybe as part of some project), for some small tasks, and it’s not complex/important enough to create a whole installable Python package for it (something to be installed with pip). In that case, you can install Typer CLI, and run your program with the typer command in your Terminal, and it will provide completion for your script. You can also use Typer CLI to generate Markdown documentation for your own Typer programs 📝. Documentation: https://typer.tiangolo.com/typer-cli/ Source Code for Typer CLI: https://github.com/tiangolo/typer-cli} %description %{common_description} %package -n python3-typer-cli Summary: %{summary} %description -n python3-typer-cli %{common_description} %prep %forgeautosetup -p1 cp -p %{SOURCE1} . %generate_buildrequires %pyproject_buildrequires -r %build %pyproject_wheel %if %{with completions} # Generate shell completions. mkdir -p '%{_vpath_builddir}' for sh in bash zsh fish do { PYTHONPATH="${PWD}/build/lib.%{python3_platform}-%{python3_version}" \ "${sh}" -l < 0.0.12-8 - Simplify generating shell completions * lun. oct. 25 2021 Benjamin A. Beasley 0.0.12-7 - Use %%python3 macro instead of %%__python3 * lun. sept. 13 2021 Benjamin A. Beasley 0.0.12-6 - Reduce macro indirection in the spec file * lun. sept. 13 2021 Benjamin A. Beasley 0.0.12-5 - Drop BR on pyproject-rpm-macros, now implied by python3-devel * mar. août 31 2021 Benjamin A. Beasley 0.0.12-4 - Allow (and require) typer 0.4 (close RHBZ#1987894) * mar. août 31 2021 Benjamin A. Beasley 0.0.12-3 - Updated comment on shell completions directory ownership * mar. août 31 2021 Benjamin A. Beasley 0.0.12-2 - Remove a patch that is no longer used * Wed Jul 7 2021 Benjamin A. Beasley - 0.0.12-1 - Update to 0.0.12 - Drop python-typer-cli-0.0.11-no-importlib_metadata.patch, as the importlib-metadata backport dependency is now removed upstream entirely. * Fri Jun 18 2021 Benjamin A. Beasley - 0.0.11-1 - Initial package