Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test_prereleases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
paths:
- '.github/workflows/test_prereleases.yml'
- 'pyproject.toml'
- 'launcher.spec'
- 'requirements/pre_test_problematic_version.txt'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
2 changes: 2 additions & 0 deletions launcher.spec
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ hiddenimports = (
"imagecodecs._imagecodecs",
"PartSeg.plugins.napari_widgets",
"PartSegCore.napari_io",
"tzdata",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 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

  • Ensure tzdata is installed/packaged with your app (declare it in requirements). If you rely on zone names (e.g. "US/Eastern"), zoneinfo needs the IANA files at runtime. [2][3]
  • With PyInstaller you must include tzdata’s package data (the zoneinfo directory) into the bundle because PyInstaller does not automatically include non‑code data. Use one of:
    • pyinstaller options: --collect-data tzdata (or --add-data pointing to tzdata/zoneinfo) or --collect-all tzdata.
    • Or add datas to the .spec (collect_data_files('tzdata') / manual importlib-based path). [4][5][6]

Practical steps

  1. pip install tzdata and add tzdata to your packaging requirements. [3]
  2. Build with PyInstaller and include tzdata data, e.g.:
    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]
  3. Test the frozen executable on the target OS (especially Windows / minimal containers) to confirm ZoneInfo(key) works (no ZoneInfoNotFoundError). [2]

References

  • pandas 3.0 whats‑new (tzdata minimum & zoneinfo default). [1]
  • Python zoneinfo docs (behavior, fallback to tzdata, ZoneInfoNotFoundError). [2]
  • tzdata package documentation / PyPI (what tzdata provides). [3]
  • PyInstaller docs and common recipes for including package data (--collect-data / --add-data / spec file). [4][5]

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)

  1. Ensure tzdata is installed in your build environment:
    pip install tzdata. [2][3]

  2. 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]

  1. If you still see ZoneInfoNotFoundError, confirm zoneinfo falls back to tzdata (Python docs) and that tzdata's zoneinfo files were actually bundled into the exe (check dist// or use runtime print of sys._MEIPASS). [2][3]

Why

  • zoneinfo uses system tz DB or the tzdata package; on Windows (or systems without system tz data) you must ship tzdata. PyInstaller’s static analysis can miss data-only packages, so you must explicitly include them. [2][3][1]

References

  • PyInstaller hooks / hiddenimports / collect_data_files. [1]
  • Python zoneinfo docs (tzdata fallback). [2]
  • tzdata package documentation (what files to include). [3]
  • Examples / community reports about pandas + PyInstaller hidden imports. [4]

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 tzdata to hiddenimports is 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:

from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('tzdata')

Then include datas in the Analysis() call.

🤖 Prompt for AI Agents
In launcher.spec around line 98, hiddenimports already includes 'tzdata' but the
tzdata package data files (.zoneinfo) are not being collected; import
collect_data_files from PyInstaller.utils.hooks, call
collect_data_files('tzdata') to produce a datas variable, and pass that datas
into the Analysis(...) call so the tzdata data files are bundled with the
executable.

]
+ [x.module_name for x in imageio_known_plugins.values()]
+ [x for x in collect_submodules("skimage") if "tests" not in x]
Expand Down Expand Up @@ -183,6 +184,7 @@ a = Analysis(
+ collect_data_files("freetype")
+ collect_data_files("skimage")
+ collect_data_files("fonticon_fa6")
+ collect_data_files('tzdata')
+ collect_data_files("jsonschema_specifications")
+ collect_data_files("PartSegCore-compiled-backend")
+ pyzmq_data
Expand Down
Loading