%global _empty_manifest_terminate_build 0 Name: python-backports.zoneinfo Version: 0.2.1 Release: 1 Summary: Backport of the standard library zoneinfo module License: Apache-2.0 URL: https://github.com/pganssle/zoneinfo Source0: https://mirrors.nju.edu.cn/pypi/web/packages/ad/85/475e514c3140937cf435954f78dedea1861aeab7662d11de232bdaa90655/backports.zoneinfo-0.2.1.tar.gz Requires: python3-importlib-resources Requires: python3-tzdata %description # `backports.zoneinfo`: Backport of the standard library module `zoneinfo` This package was originally the reference implementation for [PEP 615](https://www.python.org/dev/peps/pep-0615/), which proposes support for the IANA time zone database in the standard library, and now serves as a backport to Python 3.6+ (including PyPy). This exposes the `backports.zoneinfo` module, which is a backport of the [`zoneinfo`](https://docs.python.org/3.9/library/zoneinfo.html#module-zoneinfo) module. The backport's documentation can be found [on readthedocs](https://zoneinfo.readthedocs.io/en/latest/). The module uses the system time zone data if available, and falls back to the [`tzdata`](https://tzdata.readthedocs.io/en/latest/) package (available [on PyPI](https://pypi.org/project/tzdata/)) if installed. ## Installation and depending on this library This module is called [`backports.zoneinfo`](https://pypi.org/project/backports.zoneinfo) on PyPI. To install it in your local environment, use: ``` pip install backports.zoneinfo ``` Or (particularly on Windows), you can also use the `tzdata` extra (which basically just declares a dependency on `tzdata`, so this doesn't actually save you any typing 😅): ``` pip install backports.zoneinfo[tzdata] ``` If you want to use this in your application, it is best to use [PEP 508 environment markers](https://www.python.org/dev/peps/pep-0508/#environment-markers) to declare a dependency *conditional on the Python version*: ``` backports.zoneinfo;python_version<"3.9" ``` Support for `backports.zoneinfo` in Python 3.9+ is currently minimal, since it is expected that you would use the standard library `zoneinfo` module instead. ## Use The `backports.zoneinfo` module should be a drop-in replacement for the Python 3.9 standard library module `zoneinfo`. If you do not support anything earlier than Python 3.9, **you do not need this library**; if you are supporting Python 3.6+, you may want to use this idiom to "fall back" to ``backports.zoneinfo``: ```python try: import zoneinfo except ImportError: from backports import zoneinfo ``` To get access to time zones with this module, construct a `ZoneInfo` object and attach it to your datetime: ```python >>> from backports.zoneinfo import ZoneInfo >>> from datetime import datetime, timedelta, timezone >>> dt = datetime(1992, 3, 1, tzinfo=ZoneInfo("Europe/Minsk")) >>> print(dt) 1992-03-01 00:00:00+02:00 >>> print(dt.utcoffset()) 2:00:00 >>> print(dt.tzname()) EET ``` Arithmetic works as expected without the need for a "normalization" step: ```python >>> dt += timedelta(days=90) >>> print(dt) 1992-05-30 00:00:00+03:00 >>> dt.utcoffset() datetime.timedelta(seconds=10800) >>> dt.tzname() 'EEST' ``` Ambiguous and imaginary times are handled using the `fold` attribute added in [PEP 495](https://www.python.org/dev/peps/pep-0495/): ```python >>> dt = datetime(2020, 11, 1, 1, tzinfo=ZoneInfo("America/Chicago")) >>> print(dt) 2020-11-01 01:00:00-05:00 >>> print(dt.replace(fold=1)) 2020-11-01 01:00:00-06:00 >>> UTC = timezone.utc >>> print(dt.astimezone(UTC)) 2020-11-01 06:00:00+00:00 >>> print(dt.replace(fold=1).astimezone(UTC)) 2020-11-01 07:00:00+00:00 ``` # Contributing Currently we are not accepting contributions to this repository because we have not put the CLA in place and we would like to avoid complicating the process of adoption into the standard library. Contributions to [CPython](https://github.com/python/cpython) will eventually be backported to this repository — see [the Python developer's guide](https://devguide.python.org/) for more information on how to contribute to CPython. %package -n python3-backports.zoneinfo Summary: Backport of the standard library zoneinfo module Provides: python-backports.zoneinfo BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip BuildRequires: python3-cffi BuildRequires: gcc BuildRequires: gdb %description -n python3-backports.zoneinfo # `backports.zoneinfo`: Backport of the standard library module `zoneinfo` This package was originally the reference implementation for [PEP 615](https://www.python.org/dev/peps/pep-0615/), which proposes support for the IANA time zone database in the standard library, and now serves as a backport to Python 3.6+ (including PyPy). This exposes the `backports.zoneinfo` module, which is a backport of the [`zoneinfo`](https://docs.python.org/3.9/library/zoneinfo.html#module-zoneinfo) module. The backport's documentation can be found [on readthedocs](https://zoneinfo.readthedocs.io/en/latest/). The module uses the system time zone data if available, and falls back to the [`tzdata`](https://tzdata.readthedocs.io/en/latest/) package (available [on PyPI](https://pypi.org/project/tzdata/)) if installed. ## Installation and depending on this library This module is called [`backports.zoneinfo`](https://pypi.org/project/backports.zoneinfo) on PyPI. To install it in your local environment, use: ``` pip install backports.zoneinfo ``` Or (particularly on Windows), you can also use the `tzdata` extra (which basically just declares a dependency on `tzdata`, so this doesn't actually save you any typing 😅): ``` pip install backports.zoneinfo[tzdata] ``` If you want to use this in your application, it is best to use [PEP 508 environment markers](https://www.python.org/dev/peps/pep-0508/#environment-markers) to declare a dependency *conditional on the Python version*: ``` backports.zoneinfo;python_version<"3.9" ``` Support for `backports.zoneinfo` in Python 3.9+ is currently minimal, since it is expected that you would use the standard library `zoneinfo` module instead. ## Use The `backports.zoneinfo` module should be a drop-in replacement for the Python 3.9 standard library module `zoneinfo`. If you do not support anything earlier than Python 3.9, **you do not need this library**; if you are supporting Python 3.6+, you may want to use this idiom to "fall back" to ``backports.zoneinfo``: ```python try: import zoneinfo except ImportError: from backports import zoneinfo ``` To get access to time zones with this module, construct a `ZoneInfo` object and attach it to your datetime: ```python >>> from backports.zoneinfo import ZoneInfo >>> from datetime import datetime, timedelta, timezone >>> dt = datetime(1992, 3, 1, tzinfo=ZoneInfo("Europe/Minsk")) >>> print(dt) 1992-03-01 00:00:00+02:00 >>> print(dt.utcoffset()) 2:00:00 >>> print(dt.tzname()) EET ``` Arithmetic works as expected without the need for a "normalization" step: ```python >>> dt += timedelta(days=90) >>> print(dt) 1992-05-30 00:00:00+03:00 >>> dt.utcoffset() datetime.timedelta(seconds=10800) >>> dt.tzname() 'EEST' ``` Ambiguous and imaginary times are handled using the `fold` attribute added in [PEP 495](https://www.python.org/dev/peps/pep-0495/): ```python >>> dt = datetime(2020, 11, 1, 1, tzinfo=ZoneInfo("America/Chicago")) >>> print(dt) 2020-11-01 01:00:00-05:00 >>> print(dt.replace(fold=1)) 2020-11-01 01:00:00-06:00 >>> UTC = timezone.utc >>> print(dt.astimezone(UTC)) 2020-11-01 06:00:00+00:00 >>> print(dt.replace(fold=1).astimezone(UTC)) 2020-11-01 07:00:00+00:00 ``` # Contributing Currently we are not accepting contributions to this repository because we have not put the CLA in place and we would like to avoid complicating the process of adoption into the standard library. Contributions to [CPython](https://github.com/python/cpython) will eventually be backported to this repository — see [the Python developer's guide](https://devguide.python.org/) for more information on how to contribute to CPython. %package help Summary: Development documents and examples for backports.zoneinfo Provides: python3-backports.zoneinfo-doc %description help # `backports.zoneinfo`: Backport of the standard library module `zoneinfo` This package was originally the reference implementation for [PEP 615](https://www.python.org/dev/peps/pep-0615/), which proposes support for the IANA time zone database in the standard library, and now serves as a backport to Python 3.6+ (including PyPy). This exposes the `backports.zoneinfo` module, which is a backport of the [`zoneinfo`](https://docs.python.org/3.9/library/zoneinfo.html#module-zoneinfo) module. The backport's documentation can be found [on readthedocs](https://zoneinfo.readthedocs.io/en/latest/). The module uses the system time zone data if available, and falls back to the [`tzdata`](https://tzdata.readthedocs.io/en/latest/) package (available [on PyPI](https://pypi.org/project/tzdata/)) if installed. ## Installation and depending on this library This module is called [`backports.zoneinfo`](https://pypi.org/project/backports.zoneinfo) on PyPI. To install it in your local environment, use: ``` pip install backports.zoneinfo ``` Or (particularly on Windows), you can also use the `tzdata` extra (which basically just declares a dependency on `tzdata`, so this doesn't actually save you any typing 😅): ``` pip install backports.zoneinfo[tzdata] ``` If you want to use this in your application, it is best to use [PEP 508 environment markers](https://www.python.org/dev/peps/pep-0508/#environment-markers) to declare a dependency *conditional on the Python version*: ``` backports.zoneinfo;python_version<"3.9" ``` Support for `backports.zoneinfo` in Python 3.9+ is currently minimal, since it is expected that you would use the standard library `zoneinfo` module instead. ## Use The `backports.zoneinfo` module should be a drop-in replacement for the Python 3.9 standard library module `zoneinfo`. If you do not support anything earlier than Python 3.9, **you do not need this library**; if you are supporting Python 3.6+, you may want to use this idiom to "fall back" to ``backports.zoneinfo``: ```python try: import zoneinfo except ImportError: from backports import zoneinfo ``` To get access to time zones with this module, construct a `ZoneInfo` object and attach it to your datetime: ```python >>> from backports.zoneinfo import ZoneInfo >>> from datetime import datetime, timedelta, timezone >>> dt = datetime(1992, 3, 1, tzinfo=ZoneInfo("Europe/Minsk")) >>> print(dt) 1992-03-01 00:00:00+02:00 >>> print(dt.utcoffset()) 2:00:00 >>> print(dt.tzname()) EET ``` Arithmetic works as expected without the need for a "normalization" step: ```python >>> dt += timedelta(days=90) >>> print(dt) 1992-05-30 00:00:00+03:00 >>> dt.utcoffset() datetime.timedelta(seconds=10800) >>> dt.tzname() 'EEST' ``` Ambiguous and imaginary times are handled using the `fold` attribute added in [PEP 495](https://www.python.org/dev/peps/pep-0495/): ```python >>> dt = datetime(2020, 11, 1, 1, tzinfo=ZoneInfo("America/Chicago")) >>> print(dt) 2020-11-01 01:00:00-05:00 >>> print(dt.replace(fold=1)) 2020-11-01 01:00:00-06:00 >>> UTC = timezone.utc >>> print(dt.astimezone(UTC)) 2020-11-01 06:00:00+00:00 >>> print(dt.replace(fold=1).astimezone(UTC)) 2020-11-01 07:00:00+00:00 ``` # Contributing Currently we are not accepting contributions to this repository because we have not put the CLA in place and we would like to avoid complicating the process of adoption into the standard library. Contributions to [CPython](https://github.com/python/cpython) will eventually be backported to this repository — see [the Python developer's guide](https://devguide.python.org/) for more information on how to contribute to CPython. %prep %autosetup -n backports.zoneinfo-0.2.1 %build %py3_build %install %py3_install 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 if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-backports.zoneinfo -f filelist.lst %dir %{python3_sitearch}/* %files help -f doclist.lst %{_docdir}/* %changelog * Fri Apr 21 2023 Python_Bot - 0.2.1-1 - Package Spec generated