## START: Set by rpmautospec ## (rpmautospec version 0.7.2) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global modname tft %global projname %{modname}-cli %global srcname %{modname}_cli Name: python-%{projname} Version: 0.0.20 Release: %autorelease Summary: Testing Farm CLI tool License: Apache-2.0 URL: https://gitlab.com/testing-farm/cli/ Source0: %{pypi_source %{srcname}} BuildArch: noarch BuildRequires: python3-devel BuildRequires: tomcli %global _description %{expand: Testing Farm CLI tool.} %description %_description %package -n python3-%{projname} Summary: %{summary} %description -n python3-%{projname} %_description %prep %autosetup -n %{srcname}-%{version} # https://gitlab.com/testing-farm/cli/-/merge_requests/126 tomcli set pyproject.toml str "tool.poetry.dependencies.rich" "^13" # Relax overly strict dependencies tomcli set pyproject.toml str "tool.poetry.dependencies.typer" ">=0.11" tomcli set pyproject.toml str "tool.poetry.dependencies.click" "^8" tomcli set pyproject.toml str "tool.poetry.dependencies.dynaconf" "^3" tomcli set pyproject.toml str "tool.poetry.dependencies.ruamel-yaml" "^0.18" %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{modname} # Generate shell completion scripts using typer function gen_completion() { local shell="$1" %{python3} -c "import typer.completion; \ print(typer.completion.get_completion_script( \ prog_name='testing-farm', \ complete_var='_TESTING_FARM_COMPLETE', \ shell='$shell'))" return $? } gen_completion bash | install -Dpm 0644 /dev/stdin %{buildroot}%{bash_completions_dir}/testing-farm.bash gen_completion fish | install -Dpm 0644 /dev/stdin %{buildroot}%{fish_completions_dir}/testing-farm.fish gen_completion zsh | install -Dpm 0644 /dev/stdin %{buildroot}%{zsh_completions_dir}/_testing-farm %check %pyproject_check_import %files -n python3-%{projname} -f %{pyproject_files} %license LICENSE LICENSE_SPDX %{_bindir}/testing-farm %{bash_completions_dir}/testing-farm.bash %{fish_completions_dir}/testing-farm.fish %{zsh_completions_dir}/_testing-farm %changelog ## START: Generated by rpmautospec * Sat Sep 28 2024 John Doe - 0.0.20-1 - Uncommitted changes ## END: Generated by rpmautospec