Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add discussion about zoneinfo package to wasm-constraints.md #4668

Open
hoodmane opened this issue Apr 5, 2024 · 4 comments
Open

Add discussion about zoneinfo package to wasm-constraints.md #4668

hoodmane opened this issue Apr 5, 2024 · 4 comments

Comments

@hoodmane
Copy link
Member

hoodmane commented Apr 5, 2024

馃摎 Documentation

By default, zoneinfo is missing all the timezones. It's necessary to install the tzdata package to get them. I think we should:

  1. mention this in wasm-constraints docs
  2. add tzdata package recipe (I thought we already had one but it doesn't seem so)
  3. maybe make tzinfo warn instructing the user to install tzdata if it's used without installing tzdata
@joemarshall
Copy link
Contributor

yes to this. Needed for pyarrow also, so I don't mind doing it while I'm on that. It's a pure python package, so the recipe should be trivial.

@joemarshall
Copy link
Contributor

I've put in a PR for this. If you build with zoneinfo in the package list, it at least means that importing zoneinfo will give the pyodide 'can't import package tzdata' message I think, as zoneinfo tries to load tzdata. It would be possible to include tzdata in the main pyodide distribution, but it is a 300kb wheel, so I'm guessing that's too much extra?

@hoodmane
Copy link
Member Author

Yeah I don't think we want to add 300kb. People can install tzdata if they need it. Ideally we ought to put a custom warning if they import zoneinfo without loading tzdata though.

@joemarshall
Copy link
Contributor

Yeah I don't think we want to add 300kb. People can install tzdata if they need it. Ideally we ought to put a custom warning if they import zoneinfo without loading tzdata though.

Yeah, I added a patch to give a warning when you lookup a timezone with zoneinfo and it fails. That way it doesn't error if you don't need to see the error (e.g. you're including some package that imports zoneinfo but don't use any time zone related functionality yourself), and also it doesn't error if you're in node.js with access to /usr/local/zoneinfo )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants