List of videos

Tackling Thread Safety in Python — Jothir Adithyan, Adarsh Divakaran
[EuroPython 2024 — Terrace 2B on 2024-07-12] Tackling Thread Safety in Python by Jothir Adithyan, Adarsh Divakaran https://ep2024.europython.eu/session/tackling-thread-safety-in-python Thread safety is often overlooked when we start with Python for developing simple scripts. But the hidden monster will be unleashed when we try to run non-thread safe code in a multithreaded setup. We will discuss the problems which can happen when seemingly good code is run in a multithreaded environment. We will walk over the concept of race coditions, how Python’s GIL currently affects multithreading and will cover steps to fix thread unsafe code using synchronization primitives. --- This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License: https://creativecommons.org/licenses/by-nc-sa/4.0/
Watch
Effective Strategies for Disability Inclusion in Open Source Communities — Brayan Kai Mwanyumba
[EuroPython 2024 — Terrace 2B on 2024-07-12] Effective Strategies for Disability Inclusion in Open Source Communities by Brayan Kai Mwanyumba https://ep2024.europython.eu/session/effective-strategies-for-disability-inclusion-in-open-source-communities In today's world, where disability affects a significant percentage of the population, it is crucial for open-source communities to address the challenges faced by persons with disabilities (PWDs) and work towards their inclusion. This talk will delve into practical measures such as referral programs, internal disability disclosures, and integrating disability into existing agendas rather than treating it as a separate issue. We will dive into disability mainstreaming with a focus on its role in promoting universal design and inclusivity. Attendees will gain insights into establishing disability mainstreaming committees, formulating action plans, implementing best practices, and monitoring and evaluating progress. --- This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License: https://creativecommons.org/licenses/by-nc-sa/4.0/
Watch
Streamlining Testing in a Large Python Codebase — Jimmy Lai
[EuroPython 2024 — Terrace 2B on 2024-07-12] Streamlining Testing in a Large Python Codebase by Jimmy Lai https://ep2024.europython.eu/session/streamlining-testing-in-a-large-python-codebase Maintaining code quality through effective testing becomes increasingly challenging as codebases expand and developer teams grow. In our rapidly expanding codebase, we encountered common obstacles such as increasing test suite execution time, slow test coverage reporting and delayed test startup. By leveraging innovative strategies using open-source tools, we achieved remarkable enhancements in testing efficiency and code quality. Challenges Faced: - Test Suite Execution Time: The duration of test suite execution escalated significantly as we added more tests over time, hampering development speed. - Slow Test Startup: Complex test setup led to prolonged test startup times, impeding developer productivity. - Test Coverage Reporting Overhead: Coverage tools introduced substantial overhead and impacted test performance. Solutions Implemented: - Parallel Test Execution: We applied pytest-xdist to distribute tests across multiple runners, significantly reducing test suite execution time and enabling faster development iterations. - Optimized Test Startup: Pre-installing dependencies in a Docker image and utilizing Kubernetes for auto-scaling continuous integration runners helped expedite test startup times, improving developer efficiency. For local development, we used pytest-hot-reloading to reload tests fast after code editing. - Efficient Test Coverage Reporting: Customizing the coverage tool to collect data only on updated files of pull requests minimized overhead on test coverage reporting. As a result, in the past year, our test case volume increased by 8000, test coverage was elevated to 85%, and Continuous Integration (CI) test duration was maintained under 15 minute --- This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License: https://creativecommons.org/licenses/by-nc-sa/4.0/
Watch
Building Event-Driven Python service using FastStream and AsyncAPI — Abhinand C
[EuroPython 2024 — Terrace 2B on 2024-07-12] Building Event-Driven Python service using FastStream and AsyncAPI by Abhinand C https://ep2024.europython.eu/session/building-event-driven-python-service-using-faststream-and-asyncapi In this talk, we dive into the world of Event Driven Architecture and Message Streaming, using Python and FastStream. You'll learn to integrate FastStream, a python framework, into your projects and leverage AsyncAPI to define contracts for asynchronous communication and event streaming. Through practical examples and insights, you'll discover the art of building scalable, responsive Python applications that thrive in real-time environments. #### About AsyncAPI AsyncAPI is an open standard/specification and growing set of open-source tools to help developers define, build, and maintain asynchronous APIs and Event-Driven Architectures. It describes message-driven APIs in a machine-readable format, and is protocol-agnostic. #### About FastStream FastStream is a powerful and easy-to-use Python framework for building asynchronous services interacting with event streams such as Apache Kafka, RabbitMQ, NATS and Redis. FastStream simplifies the process of writing producers and consumers for message queues, handling all the parsing, networking and documentation generation automatically. FastStream provides unified API across multiple brokers, built-in Pydantic validations, automatic AsyncAPI documentation, FastAPI like Dependency Injection System, built-in support for test and extensions. --- This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License: https://creativecommons.org/licenses/by-nc-sa/4.0/
Watch
Shipping ready-to-run Python apps without the need to install Python — Marc-André Lemburg
[EuroPython 2024 — Forum Hall on 2024-07-11] Shipping ready-to-run Python apps without the need to install Python by Marc-André Lemburg https://ep2024.europython.eu/session/shipping-ready-to-run-python-apps-without-the-need-to-install-python Have you ever wanted to ship a script or application to a friend or client, without requiring a specific Python installation or providing complex installation instructions ? Or you want to squeeze out that last bit of juice from your Docker Python image to speed up deployment. Then eGenix PyRun is for you. PyRun is an open source, Apache-licensed, compressed, single file Python compatible run-time, which fits into merely 5 MB on disk. It can be used to ship pure Python products as a single file on Unix platforms, create Python Docker images with very small footprint to speed up deployment, or as a neat venv replacement, truly isolating applications from any OS or other Python installations, giving you a predictable target for Python applications across Unix platforms. We have been using PyRun internally at eGenix for many years and open sourced it back in 2012. This year, we are moving the project to Github and relaunching it, in order to present it to the wider open source and Python community. The talk will go into details on how PyRun is built from the Python source tree, how to create your own single file Python apps, where it can be put to good use, the roadmap we have for PyRun and what its limitations are. --- This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License: https://creativecommons.org/licenses/by-nc-sa/4.0/
Watch
How we used vectorization for 1000x Python speedups (no C or Spark needed!)
[EuroPython 2024 — Forum Hall on 2024-07-11] How we used vectorization for 1000x Python speedups (no C or Spark needed!) by Jonathan Hollenbeck, Justine Wezenaar https://ep2024.europython.eu/session/how-we-used-vectorization-for-1000x-python-speedups-no-c-or-spark-needed Want to make all your code faster? With matrices, library knowledge, and a sprinkle of creativity, you can consistently speed up multivariate Python functions by 1000x! Modal optimization requires simple axioms - arithmetic, checking a case, calling the right sklearn function, and so on. When that’s not sufficient, three core tricks - converting conditional logic to set theory, stacking vectors into a matrix, and shaping data to match library expectations - cover the vast majority of real world cases (90% of the ~400 functions we vectorized). At Bloomberg, ESG (Environmental, Social, and Governance) Scores require complex computations on large data sets. Time-series computations are fundamental for Governance - one UDF infers board support for a policy from prior cyclical votes and other time offset inputs. By rewriting the pandas backfill as a series of reductions on a 4-tensor, we reduced the runtime from 45 minutes to 10 milliseconds! Analogously, due to real world complexity, finance UDFs can end up with 100+ if/else branches in one function. With a mix of De Morgan’s laws and sparse matrix representations, we simplified the cases and achieved 1000x+ speedups. We’ll conclude with a quick overview of cutting-edge tools, and hope you’ll leave with a concrete strategy for vectorizing financial models! --- This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License: https://creativecommons.org/licenses/by-nc-sa/4.0/
Watch
The Catch in Rye: Seeding Change and Lessons Learned — Armin Ronacher
[EuroPython 2024 — Forum Hall on 2024-07-11] The Catch in Rye: Seeding Change and Lessons Learned by Armin Ronacher https://ep2024.europython.eu/session/the-catch-in-rye-seeding-change-and-lessons-learned Python has a lot of packaging tools and what better way to solve the problem than to add another one. Rye is in many ways just another way to try to fix Python packaging, but it's also happy to not exist if something takes its place. This talk goes over all the lessons learned from writing it, what has lead to it's creation, how it's built internally and what we can do to just solve the problem once and for all. --- This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License: https://creativecommons.org/licenses/by-nc-sa/4.0/
Watch
EuroPython 2024 — Lightning talks Thursday
[EuroPython 2024 — Forum Hall on 2024-07-11] Lightning talks Thursday https://ep2024.europython.eu/session/lightning-talks-thursday Enjoy Thursdays's lightning talks. Short talks about everything by everyone. Hosted by Velda Kiara and Angel Ramboi: 00:00 *Welcome to Thursday's Lightning Talks* 00:31 *Community Conference / Events Announcements & Celebration!* 17:55 *What to expect at the social event* — Moisés Guimarães 24:50 *AutoQuizzer: Can you beat an LLM in a pub quiz?* — Bilge Yucel 29:38 *Launching Crawlee for Python: Special beta version for EuroPython* — Saurav Jain 32:33 *Should Python adopt CalVer? 🗓* — Hugo van Kemenade 37:30 *F**k it* — Sébastien Crocquevieille 40:28 *Work on sqrt(3) and Pitagora's Theorem* — Riccardo Polli 44:24 *Present-ception: A presentation about presentations* — Siddharth Gupta --- This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License: https://creativecommons.org/licenses/by-nc-sa/4.0/
Watch
A Tour of Synchronization Primitives in Python — Zach Muncaster
[EuroPython 2024 — North Hall on 2024-07-11] A Tour of Synchronization Primitives in Python by Zach Muncaster https://ep2024.europython.eu/session/a-tour-of-synchronization-primitives-in-python Whether using threads or task-based event loops, running code concurrently is not without its challenges. This talk takes a look at the features provided by the Python programming language to solve problems of synchronization when dealing with concurrently executing code. Together we will take a look at the synchronization classes and functions provided by the Python threading and asyncio modules, what problems they aim to solve, and how we might use them effectively in our own code. --- This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License: https://creativecommons.org/licenses/by-nc-sa/4.0/
Watch