|
rdobuilder |
91ebf2 |
## START: Set by rpmautospec
|
|
rdobuilder |
91ebf2 |
## (rpmautospec version 0.3.0)
|
|
rdobuilder |
91ebf2 |
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
|
|
rdobuilder |
91ebf2 |
release_number = 1;
|
|
rdobuilder |
91ebf2 |
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
|
|
rdobuilder |
91ebf2 |
print(release_number + base_release_number - 1);
|
|
rdobuilder |
91ebf2 |
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
|
|
rdobuilder |
91ebf2 |
## END: Set by rpmautospec
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
Name: python-pytz-deprecation-shim
|
|
rdobuilder |
91ebf2 |
Version: 0.1.0.post0
|
|
rdobuilder |
91ebf2 |
Release: %autorelease
|
|
rdobuilder |
91ebf2 |
Summary: Shims to help you safely remove pytz
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
License: Apache-2.0
|
|
rdobuilder |
91ebf2 |
URL: https://github.com/pganssle/pytz-deprecation-shim
|
|
rdobuilder |
91ebf2 |
Source0: %{pypi_source pytz_deprecation_shim}
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
BuildArch: noarch
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
BuildRequires: python3-devel
|
|
rdobuilder |
91ebf2 |
BuildRequires: pyproject-rpm-macros
|
|
rdobuilder |
91ebf2 |
# Depend on the system tzdata RPM, not the PyPI “tzdata” fallback package
|
|
rdobuilder |
91ebf2 |
BuildRequires: tzdata
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
%global common_description %{expand:
|
|
rdobuilder |
91ebf2 |
pytz has served the Python community well for many years, but it is no longer
|
|
rdobuilder |
91ebf2 |
the best option for providing time zones. pytz has a non-standard interface
|
|
rdobuilder |
91ebf2 |
that is very easy to misuse; this interface was necessary when pytz was
|
|
rdobuilder |
91ebf2 |
created, because datetime had no way to represent ambiguous datetimes, but this
|
|
rdobuilder |
91ebf2 |
was solved in Python 3.6, which added a fold attribute to datetimes in PEP 495.
|
|
rdobuilder |
91ebf2 |
With the addition of the zoneinfo module in Python 3.9 (PEP 615), there has
|
|
rdobuilder |
91ebf2 |
never been a better time to migrate away from pytz.
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
However, since pytz time zones are used very differently from a standard
|
|
rdobuilder |
91ebf2 |
tzinfo, and many libraries have built pytz zones into their standard time zone
|
|
rdobuilder |
91ebf2 |
interface (and thus may have users relying on the existence of the localize and
|
|
rdobuilder |
91ebf2 |
normalize methods); this library provides shim classes that are compatible with
|
|
rdobuilder |
91ebf2 |
both PEP 495 and pytz’s interface, to make it easier for libraries to deprecate
|
|
rdobuilder |
91ebf2 |
pytz.}
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
%description %{common_description}
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
%package -n python3-pytz-deprecation-shim
|
|
rdobuilder |
91ebf2 |
Summary: %{summary}
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
# Depend on the system tzdata RPM, not the PyPI “tzdata” fallback package
|
|
rdobuilder |
91ebf2 |
Requires: tzdata
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
%description -n python3-pytz-deprecation-shim %{common_description}
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
%prep
|
|
rdobuilder |
91ebf2 |
%autosetup -n pytz_deprecation_shim-%{version}
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
sed -i 's/pytest-randomly//g' tox.ini
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
|
|
rdobuilder |
91ebf2 |
sed -r -i -e '/\bpytest-cov\b/d' -e 's/--cov=[^[:blank:]}]+//g' tox.ini
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
# Depend on the system tzdata RPM, not the PyPI “tzdata” fallback package
|
|
rdobuilder |
91ebf2 |
sed -r -i -e '/\btzdata\b/d' setup.cfg
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
%generate_buildrequires
|
|
rdobuilder |
91ebf2 |
%pyproject_buildrequires -t
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
%build
|
|
rdobuilder |
91ebf2 |
%pyproject_wheel
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
%install
|
|
rdobuilder |
91ebf2 |
%pyproject_install
|
|
rdobuilder |
91ebf2 |
%pyproject_save_files pytz_deprecation_shim
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
%check
|
|
rdobuilder |
91ebf2 |
%tox
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
%files -n python3-pytz-deprecation-shim -f %{pyproject_files}
|
|
rdobuilder |
91ebf2 |
# pyproject-rpm-macros takes care of the LICENSE file in dist-info, but not
|
|
rdobuilder |
91ebf2 |
# licenses/LICENSE_APACHE; we manually include both files in %%_licensedir
|
|
rdobuilder |
91ebf2 |
%license LICENSE
|
|
rdobuilder |
91ebf2 |
%license licenses/LICENSE_APACHE
|
|
rdobuilder |
91ebf2 |
%doc CHANGELOG.rst
|
|
rdobuilder |
91ebf2 |
%doc README.rst
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
|
|
rdobuilder |
91ebf2 |
%changelog
|
|
rdobuilder |
91ebf2 |
* Sat Oct 29 2022 Benjamin A. Beasley <code@musicinmybrain.net> 0.1.0.post0-1
|
|
rdobuilder |
91ebf2 |
- Initial package
|