public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/pytzdata/, dev-python/pytzdata/files/
@ 2021-07-09 14:44 Michał Górny
  0 siblings, 0 replies; only message in thread
From: Michał Górny @ 2021-07-09 14:44 UTC (permalink / raw
  To: gentoo-commits

commit:     03b481085bc20e6c9ea57a15335054256eb33cb4
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  9 08:19:33 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul  9 14:44:15 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03b48108

dev-python/pytzdata: Use system zoneinfo by default

Closes: https://bugs.gentoo.org/801280
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../files/pytzdata-2020.1-system-zoneinfo.patch    | 115 +++++++++++++++++++++
 ...ata-2020.1.ebuild => pytzdata-2020.1-r1.ebuild} |   9 +-
 2 files changed, 121 insertions(+), 3 deletions(-)

diff --git a/dev-python/pytzdata/files/pytzdata-2020.1-system-zoneinfo.patch b/dev-python/pytzdata/files/pytzdata-2020.1-system-zoneinfo.patch
new file mode 100644
index 00000000000..7a4cced9e72
--- /dev/null
+++ b/dev-python/pytzdata/files/pytzdata-2020.1-system-zoneinfo.patch
@@ -0,0 +1,115 @@
+From f0d2c5fd28dbe2aa9ecb59e140ab42b11d677a33 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Fri, 9 Jul 2021 10:15:51 +0200
+Subject: [PATCH] Use system zoneinfo database by default
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Michał Górny <mgorny@gentoo.org>
+---
+ pytzdata/__init__.py        | 2 +-
+ tests/test_set_directory.py | 8 +++-----
+ tests/test_tz_file.py       | 5 ++---
+ tests/test_tz_path.py       | 5 ++---
+ 4 files changed, 8 insertions(+), 12 deletions(-)
+
+diff --git a/pytzdata/__init__.py b/pytzdata/__init__.py
+index 22940da..6c3bcb9 100644
+--- a/pytzdata/__init__.py
++++ b/pytzdata/__init__.py
+@@ -8,7 +8,7 @@ from ._compat import FileNotFoundError
+ 
+ 
+ DEFAULT_DIRECTORY = os.path.join(
+-    os.path.dirname(__file__),
++    '/usr/share',
+     'zoneinfo'
+ )
+ 
+diff --git a/tests/test_set_directory.py b/tests/test_set_directory.py
+index 430d239..6c078e6 100644
+--- a/tests/test_set_directory.py
++++ b/tests/test_set_directory.py
+@@ -2,7 +2,7 @@
+ 
+ import os
+ import pytest
+-from pytzdata import set_directory, tz_path, TimezoneNotFound
++from pytzdata import set_directory, tz_path, TimezoneNotFound, DEFAULT_DIRECTORY
+ 
+ 
+ fixtures_path = os.path.join(os.path.dirname(__file__), 'fixtures', 'tz')
+@@ -30,9 +30,8 @@ def test_set_directory():
+     with pytest.raises(TimezoneNotFound):
+         tz_path('America/New_York')
+ 
+-    here = os.path.realpath(os.path.dirname(__file__))
+     filepath = os.path.realpath(
+-        os.path.join(here, '..', 'pytzdata', 'zoneinfo', 'America', 'New_York')
++        os.path.join(DEFAULT_DIRECTORY, 'America', 'New_York')
+     )
+ 
+     set_directory()
+@@ -51,9 +50,8 @@ def test_env_variable():
+ 
+     del os.environ['PYTZDATA_TZDATADIR']
+ 
+-    here = os.path.realpath(os.path.dirname(__file__))
+     filepath = os.path.realpath(
+-        os.path.join(here, '..', 'pytzdata', 'zoneinfo', 'America', 'New_York')
++        os.path.join(DEFAULT_DIRECTORY, 'America', 'New_York')
+     )
+ 
+     set_directory()
+diff --git a/tests/test_tz_file.py b/tests/test_tz_file.py
+index 8b912b5..b20c08b 100644
+--- a/tests/test_tz_file.py
++++ b/tests/test_tz_file.py
+@@ -3,7 +3,7 @@
+ import os
+ import pytest
+ 
+-from pytzdata import tz_file, set_directory
++from pytzdata import tz_file, set_directory, DEFAULT_DIRECTORY
+ from pytzdata.exceptions import TimezoneNotFound
+ 
+ 
+@@ -22,9 +22,8 @@ def teardown_module(module):
+ 
+ 
+ def test_tz_file():
+-    here = os.path.realpath(os.path.dirname(__file__))
+     filepath = os.path.realpath(
+-        os.path.join(here, '..', 'pytzdata', 'zoneinfo', 'Europe', 'Paris')
++        os.path.join(DEFAULT_DIRECTORY, 'Europe', 'Paris')
+     )
+ 
+     with open(filepath) as f1:
+diff --git a/tests/test_tz_path.py b/tests/test_tz_path.py
+index fd4db48..77c8c74 100644
+--- a/tests/test_tz_path.py
++++ b/tests/test_tz_path.py
+@@ -3,7 +3,7 @@
+ import os
+ import pytest
+ 
+-from pytzdata import tz_path, set_directory
++from pytzdata import tz_path, set_directory, DEFAULT_DIRECTORY
+ from pytzdata.exceptions import TimezoneNotFound
+ 
+ 
+@@ -22,9 +22,8 @@ def teardown_module(module):
+ 
+ 
+ def test_tz_path():
+-    here = os.path.realpath(os.path.dirname(__file__))
+     filepath = os.path.realpath(
+-        os.path.join(here, '..', 'pytzdata', 'zoneinfo', 'Europe', 'Paris')
++        os.path.join(DEFAULT_DIRECTORY, 'Europe', 'Paris')
+     )
+ 
+     assert filepath == tz_path('Europe/Paris')
+-- 
+2.32.0
+

diff --git a/dev-python/pytzdata/pytzdata-2020.1.ebuild b/dev-python/pytzdata/pytzdata-2020.1-r1.ebuild
similarity index 81%
rename from dev-python/pytzdata/pytzdata-2020.1.ebuild
rename to dev-python/pytzdata/pytzdata-2020.1-r1.ebuild
index 1863e027767..d6192adb5e3 100644
--- a/dev-python/pytzdata/pytzdata-2020.1.ebuild
+++ b/dev-python/pytzdata/pytzdata-2020.1-r1.ebuild
@@ -1,10 +1,10 @@
 # Copyright 2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
 DISTUTILS_USE_SETUPTOOLS=pyproject.toml
-PYTHON_COMPAT=( python3_{7..10} )
+PYTHON_COMPAT=( python3_{8..10} )
 inherit distutils-r1
 
 DESCRIPTION="The Olson timezone database for Python"
@@ -16,6 +16,9 @@ SLOT="0"
 KEYWORDS="amd64 x86"
 
 RDEPEND="dev-python/cleo[${PYTHON_USEDEP}]"
-DEPEND="${RDEPEND}"
 
 distutils_enable_tests pytest
+
+PATCHES=(
+	"${FILESDIR}"/pytzdata-2020.1-system-zoneinfo.patch
+)


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-09 14:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-09 14:44 [gentoo-commits] repo/gentoo:master commit in: dev-python/pytzdata/, dev-python/pytzdata/files/ Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox