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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question: plan for pendulum_dt given lack of 3.13 support #239

Open
zzstoatzz opened this issue Nov 15, 2024 · 6 comments
Open

question: plan for pendulum_dt given lack of 3.13 support #239

zzstoatzz opened this issue Nov 15, 2024 · 6 comments

Comments

@zzstoatzz
Copy link

zzstoatzz commented Nov 15, 2024

I would have opened a discussion, but I appear unable

Is there any plan for what to do about pendulum's lack of 3.13 support? and general uncertainty around maintenance

It's unclear from their issues whether support will be added, but of course we would (at Prefect) like to support 3.13 as soon as we can.

Just opening this to start a conversation - cheers!


it appears with lack of published wheels, we'd be forced to install rust ... which doesn't seem ideal

@zzstoatzz zzstoatzz reopened this Nov 15, 2024
@zzstoatzz
Copy link
Author

zzstoatzz commented Nov 15, 2024

in case its helpful to anyone, this works (with aforementioned disclaimer that its not ideal to install rust for pendulum)

FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim

ENV UV_SYSTEM_PYTHON=1
ENV RUSTUP_HOME=/usr/local/rustup \
    CARGO_HOME=/usr/local/cargo \
    PATH=/usr/local/cargo/bin:$PATH

RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    curl \
    build-essential && \
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* && \

CMD ["uvx", "prefect", "server", "start"]

@zzstoatzz
Copy link
Author

@yezz123 any thoughts?

@yezz123
Copy link
Collaborator

yezz123 commented Dec 3, 2024

@yezz123 any thoughts?

Hello @zzstoatzz 👋🏻 , This issue isn't directly related to pydantic-extra-types, but it impacts our ecosystem. Here are some potential approaches we could consider:

Community Fork Strategy

  • A temporary community-maintained pendulum fork with Python 3.13 support could bridge the gap.

Alternative Options

  • For teams that need immediate Python 3.13 compatibility, we could document alternative datetime libraries that already support 3.13.
  • Libraries like arrow or datetime could serve as temporary replacements

Next Steps

  • We can track the upstream pendulum issue for official 3.13 support.
  • If any community members are interested in maintaining a temporary fork

Would the community be interested in collaborating on a temporary fork solution? This could help bridge the gap while we await official Python 3.13 support from Pendulum.

@zzstoatzz
Copy link
Author

zzstoatzz commented Dec 3, 2024

Thanks for the response @yezz123!

This issue isn't directly related to pydantic-extra-types

So, to clarify: the pendulum_dt module in pydantic-extra-types currently appears to be unusable on Python 3.13 without first installing rust (please do let me know if this is untrue and I am missing something):

» uv run --python 3.13 --with pydantic-extra-types --with pendulum python -c "from pydantic_extra_types.pendulum_dt import DateTime"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/nate/Library/Caches/uv/archive-v0/6asPR-YLBwuoyda2jagNN/lib/python3.13/site-packages/pydantic_extra_types/pendulum_dt.py", line 18, in <module>
    from pydantic import GetCoreSchemaHandler
  File "/Users/nate/Library/Caches/uv/archive-v0/6asPR-YLBwuoyda2jagNN/lib/python3.13/site-packages/pydantic/__init__.py", line 418, in __getattr__
    module = import_module(module_name, package=package)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nate/Library/Caches/uv/archive-v0/6asPR-YLBwuoyda2jagNN/lib/python3.13/site-packages/pydantic/annotated_handlers.py", line 7, in <module>
    from pydantic_core import core_schema
  File "/Users/nate/Library/Caches/uv/archive-v0/6asPR-YLBwuoyda2jagNN/lib/python3.13/site-packages/pydantic_core/__init__.py", line 6, in <module>
    from ._pydantic_core import (
ImportError: dlopen(/Users/nate/Library/Caches/uv/archive-v0/6asPR-YLBwuoyda2jagNN/lib/python3.13/site-packages/pydantic_core/_pydantic_core.cpython-313-darwin.so, 0x0002): symbol not found in flat namespace '_PyList_GetItemRef'

We can track the upstream pendulum issue for official 3.13 support.

While tracking the upstream issue would normally make a lot of sense to me, the concern that lead me to create this issue was the uncertainty around pendulum's ongoing maintenance.

If any community members are interested in maintaining a temporary fork

I'm curious about pydantic-extra-types' plans for datetime support that would be compatible with Python 3.13 if pendulum remains unmaintained and a community fork doesn't materialize. Any thoughts?

@yezz123
Copy link
Collaborator

yezz123 commented Dec 6, 2024

Sorry for not getting back to you sooner @zzstoatzz .

For datetime support in Python 3.13, I'm exploring these options:

  1. Create a pure Python implementation that doesn't rely on pendulum, using stdlib's datetime (https://docs.pydantic.dev/latest/api/standard_library_types/#datetimedatetime)
  2. Make pendulum an optional dependency and provide a fallback behavior ( Something like an exception for py3.13)

In the short term, I'd recommend either:

  • Stay on Python 3.12 if someone needs pendulum features.
  • Use standard datetime objects if you're moving to 3.13

Would you be interested in contributing to any of these approaches? We could especially use help with option 1 or 2.

Let me know if you'd like to explore these options more.

@zzstoatzz
Copy link
Author

thanks for the response @yezz123 - let me discuss the options with my team and get back to you here!

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

No branches or pull requests

2 participants