home.social

#pyo3 — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #pyo3, aggregated by home.social.

  1. You can now use Ratatui in Python! 🐀🥳

    🐍 **PyRatatui** — Python bindings for @ratatui_rs

    💯 Build high-performance TUIs in Python with 35+ widgets, async & effects

    🦀 Backed by Rust via PyO3

    ⭐ GitHub: github.com/pyratatui/pyratatui

  2. ZODB has served the Zope and Plone community for over two decades. But its storage model — opaque pickle blobs and BTree-based catalog indexes — hasn't aged well. You can't query your data with SQL. You can't inspect object state without unpickling. And the catalog is a black box that lives inside the very database it indexes.

    Time to change that. Four modules, one mission — get ZODB out of the pickle jar.

    community.plone.org/t/zodb-out

    #zope #plone #python #rust #pyo3 #postgres #jsonb #zodb

  3. RE: hachyderm.io/@itworldcup/11596

    I'm tempted to do something with #PyO3 in celebration of the ongoing #ITWorldCup finals, no matter the outcome.

  4. Как я Rust в Python встраивал

    Rust все популярней, а вместе c этим создается много библиотек для Python на Rust. В данной статье узнаем, как создать простенькую библиотеку для Python на Rust на примере кодирования данных в Base 64.

    habr.com/ru/articles/970752/

    #pyo3 #ускорение_кода #оптимизация_python #ffi

  5. Ah yes, the classic tale of #Python needing a lifeline, now through #Tauri and #Pyo3. 🤖 Because what could possibly go wrong when you mix #AI, #security, and a desperate attempt to stay relevant in the tech world? 🤦‍♂️ Just another day in the endless #GitHub maze of #innovation. 🌀
    github.com/pytauri/pytauri #HackerNews #ngated

  6. As a final preparation for the workshop tomorrow at , I have updated some exercises to ensure thread-safety. We are ready for ! Make sure you have the setup ready: github.com/Cheukting/py03_101

  7. Are you interested in how changes the ecosystem in ? Are you creating Python libraries using Rust code via ? Show your interest in participating in Rust in 2025 now! (details in the comment)

  8. At last night’s @mug meeting we looked at a lot of different solutions to #adventofcode day 1 in many different languages. Two that were very interesting to me were #Zig and #haskell. The way these two languages worked was really quite fascinating. After seeing real code in these two languages, I can tell they are not for me; but they were interesting and illuminating nonetheless.

    There was a solution entirely in #SQL. Another in #vim9script. Another in #swiftlang #swift (I don’t think that one’s in the repo yet). I wrote several implementations myself. The one I felt most proud of is #Python with the core written in #rustlang #rust tied together with #PyO3. The one I felt was maybe the best tool for the job was entirely based on #pandas. As I said in a previous post, I tried to solve it in #polars, but the API exposed by Polars at least as far as I could tell, made it no better than simple lists in Python. I need to get deeper knowledge here.

    The repo lives here: github.com/MichiganUnixUserGro.

  9. I did, during my previously mentioned workshop, do one thing to offend #Rust’s #borrowchecker. I was implementing an Account struct that had a current balance and a Vec containing a history of balances. This was using #PyO3 so there are some special types. Because of inheritance, I have self_ instead of self. Here’s the bad thing I said:

    self_.history.push(self_.as_super().balance);

    @algo_luca had to explain it to me. He didn’t even need to think about it. He instantly knew what was wrong. Now I am enlightened. I won’t make this particular kind of mistake again.

    Of course the mistake is that I was trying to use a mutable reference (so I could push to history) and anything else at the same time.

  10. Today I successfully wrote a #Rust implementation using #PyO3 that served as a package in my #Python program. Part of a presentation I’m doing for @mug. It’s day 1 of Advent of Code. I wrote four Python versions progressing from the simplest thing you would reasonably write up to packages and Rust. Here’s [the repo](github.com/MichiganUnixUserGro). Lots of people in this repo demoing lots of languages. My stuff lives at `code\Python\wolf`

  11. I’ve been writing a lot of #Python and #rust together over the last week or so, and I have things to say about that.

    * even though I’ve been using Python for decades; when working in two languages at the same time I have to keep double-checking the syntax on _both_

    * wow! Python can be a lot more succinct than Rust

    I really like them both very much. Neither one is a replacement for the other. I’m a huge fan of types. The bigger your plans, the more important types are. They’re required in Rust, but I always use the in Python, too.

    #PyO3 has proven to be incredible, though I still have so much to learn. What an amazing way to combine the two tools. Thanks. #mainmatter for leading me to this path.

  12. I just attended a two-day workshop on #rust-#Python interoperability (the main glue between the two was #PyO3). Run by @mainmatter. The instructor was @algo_luca Two days, four hours each. Speeding up big Python programs with little bits of Rust. I enjoyed every second of it. Luca either knew the answer to your question off the top of his head or he was willing to dig right then to find it. The exercises were good as well as deep; the instruction was effective, smart, and respectful; the results were exciting. I learned a lot. I would happily attend another event of the same caliber.

    Edit: originally I mistakenly said Mattermost. I meant to say Mainmatter. Thanks for pointing that out.

  13. A cóż ja mogę teraz robić, w piątkowy wieczór?

    Oczywiście, że wysyłam zgłoszenia do przypadkowych projektów #Python / #RustLang, prosząc o aktualizację wersji #PyO3 i nowe wydanie, po to, by móc wprowadzić wsparcie #PyPy 3.11 w #Gentoo. Bo, rzecz jasna, prawidłowy sposób rozwoju współczesnych paczek Pythona to przypadkowo przepisywanie ich fragmentów w Ruście, a potem ignorowanie konieczności aktualizowania zależności przez pół roku albo dłużej.

    Tak, mówię o tych wszystkich paczkach, które w ogóle jeszcze nie wspierają PyO3 0.23.x.

    A potem jeszcze przyjdą i powiedzą, że powinniśmy zostawić temat zależności i bezpieczeństwa autorom projektów.

  14. What could I be doing right now, on a Friday evening?

    Of course filing bugs on random #Python / #RustLang packages requesting a #PyO3 version update and a new release, to support #PyPy 3.11 in #Gentoo. Because obviously the right way to maintain modern Python packages is to rewrite random parts of them in Rust, then neglect updating their dependencies for half a year or more.

    Yes, I'm talking about all the packages that don't even support PyO3 0.23.x yet.

    And then they'll come and say that we should leave dependency management and security to upstreams.

  15. Dobra wiadomość: jest łatka dla #PyO3 dla wsparcia #PyPy 3.11, więc ruszamy z aktualizacjami w #Gentoo do przodu.

    Złe wiadomości:

    1. Mówimy o #RustLang, więc każdą paczkę trzeba łatać z osobna.
    2. Nie chcemy trzymać dziesiątek kopii tej samej łatki, więc chcemy ją ciągnąć z sieci. Niestety, nie możemy użyć oryginalnej kopii, bo modyfikuje pliki, których nie znajdziemy w archiwum crate.
    3. No więc trzymamy własną kopię tej łatki, ograniczoną do dostępnych plików. Niestety, pasuje tylko do wersji 0.23.4, a że mnóstwo paczek Pythona używa 0.23.3, to mamy sporo aktualizowania. Ale przynajmniej w większości przypadków wystarczy podmienić cyferki na liście `CRATES`, i wykasować `Cargo.lock`.
    4. …no chyba że dana paczka akurat wymusza dokładnie 0.23.3, albo używa 0.22.x bądź starszej wersji. Wtedy bez łatania `Cargo.toml` się nie obędzie.

    No ale idziemy do przodu. Tyle że warto jeszcze wspomnieć, że z paczek Pythona robi się coraz większy bajzel cyklicznych zależności, ale to już inna bajka.

    #Python

  16. Mi się wydaje, czy błędy testów w Maturinie są cosik straszne?

    (tak, oczywiście, że #PyO3 blokuje teraz portowanie do #PyPy 3.11, i będziemy mieli z tym od jasnej cholery roboty, bo przecież każda zasrana paczka będzie wymagać starej wersji)

    #Gentoo #Maturin #Python #RustLang

  17. Mi się wydaje, czy błędy testów w Maturinie są cosik straszne?

    (tak, oczywiście, że #PyO3 blokuje teraz portowanie do #PyPy 3.11, i będziemy mieli z tym od jasnej cholery roboty, bo przecież każda zasrana paczka będzie wymagać starej wersji)

    #Gentoo #Maturin #Python #RustLang

  18. Mi się wydaje, czy błędy testów w Maturinie są cosik straszne?

    (tak, oczywiście, że #PyO3 blokuje teraz portowanie do #PyPy 3.11, i będziemy mieli z tym od jasnej cholery roboty, bo przecież każda zasrana paczka będzie wymagać starej wersji)

    #Gentoo #Maturin #Python #RustLang

  19. Mi się wydaje, czy błędy testów w Maturinie są cosik straszne?

    (tak, oczywiście, że #PyO3 blokuje teraz portowanie do #PyPy 3.11, i będziemy mieli z tym od jasnej cholery roboty, bo przecież każda zasrana paczka będzie wymagać starej wersji)

    #Gentoo #Maturin #Python #RustLang

  20. Mi się wydaje, czy błędy testów w Maturinie są cosik straszne?

    (tak, oczywiście, że #PyO3 blokuje teraz portowanie do #PyPy 3.11, i będziemy mieli z tym od jasnej cholery roboty, bo przecież każda zasrana paczka będzie wymagać starej wersji)

    #Gentoo #Maturin #Python #RustLang

  21. Is it just me or are #Maturin test failures just creepy?

    (yes, of course #PyO3 is now a major blocker for #PyPy 3.11, and will require tons of work because of all the dependency pinning)

    #Gentoo #Python #RustLang

  22. Is it just me or are #Maturin test failures just creepy?

    (yes, of course #PyO3 is now a major blocker for #PyPy 3.11, and will require tons of work because of all the dependency pinning)

    #Gentoo #Python #RustLang

  23. Is it just me or are #Maturin test failures just creepy?

    (yes, of course #PyO3 is now a major blocker for #PyPy 3.11, and will require tons of work because of all the dependency pinning)

    #Gentoo #Python #RustLang

  24. Is it just me or are #Maturin test failures just creepy?

    (yes, of course #PyO3 is now a major blocker for #PyPy 3.11, and will require tons of work because of all the dependency pinning)

    #Gentoo #Python #RustLang

  25. Is it just me or are #Maturin test failures just creepy?

    (yes, of course #PyO3 is now a major blocker for #PyPy 3.11, and will require tons of work because of all the dependency pinning)

    #Gentoo #Python #RustLang

  26. My recent work on #CBOR diagnostic tools has culminated in the release v0.0.7 of the cbor-edn #RustLang crate, and the cbor-diag v1.1.0 #Python package (which is powered by the former, #maturin and #PyO3).
    It is now easy to receive CBOR data structure with internal tags, and have them display like this:
    {1: IP'2001:db8::1', 3: DT'2025-01-14T13:27:49Z'}
    cbor-diag.readthedocs.io/en/la
    docs.rs/cbor-edn/latest/cbor_e

  27. My recent work on #CBOR diagnostic tools has culminated in the release v0.0.7 of the cbor-edn #RustLang crate, and the cbor-diag v1.1.0 #Python package (which is powered by the former, #maturin and #PyO3).
    It is now easy to receive CBOR data structure with internal tags, and have them display like this:
    {1: IP'2001:db8::1', 3: DT'2025-01-14T13:27:49Z'}
    cbor-diag.readthedocs.io/en/la
    docs.rs/cbor-edn/latest/cbor_e

  28. My recent work on #CBOR diagnostic tools has culminated in the release v0.0.7 of the cbor-edn #RustLang crate, and the cbor-diag v1.1.0 #Python package (which is powered by the former, #maturin and #PyO3).
    It is now easy to receive CBOR data structure with internal tags, and have them display like this:
    {1: IP'2001:db8::1', 3: DT'2025-01-14T13:27:49Z'}
    cbor-diag.readthedocs.io/en/la
    docs.rs/cbor-edn/latest/cbor_e

  29. My recent work on #CBOR diagnostic tools has culminated in the release v0.0.7 of the cbor-edn #RustLang crate, and the cbor-diag v1.1.0 #Python package (which is powered by the former, #maturin and #PyO3).
    It is now easy to receive CBOR data structure with internal tags, and have them display like this:
    {1: IP'2001:db8::1', 3: DT'2025-01-14T13:27:49Z'}
    cbor-diag.readthedocs.io/en/la
    docs.rs/cbor-edn/latest/cbor_e

  30. My recent work on #CBOR diagnostic tools has culminated in the release v0.0.7 of the cbor-edn #RustLang crate, and the cbor-diag v1.1.0 #Python package (which is powered by the former, #maturin and #PyO3).
    It is now easy to receive CBOR data structure with internal tags, and have them display like this:
    {1: IP'2001:db8::1', 3: DT'2025-01-14T13:27:49Z'}
    cbor-diag.readthedocs.io/en/la
    docs.rs/cbor-edn/latest/cbor_e