エピソード

  • #410 Entering the Django core
    2024/11/18
    Topics covered in this episode: Thoughts on Django’s CorefuturepoolDon't return named tuples in new APIsZiglang: Migrating from AWS to Self-HostingExtrasJokeWatch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python TrainingThe Complete pytest CoursePatreon Supporters Connect with the hosts Michael: @mkennedy@fosstodon.org / @mkennedy.codesBrian: @brianokken@fosstodon.org / @brianokken.bsky.socialShow: @pythonbytes@fosstodon.org / @pythonbytes.bsky.social Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Brian #1: Thoughts on Django’s Core Carlton GibsonGreat discussion on Django and Core vs PluginsSustainability with limited peopleKeeping core smallThe release cycleeembrace plugins vs endorsing plugins. Michael #2: futurepool via Pat DeckerTakes the concept of multiprocessing Pool to the async/await world.Create a pool then delegate the work: async with FuturePool(2) as fp: result = await fp.map(async_pool_fn, range(10)) I would LOVE to see something like this in a broader background asyncio worker pool concept.But that concept doesn’t exist in asyncio in Python and that’s a failing of the framework IMO. Brian #3: Don't return named tuples in new APIs Brett CannonFirst off, I’m grateful for any post that talks about APIs and the API is a module, class, or package API and not a Web/REST API. The term API existed long before the internet.“e.g., get_mouse_position() very likely has a two-item tuple of X and Y coordinates of the screen”“it actually makes your API more complex for both you and your users to use. For you, it doubles the data access API surface for your return type as you have to now support index-based and attribute-based data access forever (or until you choose to break your users and change your return type so it doesn't support both approaches)”“… you probably don't want people doing with your return type, like slicing, iterating over all the items …”Alternatives classdataclassdictionaryTypedDictSimpleNamespace“My key point in all of this is to prefer readability and ergonomics over brevity in your code. That means avoiding named tuples except where you are expanding to tweaking an existing API where the named tuple improves over the plain tuple that's already being used.” Michael #4: Ziglang: Migrating from AWS to Self-Hosting The Rust Foundation for example, reports that they spent $404,400 on infrastructure costs in 2023.Zig lang has decided to use a single big cloud machine + mirrors Extras Brian: Changing the Python Test community Was started to answer questions for Test & Code listeners years ago. Primarily pytest questionsUsed to be Slack. Then moved to Podia forum. Now I’m trying to work out a Discord solution that is both sustainable and usable. Michael: PWang Bsky essayBuilding A Business From Python Expertise - Michael Kennedy on Work Item PodcastSubscribe to package releases, just put .atom on the end of their releases URL, for example: github.com/mikeckennedy/jinja_partials/releases ← add .atom for RSSpytest-bdd 8.0.0 was just released via Jamie Thomson The big feature (in Jamie’s opinion) is the addition of data tables https://github.com/pytest-dev/pytest-bdd/blob/master/CHANGES.rst#800---2024-11-14 Joke: Breaking: JavaScript Developer Commits to Framework for Record-Breaking 3 Weeks
    続きを読む 一部表示
    31 分
  • #409 We've moved to Hetzner write-up
    2024/11/14
    Topics covered in this episode: terminal-treeposting: The API client that lives in your terminalExtra, extra, extraUV does everything or enough that I'm not sure what else it needs to doExtrasJokeWatch on YouTube About the show Sponsored by: ScoutAPM - Django Application Performance MonitoringCodeium - Free AI Code Completion & Chat Connect with the hosts Michael: @mkennedy@fosstodon.orgBrian: @brianokken@fosstodon.orgShow: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Michael #1: terminal-tree An experimental filesystem navigator for the terminal, built with TextualTested in macOS only at this point. Chances are very high it works on Linux. Slightly lower chance (but non-zero) that it works on Windows. Can confirm it works on Linux Brian #2: posting: The API client that lives in your terminal Also uses TextualFrom Darren BurnsInteresting that the installation instructions recommends using uv: uv tool install --python 3.12 postingVery cool. Great docs. Beautiful. keyboard centric, but also usable with a mouse.“Fly through your API workflow with an approachable yet powerful keyboard-centric interface. Run it locally or over SSH on remote machines and containers. Save your requests in a readable and version-control friendly format.”Able to save multiple environmentsGreat colorsAllows scripting to run Python code before and after requests to prepare headers, set variables, etc. Michael #3: Extra, extra, extra spaCy course swag give-away, enter for freeNew essay: Opposite of Cloud Native is?News: We've moved to HetznerNew package: Introducing chameleon-flask packageNew release: Listmonk Python clientTIOBE UpdatePEP 750 – Template StringsCanary emailLeft Omnivore, for Pocket, left Pocket for, …, landed on Instapaper Supports direct import from Omnivore and PocketThough Hoarder is compellingTrying out Zen Browser Wasn’t a fan of Arc (especially now) but the news turned me on to Zen Brian #4: UV does everything or enough that I'm not sure what else it needs to do Jeff Triplett“UV feels like one of those old infomercials where it solves everything, which is where we have landed in the Python world.”“My favorite feature is that UV can now bootstrap a project to run on a machine that does not previously have Python installed, along with installing any packages your application might require.”Partial list (see Jeff’s post for his complete list) uv pip install replaces pip installuv venv replaces python -m venvuv run, uv tool run, and uv tool install replaces pipxuv build - Build your Python package for pypiuv publish - Upload your Python package to pypi, replacing twine and flit publish Extras Brian: Coverage.py originally was just one fileTrying out BlueSky brianokken.bsky.social Not because of Taylor Swift, but nice. There are a lot of Python people there. Joke: How programmers sleep
    続きを読む 一部表示
    35 分
  • #408 python-preference only-managed 3.13t
    2024/11/04
    Topics covered in this episode: GitHub action security: zizmorPython is now the top language on GitHubPython 3.13, what didn't make the headlinesPyCon US 2025ExtrasJokeWatch on YouTube About the show Sponsored by: ScoutAPM - Django Application Performance MonitoringCodeium - Free AI Code Completion & Chat Connect with the hosts Michael: @mkennedy@fosstodon.orgBrian: @brianokken@fosstodon.orgShow: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Brian #1: GitHub action security: zizmor Article: Ned Batchelder zizmor: William Woodruff & others“a new tool to check your GitHub action workflows for security concerns.”Install with cargo or brew, then point it at workflow yml files.It reports security concerns. Michael #2: Python is now the top language on GitHub Thanks to Pat Decker for the heads up.A rapidly growing number of developers worldwide This suggests AI isn’t just helping more people learn to write code or build software faster—it’s also attracting and helping more people become developers. First-time open source contributors continue to show wide-scale interest in AI projects. But we aren’t seeing signs that AI has hurt open source with low-quality contributions.Python is now the most used language on GitHub as global open source activity continues to extend beyond traditional software development. The rise in Python usage correlates with large communities of people joining the open source community from across the STEM world rather than the traditional community of software developers.There’s a continued increase in first-time contributors to open source projects. 1.4 million new developers globally joined open source with a majority contributing to commercially backed and generative AI projects. Notably, we did not see a rise in rejected pull requests. This could indicate that quality remains high despite the influx of new contributors. Brian #3: Python 3.13, what didn't make the headlines Some pretty cool updates to pdb : the command line Python debugger multiline editingcode completion pathlib has a bunch of performance updatespython -m venv adds a .gitignore file that auto ignores the venv. Michael #4: PyCon US 2025 Site is live with CFP and datesHealth code is finally reasonable: “Masks are Encouraged but not Required”PyCon US 2025 Dates Tutorials - May 14-15, 2025Sponsor Presentations - May 15, 2025Opening Reception - May 15, 2025Main Conference and Online - May 16-18, 2025Job Fair - May 18, 2025Sprints - May 19-May 22, 2025 Extras Brian: Please publish and share more - Jeff Triplett Michael: pre-commit-uv Just spoke with Sefanie Molin about pre-commit hooks on Talk PythonCurse you Omnivore!We have moved to hetzner Typora markdown appfree-threaded Python is now available via uv uv self update uv python install --python-preference only-managed 3.13t Joke: Debugging char
    続きを読む 一部表示
    31 分
  • #407 Back to the future, destination 3.14
    2024/10/28
    Topics covered in this episode: Python 3.14.0 alpha 1 is now availableuv supports dependency groupsdive: A tool for exploring each layer in a docker imagepytest-metadataExtrasJokeWatch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python TrainingThe Complete pytest Course & Hello, pytest!Patreon Supporters Connect with the hosts Michael: @mkennedy@fosstodon.orgBrian: @brianokken@fosstodon.orgShow: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Michael #1: Python 3.14.0 alpha 1 is now available First of seven planned alpha releases.Many new features for Python 3.14 are still being planned and written. Among the new major new features and changes so far: PEP 649: deferred evaluation of annotationsImproved error messages Brian #2: uv supports dependency groups we covered dependency groups in episode 406as of 0.4.27, uv supports dependency groupsdocs show how to add dependencies with uv add --group also “The --dev, --only-dev, and --no-dev flags are equivalent to --group dev, --only-group dev, and --no-group dev respectively.”To install a group, uv pip install --group doesn’t work yet. It’s waiting for PyPA to decide on an interface for pip, and uv pip will use that interface.But sync works. $ uv init # create a pyproject.toml $ uv add --group foo pytest $ uv venv # create venv $ uv sync --group foo # will install all dependencies, including group "foo" Michael #3: dive: A tool for exploring each layer in a docker image via Mike FiedlerFeatures: Show Docker image contents broken down by layerIndicate what's changed in each layerEstimate "image efficiency"Quick build/analysis cyclesCI Integration Brian #4: pytest-metadata An incredibly useful plugin for adding, you guessed it, metadata, to your pytest results.Required for pytest-html but also useful on it’s ownAdds metadata to text output with --verbosexml output when using --junit-xml, handy for CI systems that support junit.xmlOther plugins depend on this and report in other ways, such as pytest-htmlBy default, already grabs Python versionPlatform infoList of installed packagesList of installed pytest pluginsYou can add your own metadataYou can access all metadata (and add to it) from tests, fixtures, and hook functions via a metadata fixture.This is in the Top pytest Plugins list, currently #5. Extras Brian: I’ve started filtering deprecated plugins from the pytest plugin list.I’m also going to start reviewing the list and pulling out interesting plugins as the topic of the next season of Test & Code. Michael: Pillow 11 is outpip install deutschlandTalk Python has a dedicated blog, please subscribe! Joke: Dog names
    続きを読む 一部表示
    28 分
  • #406 What's on Django TV tonight?
    2024/10/21
    Topics covered in this episode: Open Source PledgeJeff Triplet's DjangoTVPEP 735 – Dependency Groups in pyproject.tomllivereloadExtrasJokeWatch on YouTube About the show Sponsored by ScoutAPM: pythonbytes.fm/scout Connect with the hosts Michael: @mkennedy@fosstodon.orgBrian: @brianokken@fosstodon.orgShow: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Brian #1: Open Source Pledge Learned about this because of this post Why Django supports the Open Source PledgeSteps Pay Open Source maintainers. Min to participate is 2k/year/dev at your companySelf-report annually Publish a blog post outlining your paymentsArmin’s post about launching Open Source Pledge and mixing money with open source Michael #2: Jeff Triplet's DjangoTV A nice aggregation of lots of Django conference talksFilter by conferenceGood search as well Brian #3: PEP 735 – Dependency Groups in pyproject.toml Author: Stephen Rosen, Sponsor: Brett Cannon, PEP-Delegate: Paul MooreAccepted. Resolotion Oct 10, 2024“This PEP specifies a mechanism for storing package requirements in pyproject.toml files such that they are not included in any built distribution of the project.”Allow us to define named groups of dependencies that can be independent of the main project.ex: [dependency-groups] test = ["pytest", "coverage"] docs = ["sphinx", "sphinx-rtd-theme"] typing = ["mypy", "types-requests"] typing-test = [{include-group = "typing"}, {include-group = "test"}, "useful-types"] “might” work like this: pip install --dependency-groups=test,typing but tool venders are able to define how they use groups. Of course.Similar solutions multiple requirements.txt files: requirements_test.txt, requirements_docs.txt, etc. no standard naming convention, not standardized package extras: not gauranteed to be statically defined (TIL)additional to main dependencies, so not independent Michael #4: livereload Example from talkpython.fm: asset_bundler_watcher.pyThe docs are sparse, so see the gist above Extras Brian: Personal Blogs are no longer personal when AI gets too involved - KJayMillerMind Your Image Metadata - Stefanie Molin Michael: 14% of our listeners are in Germany, thanks Germany! Prost!Hetzner comes to the US Joke: A programmer’s partner asks them: “Would you go get a loaf of bread from the store? And if they have eggs, get a dozen.” A while later, the programmer returns with 12 loaves of bread and says “They had eggs.” From https://savvyprogrammer.io/software-jokes/
    続きを読む 一部表示
    25 分
  • #405 Oh Really?
    2024/10/14
    Topics covered in this episode: Briefer: Dashboards and notebooks in a single placeIntroduction to programming with Pythonsetup-uvHTML for peopleExtrasJokeWatch on YouTube About the show Sponsored by ScoutAPM: pythonbytes.fm/scout Connect with the hosts Michael: @mkennedy@fosstodon.orgBrian: @brianokken@fosstodon.orgShow: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Michael #1: Briefer: Dashboards and notebooks in a single place Notebooks and dashboards with Python, SQL, scheduling, native visualizations, code generation, and more.In Briefer, you can: Create notebooks and dashboards using Markdown, Python, SQL, and native visualizations. Build interactive data apps using inputs, dropdowns, and date pickers. Generate code and queries using an AI that understands your database schema and your notebook's context. Schedule notebooks and dashboards to run and update periodically. Create and test ad-hoc pipelines using writebacks.Briefer vs. Traditional BI Tools: Briefer is better than traditional BI tools because it's faster and more flexible, thanks to Python.Briefer vs. Traditional Notebooks: In Briefer, you can run SQL queries against connected data sources directly in your notebook. Then, Briefer will automatically turn your query into a data frame and store it in a variable that you can use in your Python blocks. Brian #2: Introduction to programming with Python Jose Blanca “Python intro aimed at students with no prior programming experience.”“Relies mainly on examples and exercises.”“Does not try to cover every detail of the Python language, but just what a beginner might need to start the journey.”Tech: “… built with the quarto publishing system complemented by the quarto live extension that allows Python to run in the web browser by using pyodide.”Runs on anything, since it doesn’t require a local install of PythonRunning 3.12.1, looks like. Although that’s a bit hidden. Seems like it should be more visible. Michael #3: setup-uv Set up your GitHub Actions workflow with a specific version of uvInstall a version of uv and add it to PATHCache the installed version of uv to speed up consecutive runs on self-hosted runnersRegister problem matchers for error output(Optional) Persist the uv's cache in the GitHub Actions Cache(Optional) Verify the checksum of the downloaded uv executable Brian #4: HTML for people Teaching HTML in a rather fun way.Includes basic CSS Extras Michael: A new article: We Must Replace uWSGI With Something ElseDjango unique email login Joke: So much O’Really
    続きを読む 一部表示
    23 分
  • #404 The Lost Episode
    2024/10/07
    Topics covered in this episode: Python 3.13.0 released Oct 7PEP 759 – External Wheel Hostingpytest-freethreadedpytest-editExtrasJokeWatch on YouTube About the show Sponsored by ScoutAPM: pythonbytes.fm/scout Connect with the hosts Michael: @mkennedy@fosstodon.orgBrian: @brianokken@fosstodon.orgShow: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Brian #1: Python 3.13.0 released Oct 7 That’s today!What’s New In Python 3.13 Interpreter (REPL) improvements exit works (really, this is worth the release right here)Multiline editing with history preservation. history sticks around between sessionsDirect support for REPL-specific commands like help, exit, and quit, without the need to call them as functions.Prompts and tracebacks with color enabled by default.Interactive help browsing using F1 with a separate command history.History browsing using F2 that skips output as well as the >>> and … prompts.“Paste mode” with F3 that makes pasting larger blocks of code easier (press F3 again to return to the regular prompt).exit now works without parensImproved error messages Colorful tracebacksBetter messages for naming a script/module the same name as a stdlib module.naming a script/module the same name as an installed third party module.misspelling a keyword argumentFree threaded CPython Included in official installers on Windows and macOS Read these links to figure out how - it’s not turned on by defaultLot’s more. see the What’s new page Michael #2: PEP 759 – External Wheel Hosting pypi.org ships over 66 petabytes / month backed by FastlyThere are hard project size limits for publishers to PyPIWe can host the essence of a .whl as a .rim file, then allow an external download URLSecurity: Several factors as described in this proposal should mitigate security concerns with externally hosted wheels, such as: Wheel file checksums MUST be included in .rim files, and once uploaded cannot be changed. Since the checksum stored on PyPI is immutable and required, it is not possible to spoof an external wheel file, even if the owning organization lost control of their hosting domain.Externally hosted wheels MUST be served over HTTPS.In order to serve externally hosted wheels, organizations MUST be approved by the PyPI admins. Brian #3: pytest-freethreaded PyCon JP 2024 Team: This extension was created at PyCon JP sprints with Anthony Shaw and 7 other folks listed in credits.“A pytest plugin for helping verify that your tests and libraries are thread-safe with the Python 3.13 experimental freethreaded mode.”Testing your project for compatibility with freethreaded Python. Testing in single thread doesn’t test that.Neither does testing with pytest-xdist, because it uses multiprocessing to parallelize tests.So, Ant and others “made this plugin to help you run your tests in a thread-pool with the GIL disabled, to help you identify if your tests are thread-safe.”“And the first library we tested it on (which was marked as compatible) caused a segmentation fault in CPython! So you should give this a go if you're a package maintainer.” Michael #4: pytest-edit A simple Pytest plugin for opening editor on the failed tests.Type pytest --edit to open the failing test code Be sure to set your favorite editor in the ENV variables Extras Michael: New way to explore Talk Python courses via topics This has been in our mobile apps since their rewrite but finally comes to the webLet's go easy on PyPI, OK? essayHynek’s video: uv IS the Future of Python Packaging djade-pre-commitPolyfill.io, BootCDN, Bootcss, Staticfile attack traced to 1 operatorPurgeCSS CLI Python 3.12.7 releasedIncremental GC and pushing back the 3.13.0 releaseuv making the roundsLLM fatigue, is it real?Take the Python Developers Survey 2024 Joke: Funny 404 pages We have something at least interesting at pythonbytes.fm
    続きを読む 一部表示
    31 分
  • #403 A machine learning algorithm walks into a bar…
    2024/09/30
    Topics covered in this episode: uv under discussion on Mastodonerdantic: Entity Relationship DiagramsExtra, Extra, ExtraDjango Extra, Extra, ExtraExtrasJokeWatch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python TrainingThe Complete pytest CoursePatreon Supporters Connect with the hosts Michael: @mkennedy@fosstodon.orgBrian: @brianokken@fosstodon.orgShow: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Michael #1: uv under discussion on Mastodon It’s interesting that uv is slightly controversialRussell:As enthusiastic as I am about the direction uv is going, I haven't adopted them anywhere - because I want very much to understand Astral’s intended business model before I hook my wagon to their tools.Hynek:As much as I hate VC, [...] FOSS projects flame out all the time too. … To me uv looks like a genius sting to trick VCs into paying to fix packaging. We’ll be better off either way.Glyph:Rust is more expensive and difficult to maintain, not to mention "non-native" to the average customer here. … it can burn out all the other projects in the ecosystem simultaneously, creating a risk of monocultureHynek on Rust:I don’t think y’all quite grok what uv makes so special due to your seniority. The speed is really cool, but the reason Rust is elemental is that it’s one compiled blob that can be used to bootstrap and maintain a Python development.Christopher Neugebauer:Just dropping in here to say that corporate capture of the Python ecosystem is the #1 keeps-me-up-at-night subject in my community work, so I watch Astral with interest, even if I'm not yet too worried.Armin RonacherWhat uv is doing, even in the worst possible future this is a very forkable and maintainable thing.Finally, see the comment at the end by Charlie Marsh Brian #2: erdantic: Entity Relationship Diagrams “erdantic is a simple tool for drawing entity relationship diagrams (ERDs) for Python data model classes. Diagrams are rendered using the venerable Graphviz library.”Supported data modeling frameworks are: Pydantic V2Pydantic V1 legacyattrsdataclasses Michael #3: Extra, Extra, Extra Added Python Bytes Search as a custom search engine.Along came passkeys. A cool idea that quickly turned evil.Follow up from post and my conversation last week: vaultwarden (via Pablo)uv publishTrying the tabs on bottom lifestyle inspired by ArcAdding Python Bytes (and Talk Python) as custom search engines.PyCon 2025 dates: From 14 May through 22 May, 2025 Brian #4: Django Extra, Extra, Extra Django Project Ideas Evgenia VerbinaProject ideas with list of tech stack stuff you’ll learn and/or work on with the projectEx: Recipe organizer tech stack: Django templates, Django ORM, Optional JavaScript“Familiarize yourself with Django’s ORM (object-relational mapper) and database support by building an app to keep track of your favorite recipes. Add a web-based frontend with options to filter recipes by category, ingredients, and user ratings so you can easily browse for inspiration.”DjangoTV Jeff TriplettDjango conference videos and tutorials.Django Commons Heard about from Lacey Henschel“Django Commons is an organization dedicated to supporting the community's efforts to maintain packages. It seeks to improve the maintenance experience for all contributors; reducing the barrier to entry for new contributors and reducing overhead for existing maintainers.”Django 5 has simplified templates for better form field renderingBut if you want a completely different take on forms, maybe try iommi forms They wrote about it on Why we wrote a new form library for DjangoDjade: a Django template formatter Adam JohnsonLike black or ruff, but for Django templates. Extras Brian: The Open Source Project Maintainer's Guide Suggested by Rafael Weingartner Joke: A Machine Learning algorithm walks into a bar…
    続きを読む 一部表示
    25 分