Compare commits

...

No commits in common. "c10s" and "epel9" have entirely different histories.
c10s ... epel9

2 changed files with 77 additions and 20 deletions

View File

@ -6,8 +6,16 @@
] ]
%endif %endif
# The pytest-xdist package is not available when bootstrapping or for EL builds # Set this to 1 when bootstrapping
%bcond xdist %{undefined rhel} %bcond bootstrap 0
%bcond tests 1
# While bootstrapping, ignore manpages
%bcond manpages %{without bootstrap}
# The pytest-xdist package is not available when bootstrapping or on RHEL
%bcond xdist %[%{without bootstrap} && %{undefined rhel}]
# Package the placeholder rpm-macros (moved to redhat-rpm-config in F40) # Package the placeholder rpm-macros (moved to redhat-rpm-config in F40)
%if ! (0%{?fedora} >= 40 || 0%{?rhel} >= 10) %if ! (0%{?fedora} >= 40 || 0%{?rhel} >= 10)
@ -16,6 +24,9 @@
%bcond rpmmacropkg 0 %bcond rpmmacropkg 0
%endif %endif
%if %{with bootstrap}
%bcond poetry 0
%else
%if ! 0%{?fedora}%{?rhel} || 0%{?fedora} || 0%{?epel} >= 9 %if ! 0%{?fedora}%{?rhel} || 0%{?fedora} || 0%{?epel} >= 9
%bcond poetry 1 %bcond poetry 1
# Appease old Poetry versions (<1.2.0a2) # Appease old Poetry versions (<1.2.0a2)
@ -27,18 +38,18 @@
%else %else
%bcond poetry 0 %bcond poetry 0
%endif %endif
%if ! 0%{?fedora}%{?rhel} || 0%{?fedora} || 0%{?epel} >= 9 || 0%{?rhel} >= 10
%bcond manpage_manual_title 1
%else
%bcond manpage_manual_title 0
%endif %endif
%global srcname rpmautospec %global srcname rpmautospec
Name: python-%{srcname} Name: python-%{srcname}
Version: 0.6.5 Version: 0.7.3
%if %{with bootstrap}
Release: 0%{?dist}
%else
Release: %autorelease Release: %autorelease
%endif
Summary: Package and CLI tool to generate release fields and changelogs Summary: Package and CLI tool to generate release fields and changelogs
License: MIT License: MIT
URL: https://github.com/fedora-infra/%{srcname} URL: https://github.com/fedora-infra/%{srcname}
@ -49,22 +60,31 @@ Source0: https://github.com/fedora-infra/%{srcname}/releases/download/%{version}
%endif %endif
BuildArch: noarch BuildArch: noarch
BuildRequires: argparse-manpage
BuildRequires: git BuildRequires: git
# the langpacks are needed for tests # the langpacks are needed for tests
BuildRequires: glibc-langpack-de BuildRequires: glibc-langpack-de
BuildRequires: glibc-langpack-en BuildRequires: glibc-langpack-en
BuildRequires: python3-devel >= 3.9.0 BuildRequires: python3-devel >= 3.9.0
# Needed to build man pages
%if %{with manpages}
BuildRequires: python3dist(click-man)
%endif
%if %{with tests}
# The dependencies needed for testing dont get auto-generated. # The dependencies needed for testing dont get auto-generated.
BuildRequires: python3dist(pytest) BuildRequires: python3dist(pytest)
%if %{with xdist} %if %{with xdist}
BuildRequires: python3dist(pytest-xdist) BuildRequires: python3dist(pytest-xdist)
%endif %endif
%endif
BuildRequires: python3dist(pyyaml) BuildRequires: python3dist(pyyaml)
BuildRequires: sed BuildRequires: sed
%if %{without poetry} %if %{without poetry}
BuildRequires: python3dist(babel) BuildRequires: python3dist(babel)
BuildRequires: python3dist(click)
BuildRequires: python3dist(click-plugins)
BuildRequires: python3dist(pygit2) BuildRequires: python3dist(pygit2)
BuildRequires: python3dist(rpm) BuildRequires: python3dist(rpm)
BuildRequires: python3dist(rpmautospec-core) BuildRequires: python3dist(rpmautospec-core)
@ -107,6 +127,9 @@ enabled packages locally.
%prep %prep
%autosetup -n %{srcname}-%{version} %autosetup -n %{srcname}-%{version}
%if %{without poetry}
sed -i -e 's/\[project\]/#\&/g' pyproject.toml
%endif
%if %{with old_poetry} %if %{with old_poetry}
sed -i \ sed -i \
-e 's/\[tool\.poetry\.group\.dev\.dependencies\]/[tool.poetry.dev-dependencies]/g' \ -e 's/\[tool\.poetry\.group\.dev\.dependencies\]/[tool.poetry.dev-dependencies]/g' \
@ -137,32 +160,66 @@ cat << EOF > %{pyproject_files}
EOF EOF
%endif %endif
install -d %{buildroot}%{_mandir}/man1 %if %{with manpages}
PYTHONPATH=%{buildroot}%{python3_sitelib} argparse-manpage \ # Man pages
%if %{with manpage_manual_title} PYTHONPATH=%{buildroot}%{python3_sitelib} click-man rpmautospec
--manual-title "User Commands" \ install -m755 -d %{buildroot}%{_mandir}/man1
install -m644 man/*.1 %{buildroot}%{_mandir}/man1
%endif %endif
--project-name rpmautospec \
--module rpmautospec.cli \
--function get_arg_parser > %{buildroot}%{_mandir}/man1/rpmautospec.1
# RPM macros
%if %{with rpmmacropkg} %if %{with rpmmacropkg}
mkdir -p %{buildroot}%{rpmmacrodir} mkdir -p %{buildroot}%{rpmmacrodir}
install -m 644 rpm/macros.d/macros.rpmautospec %{buildroot}%{rpmmacrodir}/ install -m 644 rpm/macros.d/macros.rpmautospec %{buildroot}%{rpmmacrodir}/
%endif %endif
# Shell completion
for shell_path in \
bash:%{bash_completions_dir}/rpmautospec \
fish:%{fish_completions_dir}/rpmautospec.fish \
zsh:%{zsh_completions_dir}/_rpmautospec; do
shell="${shell_path%%:*}"
path="${shell_path#*:}"
dir="${path%/*}"
install -m 755 -d "%{buildroot}${dir}"
PYTHONPATH=%{buildroot}%{python3_sitelib} \
_RPMAUTOSPEC_COMPLETE="${shell}_source" \
%{__python3} -c \
"import sys; sys.argv[0] = 'rpmautospec'; from rpmautospec.cli import cli; sys.exit(cli())" \
> "%{buildroot}${path}"
done
%check %check
# Always run the import checks, even when other tests are disabled
%if %{with poetry}
%pyproject_check_import
%else
%py3_check_import rpmautospec rpmautospec.cli
%endif
%if %{with tests}
%pytest -v \ %pytest -v \
%if %{with xdist} %if %{with xdist}
--numprocesses=auto --numprocesses=auto
%endif %endif
%endif
%files -n python3-%{srcname} -f %{pyproject_files} %files -n python3-%{srcname} -f %{pyproject_files}
%doc README.rst %doc README.rst
%files -n %{srcname} %files -n %{srcname}
%{_bindir}/rpmautospec %{_bindir}/rpmautospec
%{_mandir}/man1/rpmautospec.1* %if %{with manpages}
%{_mandir}/man1/rpmautospec*.1*
%endif
%dir %{bash_completions_dir}
%{bash_completions_dir}/rpmautospec
%dir %{fish_completions_dir}
%{fish_completions_dir}/rpmautospec.fish
%dir %{zsh_completions_dir}
%{zsh_completions_dir}/_rpmautospec
%if %{with rpmmacropkg} %if %{with rpmmacropkg}
%files -n rpmautospec-rpm-macros %files -n rpmautospec-rpm-macros
@ -170,4 +227,4 @@ install -m 644 rpm/macros.d/macros.rpmautospec %{buildroot}%{rpmmacrodir}/
%endif %endif
%changelog %changelog
%autochangelog %{?autochangelog}

View File

@ -1 +1 @@
SHA512 (rpmautospec-0.6.5.tar.gz) = 4740a471d25896314cbb37ab7a34d24fa7d3b6512ea4d5d7444528e0669bca79cb23a180b8a591378a40e832df4a6673ac20930f38672d268d9c70fb49748771 596f116dfef91883bce4c80cd15c600c3fe440485f836818a92ed5bde10edfda80a199845ed3fb62178c8a35e82aa5ed19310df2cc272352ab4963e71a2b9f6d rpmautospec-0.7.3.tar.gz