python-pytz-deprecation-shim/python-pytz-deprecation-shim.spec
2023-04-27 11:38:49 +08:00

75 lines
2.5 KiB
RPMSpec
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Name: python-pytz-deprecation-shim
Version: 0.1.0.post0
Release: 1
Summary: Shims to help you safely remove pytz
License: Apache-2.0
URL: https://github.com/pganssle/pytz-deprecation-shim
Source0: https://files.pythonhosted.org/packages/94/f0/909f94fea74759654390a3e1a9e4e185b6cd9aa810e533e3586f39da3097/pytz_deprecation_shim-0.1.0.post0.tar.gz
BuildArch: noarch
BuildRequires: python3-devel python3-pip python3-wheel
BuildRequires: tzdata
%global common_description %{expand:
pytz has served the Python community well for many years, but it is no longer
the best option for providing time zones. pytz has a non-standard interface
that is very easy to misuse; this interface was necessary when pytz was
created, because datetime had no way to represent ambiguous datetimes, but this
was solved in Python 3.6, which added a fold attribute to datetimes in PEP 495.
With the addition of the zoneinfo module in Python 3.9 (PEP 615), there has
never been a better time to migrate away from pytz.
However, since pytz time zones are used very differently from a standard
tzinfo, and many libraries have built pytz zones into their standard time zone
interface (and thus may have users relying on the existence of the localize and
normalize methods); this library provides shim classes that are compatible with
both PEP 495 and pytzs interface, to make it easier for libraries to deprecate
pytz.}
%description %{common_description}
%package -n python3-pytz-deprecation-shim
Summary: %{summary}
Requires: tzdata
%description -n python3-pytz-deprecation-shim %{common_description}
%package help
Summary: Development documents for pytz-deprecation-shim
%description help
Development documents for pytz-deprecation-shim
%prep
%autosetup -n pytz_deprecation_shim-%{version}
sed -r -i -e '/\bpytest-cov\b/d' -e 's/--cov=[^[:blank:]}]+//g' tox.ini
sed -r -i -e '/\btzdata\b/d' setup.cfg
%build
%pyproject_build
%install
%pyproject_install pytz_deprecation_shim==%{version}
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
%files -n python3-pytz-deprecation-shim
%{python3_sitelib}/pytz_deprecation_shim*
%license LICENSE
%license licenses/LICENSE_APACHE
%doc CHANGELOG.rst
%doc README.rst
%files help
%{_docdir}/*
%changelog
* Mon Apr 24 2023 Ge Wang <wang__ge@126.com> - 0.1.0.post0-1
- Init package