Skip to content

Commit

Permalink
remove TZDIR work-arounds
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed May 21, 2024
1 parent 7bfab1e commit 5668756
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
5 changes: 2 additions & 3 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ source:
sha256: aec25c98c5bf77a9ce5c1d2e9bf0564b4129339c8a122f42d6c55d8bdcef42d6
patches:
- patches/0001-point-to-our-own-libraries-includes.patch
- patches/0002-remove-TZDIR-work-arounds-that-aren-t-needed-for-orc.patch

build:
number: 0
Expand All @@ -32,15 +33,13 @@ requirements:
run:
- python
- backports.zoneinfo # [py<39]
- python-tzdata # [win]
- tzdata

test:
requires:
- pytest
imports:
- pytest
- pyorc
- tzdata # [win]
source_files:
- tests/
commands:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From dd0833a651f238114c7b744bd190036d64f01a23 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Tue, 21 May 2024 17:27:27 +1100
Subject: [PATCH] point to our own libraries/includes
Subject: [PATCH 1/2] point to our own libraries/includes

---
setup.py | 19 ++++---------------
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From 3175fd8250a35a85e9e5e64b1980806d269c4e32 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Tue, 21 May 2024 21:38:05 +1100
Subject: [PATCH 2/2] remove TZDIR work-arounds that aren't needed for
orc>=2.0.1

---
setup.py | 1 -
src/pyorc/__init__.py | 8 --------
2 files changed, 9 deletions(-)

diff --git a/setup.py b/setup.py
index 2d147b2..14e6287 100644
--- a/setup.py
+++ b/setup.py
@@ -263,7 +263,6 @@ setup(
],
python_requires=">=3.6",
install_requires=[
- 'tzdata >= 2020.5 ; sys_platform == "win32"',
'backports.zoneinfo >= 0.2.1 ; python_version < "3.9"',
],
)
diff --git a/src/pyorc/__init__.py b/src/pyorc/__init__.py
index 9be7043..447481c 100644
--- a/src/pyorc/__init__.py
+++ b/src/pyorc/__init__.py
@@ -2,14 +2,6 @@ import os
import sys
from typing import NamedTuple

-if sys.platform.startswith("win32") and "TZDIR" not in os.environ:
- # Windows does not come with a standard IANA time zone database,
- # but the ORC lib requires it. Set the TZDIR environment variable
- # to the tzdata module's data directory.
- import tzdata
-
- os.environ["TZDIR"] = os.path.join(os.path.dirname(tzdata.__file__), "zoneinfo")
-
from pyorc._pyorc import _orc_version

from .enums import *

0 comments on commit 5668756

Please sign in to comment.