package/python-tzlocal: new package

Signed-off-by: Marcus Hoffmann <buildroot@bubu1.eu>
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
Marcus Hoffmann
2025-02-25 14:46:25 +01:00
committed by Julien Olivain
parent cf4f2f858d
commit 6ca1ee306a
7 changed files with 46 additions and 0 deletions

View File

@@ -2268,9 +2268,11 @@ F: package/picotool/
F: package/python-immutabledict/
F: package/python-jc/
F: package/python-ruamel-yaml-clib/
F: package/python-tzlocal/
F: package/python-waitress/
F: support/testing/tests/package/test_python_fastapi.py
F: support/testing/tests/package/test_python_ruamel_yaml.py
F: support/testing/tests/package/test_python_tzlocal.py
F: support/testing/tests/package/test_python_waitress.py
F: support/testing/tests/package/sample_python_fastapi.py
F: support/testing/tests/package/sample_python_ruamel_yaml.py

View File

@@ -1453,6 +1453,7 @@ menu "External python modules"
source "package/python-types-python-dateutil/Config.in"
source "package/python-typing-extensions/Config.in"
source "package/python-typing-inspect/Config.in"
source "package/python-tzlocal/Config.in"
source "package/python-u-msgpack/Config.in"
source "package/python-ubjson/Config.in"
source "package/python-uhid/Config.in"

View File

@@ -0,0 +1,5 @@
config BR2_PACKAGE_PYTHON_TZLOCAL
bool "python-tzlocal"
help
A Python module that tries to figure out what your
local timezone is.

View File

@@ -0,0 +1,5 @@
# md5, sha256 from https://pypi.org/pypi/tzlocal/json
md5 9d8d4c12b047d5d45e6eb72bb95fd90e tzlocal-5.3.tar.gz
sha256 2fafbfc07e9d8b49ade18f898d6bcd37ae88ce3ad6486842a2e4f03af68323d2 tzlocal-5.3.tar.gz
# Locally computed sha256 checksums
sha256 d99ab209aeb16aad2c25c90ffd83c1a981e290ffff76a420a2ab03e03f041b8c LICENSE.txt

View File

@@ -0,0 +1,14 @@
################################################################################
#
# python-tzlocal
#
################################################################################
PYTHON_TZLOCAL_VERSION = 5.3
PYTHON_TZLOCAL_SOURCE = tzlocal-$(PYTHON_TZLOCAL_VERSION).tar.gz
PYTHON_TZLOCAL_SITE = https://files.pythonhosted.org/packages/33/cc/11360404b20a6340b9b4ed39a3338c4af47bc63f87f6cea94dbcbde07029
PYTHON_TZLOCAL_SETUP_TYPE = setuptools
PYTHON_TZLOCAL_LICENSE = MIT
PYTHON_TZLOCAL_LICENSE_FILES = LICENSE.txt
$(eval $(python-package))

View File

@@ -0,0 +1,5 @@
from tzlocal import get_localzone
from zoneinfo import ZoneInfo
tz = get_localzone()
assert tz == ZoneInfo(key='posix/Europe/Berlin')

View File

@@ -0,0 +1,14 @@
from tests.package.test_python import TestPythonPackageBase
class TestPythonPy3TZLocal(TestPythonPackageBase):
__test__ = True
config = TestPythonPackageBase.config + \
"""
BR2_TARGET_TZ_INFO=y
BR2_TARGET_LOCALTIME="Europe/Berlin"
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON_TZLOCAL=y
"""
sample_scripts = ["tests/package/sample_python_tzlocal.py"]
timeout = 10