2012-03-21 20:38:53 +01:00
|
|
|
#
|
|
|
|
# spec file for package python-pytz
|
|
|
|
#
|
- update to 2022.7:
* In the Mexican state of Chihuahua, the border strip near the US
will change to agree with nearby US locations on 2022-11-30.
The strip's western part, represented by Ciudad Juárez, switches
from -06 all year to -07/-06 with US DST rules, like El Paso, TX.
The eastern part, represented by Ojinaga, will observe US DST next
year, like Presidio, TX.
A new Zone America/Ciudad_Juarez splits from America/Ojinaga.
* Much of Greenland, represented by America/Nuuk, stops observing
winter time after March 2023, so its daylight saving time becomes
standard time.
* Changes for pre-1996 northern Canada
* Update to past DST transition in Colombia (1993), Singapore
(1981)
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pytz?expand=0&rev=112
2023-01-02 20:32:12 +01:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2012-03-21 20:38:53 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
2013-04-29 14:34:30 +02:00
|
|
|
|
2018-12-04 14:57:15 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2012-03-21 20:38:53 +01:00
|
|
|
#
|
|
|
|
|
2013-04-29 14:34:30 +02:00
|
|
|
|
2019-09-09 09:31:21 +02:00
|
|
|
# Ensure you update the tzdata_version for any minor version increase
|
|
|
|
# otherwise the update python library has the incorrect timezone data.
|
2023-03-27 09:33:27 +02:00
|
|
|
%define tzdata_version 2023b
|
2017-04-05 17:18:15 +02:00
|
|
|
%define oldpython python
|
2017-03-17 08:49:45 +01:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2021-07-08 19:35:28 +02:00
|
|
|
%{?!pyunittest:%define pyunittest(+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-=) \\\
|
|
|
|
%{lua: local args = rpm.expand("%**");
|
|
|
|
local broot = rpm.expand("%buildroot");
|
|
|
|
local intro = "%{python_expand PYTHONPATH=${PYTHONPATH:+$PYTHONPATH:}" .. broot .. "%{$python_sitelib} PYTHONDONTWRITEBYTECODE=1 $python -m unittest ";
|
|
|
|
print(rpm.expand(intro .. args .. "}"))
|
|
|
|
} }
|
|
|
|
|
2012-03-21 20:38:53 +01:00
|
|
|
Name: python-pytz
|
2023-03-27 09:33:27 +02:00
|
|
|
Version: 2023.2
|
2012-03-21 20:38:53 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: World timezone definitions, modern and historical
|
|
|
|
License: MIT
|
|
|
|
Group: Development/Languages/Python
|
2019-02-18 16:04:19 +01:00
|
|
|
URL: https://pythonhosted.org/pytz/
|
2018-02-19 21:21:31 +01:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/p/pytz/pytz-%{version}.tar.gz
|
|
|
|
Source2: https://files.pythonhosted.org/packages/source/p/pytz/pytz-%{version}.tar.gz.asc
|
2018-07-01 08:43:46 +02:00
|
|
|
Source90: %{name}.keyring
|
2014-08-12 15:50:27 +02:00
|
|
|
# PATCH-FIX-UPSTREAM fix-tests.patch -- Remote tests which are known to be broken
|
|
|
|
Patch0: fix-tests.patch
|
2017-06-29 09:02:05 +02:00
|
|
|
# PATCH-FIX-UPSTREAM 0001-Fix-tests-for-older-timezone-versions.patch -- https://code.launchpad.net/~toabctl/pytz/+git/pytz/+merge/326419
|
|
|
|
Patch2: 0001-Fix-tests-for-older-timezone-versions.patch
|
2019-02-18 16:04:19 +01:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2018-07-01 08:43:46 +02:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2019-09-09 09:31:21 +02:00
|
|
|
BuildRequires: timezone >= %{tzdata_version}
|
2019-02-18 16:04:19 +01:00
|
|
|
Requires: python-base
|
2019-09-09 09:31:21 +02:00
|
|
|
Requires: timezone >= %{tzdata_version}
|
2018-07-01 08:43:46 +02:00
|
|
|
BuildArch: noarch
|
2017-04-05 17:18:15 +02:00
|
|
|
%ifpython2
|
|
|
|
Provides: %{oldpython}-tz = %{version}
|
|
|
|
Obsoletes: %{oldpython}-tz < %{version}
|
|
|
|
%endif
|
2017-03-17 08:49:45 +01:00
|
|
|
%python_subpackages
|
2017-03-07 18:18:52 +01:00
|
|
|
|
2012-03-21 20:38:53 +01:00
|
|
|
%description
|
|
|
|
pytz - World Timezone Definitions for Python
|
|
|
|
pytz brings the Olson tz database into Python. This library allows
|
|
|
|
accurate and cross platform timezone calculations using Python 2.4
|
|
|
|
or higher. It also solves the issue of ambiguous times at the end
|
|
|
|
of daylight savings, which you can read more about in the Python
|
|
|
|
Library Reference (``datetime.tzinfo``).
|
|
|
|
|
|
|
|
Amost all of the Olson timezones are supported.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n pytz-%{version}
|
2019-01-09 18:21:14 +01:00
|
|
|
%autopatch -p1
|
2017-03-17 08:49:45 +01:00
|
|
|
|
2013-01-15 15:14:40 +01:00
|
|
|
# For rpmlint warning: remove shebang from python library:
|
|
|
|
sed -i '/^#!/d' ./pytz/tzfile.py
|
2012-03-21 20:38:53 +01:00
|
|
|
|
2019-09-09 09:31:21 +02:00
|
|
|
# Help Python 2.7 unittest
|
|
|
|
touch pytz/tests/__init__.py
|
|
|
|
|
2012-03-21 20:38:53 +01:00
|
|
|
%build
|
2017-03-17 08:49:45 +01:00
|
|
|
%python_build
|
2012-03-21 20:38:53 +01:00
|
|
|
|
|
|
|
%install
|
2017-03-17 08:49:45 +01:00
|
|
|
%python_install
|
2019-09-09 09:31:21 +02:00
|
|
|
# Replace custom data with symlink to /usr/share/zoneinfo
|
|
|
|
%{python_expand rm -r %{buildroot}%{$python_sitelib}/pytz/zoneinfo
|
2020-05-03 09:15:23 +02:00
|
|
|
ln -s %{_datadir}/zoneinfo %{buildroot}%{$python_sitelib}/pytz/zoneinfo
|
2019-09-09 09:31:21 +02:00
|
|
|
%fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
}
|
2012-03-21 20:38:53 +01:00
|
|
|
|
2014-08-12 15:50:27 +02:00
|
|
|
%check
|
2021-05-28 13:30:41 +02:00
|
|
|
%pyunittest discover -v
|
2012-03-21 20:38:53 +01:00
|
|
|
|
2021-06-24 23:48:23 +02:00
|
|
|
%pre
|
|
|
|
if [ $1 -gt 1 ] ; then
|
2022-08-15 22:14:05 +02:00
|
|
|
[ "$(readlink -e %{python_sitelib}/pytz/zoneinfo)" = "%{python_sitelib}/pytz/zoneinfo" ] && rm -rf %{python_sitelib}/pytz/zoneinfo
|
2021-06-24 23:48:23 +02:00
|
|
|
fi || :
|
|
|
|
|
2017-03-17 08:49:45 +01:00
|
|
|
%files %{python_files}
|
2018-07-01 08:43:46 +02:00
|
|
|
%license LICENSE.txt
|
2020-05-03 09:15:23 +02:00
|
|
|
%doc README.rst
|
|
|
|
%{python_sitelib}/pytz
|
|
|
|
%{python_sitelib}/pytz-%{version}-py*.egg-info
|
2012-03-21 20:38:53 +01:00
|
|
|
|
|
|
|
%changelog
|