%global _empty_manifest_terminate_build 0
%global pypi_name watchfiles

Name:           python-%{pypi_name}
Version:        0.19.0
Release:        1
Summary:        Simple, modern and high performance file watching and code reload in python.

License:        MIT
URL:            https://github.com/samuelcolvin/watchfiles
Source0:        https://files.pythonhosted.org/packages/b3/17/d9453f774dd079fbe7d51565d58006f5059fc17c2fbcf952ef176fbb8657/watchfiles-0.19.0.tar.gz
Source1:        cargo-vendor-cache
Patch1:         0001-set-cargo-vendor-cache-for-local-build.patch

BuildRequires:  rust-packaging

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-pip
BuildRequires:  python3-wheel
BuildRequires:	python3-hatchling
BuildRequires:	python3-maturin

%description
Simple, modern and high performance file watching and code reload in python.


%package -n     python3-%{pypi_name}
Summary:        %{summary}

%description -n python3-%{pypi_name}
Simple, modern and high performance file watching and code reload in python.


%prep
%autosetup -p1 -n %{pypi_name}-%{version}
tar xzvf %{SOURCE1} -C .

%build
%pyproject_build

%install
%pyproject_install

%files -n python3-%{pypi_name}
%doc README.md
%license LICENSE
%{_bindir}/watchfiles
%{python3_sitearch}/%{pypi_name}
%{python3_sitearch}/%{pypi_name}*.dist-info/

%changelog
* Wed Aug 9 2023 Dongxing Wang <dxwangk@isoftstone.com> - 0.19.0-1
- Initial package
