%global pypi_name duty

Name:           python-%{pypi_name}
Version:        1.9.0
Release:        1
Summary:        A simple task runner.
License:        ISC
URL:            https://github.com/pawamoy/duty
Source0:        %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-pip
BuildRequires:  python3-wheel
BuildRequires:	python3-hatchling
BuildRequires:	python3-pdm-pep517
BuildRequires:	python3-pdm-backend
BuildRequires:	python3-failprint


%description
A simple task runner.

%package -n     python3-%{pypi_name}
Summary:        %{summary}
%{?python_provide:%python_provide python3-%{pypi_name}}
%description -n python3-%{pypi_name}
A simple task runner.

%package help
Summary:	%{summary}
Provides:	python3-%{pypi_name}-doc
%description help
A simple task runner.


%prep
%autosetup -n %{pypi_name}-%{version}

%build
%pyproject_build

%install
%pyproject_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
touch doclist.lst
if [ -d usr/share/man ]; then
    find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/doclist.lst .

%files -n python3-%{pypi_name}
%license LICENSE
%doc README.md
%{python3_sitelib}/duty*
%{_bindir}/duty

%files help
%{_docdir}/*

%changelog
* Fri Apr 03 2026 Dongxing Wang <dongxing.wang_a@thundersoft.com> - 1.9.0-1
- Update package with version 1.9.0
  Support ruff check --color flag
  Add zensical tool
  Also print standard error of ruff and ty commands

* Mon Feb 02 2026 YangengLiu <dev01202@linx-info.com> - 1.7.2-1
- update version to 1.7.2
  * Fix typing for color parameter of ty.check tool
  * Fix handling of ty.check color parameter
  * Add ty tool
  * Don't interpret --option=value or -o=value as a duty parameter
  * Remove code for Python 3.9
  * Update import from git-changelog to avoid deprecation warning
  * Depend on failprint 1.0.5
  * Add missing rule parameter to ruff rule tool
  * Re-add public (deprecated) modules
  * Move modules into internal folder
  * Import from failprint directly
  * API is now exposed at the top-level, except for the (and deprecated ) submodules.toolscallables

* Tue Apr 01 2025 Dongxing Wang <dongxing.wang_a@thundersoft.com> - 1.6.0-1
- Update package with version 1.6.0
  Add Yore tool
  Enable Bash completions

* Wed Oct 30 2024 muxiaohui <muxiaohui@kylinos.cn> - 1.4.3-1
- Update version to 1.4.3
  Drop support for Python 3.8.
  Add missing (new) check_only argument to blacken-docs.
  Fix call to eval_type (missing type_params argument on Python 3.13).

* Thu Jul 18 2024 liudy <liudingyao@kylinos.cn> - 1.4.0-1
- Update package to version 1.4.0
- Allow passing additional arguments, preventing their interpretation by delimitating them with


* Sun Feb 25 2024 jiangxinyu <jiangxinyu@kylinos.cn> - 1.2.0-1
- Update package to version 1.2.0
  Support safety v3 in safety callable

* Mon Dec 04 2023 jiangxinyu <jiangxinyu@kylinos.cn> - 1.1.0-1
- Update package to version 1.1.0

* Wed Aug 30 2023 luolu12 <luluoc@isoftstone.com> - 1.0.0-1
- Initial package.