-
Notifications
You must be signed in to change notification settings - Fork 10
chore: Add tzdata to hiddenimports, as preparation for pandas 3.0
#1335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
pandas 3.0 tzdata dependency pyinstaller timezone💡 Result:
Short answer — pandas 3.0 switched to using the stdlib zoneinfo (PEP 615) by default and raised tzdata as a required dependency (min tzdata 2023.3 noted in the 3.0 whats‑new). This means on platforms that lack a system IANA DB (notably Windows, some minimal Linux containers), ZoneInfo will fall back to the tzdata package; if neither system data nor tzdata are available you get ZoneInfoNotFoundError. [1][2][3]
What this means for PyInstaller builds
Practical steps
pyinstaller --onefile --collect-data tzdata your_app.py
(or edit .spec to include tzdata.zoneinfo files or use --add-data if you prefer explicit paths). [4][6]
References
If you want, I can produce the exact PyInstaller .spec snippet or a one-line build command tailored to your OS.
🌐 Web query:
pandas 3.0 release notes timezone handling💡 Result:
Summary of pandas 3.0 timezone-related changes (from the 3.0.0 "what's new" notes):
pd.offsets.Day now represents a calendar day (preserves wall clock time across DST), not a fixed 24-hour span — fixes date_range-related bugs but changes equality/operations semantics and can make additions ambiguous/non‑existent (these now raise). [1][2]
pandas now uses the stdlib zoneinfo as the default timezone implementation when a timezone string is passed; pytz is no longer required (but still supported if passed directly and can be installed via pip install pandas[timezone]). [1][2]
pandas no longer surfaces pytz-specific exceptions for ambiguous/nonexistent times; those cases now raise ValueError (and behavior around ambiguous/nonexistent times is more strict). [1][2]
(See the pandas 3.0 "What’s new" / release notes for full details and examples.) [1][2]
Sources:
[1] pandas 3.0.0 "What’s new" release notes. (pandas.pydata.org)
[2] pandas 3.0.0rc0 "What’s new" release notes. (pandas.pydata.org)
Citations:
🌐 Web query:
pyinstaller pandas hidden imports tzdata💡 Result:
Short answer — include tzdata as a package + its data when building.
What to do (quick steps)
Ensure tzdata is installed in your build environment:
pip install tzdata. [2][3]
Tell PyInstaller to include the tzdata package (hidden import) and its data files. Two ways:
Command line (quick):
pyinstaller --hidden-import=tzdata --hidden-import=pandas yourscript.py
Preferable: edit the .spec to collect tzdata data files so zoneinfo resources are bundled. Example additions to the top of your spec:
from PyInstaller.utils.hooks import collect_data_files, collect_submodules
datas = collect_data_files('tzdata')
hiddenimports = collect_submodules('tzdata') + collect_submodules('pandas')
(then pass datas and hiddenimports into Analysis). [1]
Why
References
If you want, I can produce a ready-to-use .spec file snippet tailored to your script and platform — tell me your Python version and OS.
Also collect tzdata's data files in the .spec; hidden import alone is insufficient.
Adding
tzdatatohiddenimportsis correct and necessary for pandas 3.0 (which now requires tzdata for timezone handling), but PyInstaller does not automatically bundle tzdata's data files (.zoneinfo directory). The bundle will fail at runtime on Windows or systems without system timezone data. Add to launcher.spec:Then include
datasin theAnalysis()call.🤖 Prompt for AI Agents