%global _empty_manifest_terminate_build 0
Name:		python-pyRFC3339
Version:	2.1.0
Release:	1
Summary:	Generate and parse RFC 3339 timestamps
License:	MIT
URL:		https://github.com/kurtraschke/pyRFC3339
Source0:	https://files.pythonhosted.org/packages/b4/7f/3c194647ecb80ada6937c38a162ab3edba85a8b6a58fa2919405f4de2509/pyrfc3339-2.1.0.tar.gz
BuildArch:	noarch

%description
This package contains a python library to parse and generate RFC 3339-compliant timestamps using Python datetime.datetime objects.

%package -n python3-pyRFC3339
Summary:	Generate and parse RFC 3339 timestamps
Provides:	python-pyRFC3339
Provides:	python3-pyrfc3339
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
BuildRequires:	python3-wheel
BuildRequires:	python3-pytest
BuildRequires:	pyproject-rpm-macros
Obsoletes:   	%{name}-help < %{version}-%{release}
%description -n python3-pyRFC3339
This package contains a python library to parse and generate RFC 3339-compliant timestamps using Python datetime.datetime objects.

%prep
%autosetup -n pyrfc3339-2.1.0
# 上游用 setuptools_scm 从 git tag 动态取版本;sdist 无 .git/tag 会得到 0.0.0,
# 触发新版 setuptools 的“版本归零”报错。故在此钉死版本并移除 scm 配置段。
sed -i -E 's/^dynamic = \["version"\]/version = "%{version}"/' pyproject.toml
sed -i -E '/^\[tool\.setuptools_scm\]/d' pyproject.toml

%build
%pyproject_wheel

%install
%pyproject3_install
%pyproject_save_files pyrfc3339

%check
# 上游 2.1.0 sdist 未包含测试用例,pytest 收集为 0 会返回 5,予以容忍
set +e
%{pytest}
rc=$?
set -e
[ $rc -eq 0 -o $rc -eq 5 ]

%files -n python3-pyRFC3339 -f %{pyproject_files}
%license LICENSE.txt
%doc README.rst

%changelog
* Tue Jul 21 2026 peiliya <peiliya@kylinos.cn> - 2.1.0-1
- Update to 2.1.0
- Pin version in pyproject.toml (drop setuptools_scm) since the sdist has no VCS metadata
- Tolerate empty test suite (upstream sdist ships no tests)

* Tue Aug 19 2025 yaoxin <1024769339@qq.com> - 2.0.1-1
- Update to 2.0.1:
  * Migrate tests from nose to unittest and pytest
  * Replace :mod:`pytz` dependency with
    :attr:`datetime.timezone.utc` and :mod:`zoneinfo`
  * Reformat codebase with black and isort

* Mon Jun 28 2021 Python_Bot <Python_Bot@openeuler.org> - 1.1-1
- Package Spec generated