Episodios

  • #430 Or you go to jail
    Apr 28 2025
    Topics covered in this episode: pip 25.1 has dependency groups, pylock.toml, plus moreaiohttp goes free threadeduv 0.6.15 supports pylock.tomlWheneverExtrasJokeWatch on YouTube About the show Sponsored by Porkbun! Use our link pythonbytes.fm/porkbun and get a .app or .dev domain for $5.99 at Porkbun. Connect with the hosts Michael: @mkennedy@fosstodon.org / @mkennedy.codes (bsky)Brian: @brianokken@fosstodon.org / @brianokken.bsky.socialShow: @pythonbytes@fosstodon.org / @pythonbytes.fm (bsky) 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: pip 25.1 has dependency groups, pylock.toml, plus more post What's new in pip 25.1 - Dependency groups!Richard SiDiscovered this through Hugo van KemenadeDependency groups, PEP 735, supported # pyproject.toml [dependency-groups] test = ["pytest", "pytest-xdist"] lint = ["mypy", "isort"] # Dependency Groups can include other groups! ✨ dev = [ {include-group = "test"}, {include-group = "lint"} ] Package installation progress barResumable downloadsExperimental lockfile generation, PEP 751, with pip lock so coolpip index versions is stable, no longer experimental use this to get a list of available versionsex: python3 -m pip index versions pytest-checkcombine with --json to get a nice script readable output Michael #2: aiohttp goes free threaded Thanks to months of consistent contributions by Lysandros Nikolaou, all of the mandatory dependencies of #aiohttp now ship free-threaded variants of #wheels!This unlocks the same in aiohttp! Brian #3: uv 0.6.15 supports pylock.toml Discovered through Brett CannonSo far, these projects support pylock.toml pippip-auditpdmuvWith uv To export a uv.lock to the pylock.toml format, run: uv export -o pylock.tomlTo generate a pylock.toml file from a set of requirements, run: uv pip compile -o pylock.toml -r requirements.inTo install from a pylock.toml file, run: uv pip sync pylock.toml or uv pip install -r pylock.toml Michael #4: Whenever via Pat DeckerTyped and DST-safe datetimes for Python, available in Rust or pure Python.Whenever helps you write correct and type checked datetime code.It's also way faster than other third-party libraries—and usually the standard library as well. Extras Brian: Every UUID Michael: New Vulnerability in GitHub Copilot and Cursor: How Hackers Can Weaponize Code Agents via Brian SkinnAnd typosquatting in the AI ageFirefox Send alternatives file.pizza via @rafaelwo bitwarden send Joke: Can you Vibe? Interview with Vibe Coder in 2025Senior Engineer tries Vibe Coding
    Más Menos
    29 m
  • #429 Nitpicking Python
    Apr 21 2025
    Topics covered in this episode: HulyCVE Foundation formed to take over CVE program from MITREdrawdb14 Advanced Python FeaturesExtrasJokeWatch on YouTube About the show Sponsored by Posit Workbench: pythonbytes.fm/workbench Connect with the hosts Michael: @mkennedy@fosstodon.org / @mkennedy.codes (bsky)Brian: @brianokken@fosstodon.org / @brianokken.bsky.socialShow: @pythonbytes@fosstodon.org / @pythonbytes.fm (bsky) 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: Huly All-in-One Project Management Platform (alternative to Linear, Jira, Slack, Notion, Motion) If you're primarily interested in self-hosting Huly without the intention to modify or contribute to its development, please use huly-selfhost.Manage your tasks efficiently with Huly's bidirectional GitHub synchronization. Use Huly as an advanced front-end for GitHub Issues and GitHub Projects.Connect every element of your workflow to build a dynamic knowledge base.Everything you need for productive team work: Team Planner • Project Management • Virtual Office • Chat • Documents • InboxSelf hosting as a service: elest.io Brian #2: CVE Foundation formed to take over CVE program from MITRE Back story: CVE, global source of cybersecurity info, was hours from being cut by DHS The 25-year-old CVE program, an essential part of global cybersecurity, is cited in nearly any discussion or response to a computer security issue.CVE was at real risk of closure after its contract was set to expire on April 16.The nonprofit MITRE runs CVE on a contract with the DHS.A letter last Tuesday sent Tuesday by Yosry Barsoum, vice president of MITRE, gave notice of the potential halt to operations.Another possible victim of the current administration.CVE Foundation Launched to Secure the Future of the CVE Program CVE Board members have spent the past year developing a strategy to transition CVE to a dedicated, non-profit foundation. The new CVE Foundation will focus solely on continuing the mission of delivering high-quality vulnerability identification and maintaining the integrity and availability of CVE data for defenders worldwide.Over the coming days, the Foundation will release more information about its structure, transition planning, and opportunities for involvement from the broader community. Michael #3: drawdb Free and open source, simple, and intuitive database design editor, data-modeler, and SQL generator.Great drag-drop relationship managerDefine your DB visually, export as SQL create scriptsOr import existing SQL to kickstart the diagramming. Brian #4: 14 Advanced Python Features Edward LiPicking some favorites 1. Typing Overloads2. Keyword-only and Positional-only Arguments9. Python Nitpicks For-else statementsWalrus operatorShort Circuit EvaluationOperator Chaining Extras Michael: Thunderbird send / other firefox things. Joke: Python Tariffs Thanks wagenraceThanks Campfire Tales
    Más Menos
    27 m
  • #428 How old is your Python?
    Apr 14 2025
    Topics covered in this episode: How to Write a Git Commit MessageCaddy Web ServerSome new PEPs approvedjuvExtrasJokeWatch on YouTube About the show Sponsored by Posit Connect: pythonbytes.fm/connect Connect with the hosts Michael: @mkennedy@fosstodon.org / @mkennedy.codes (bsky)Brian: @brianokken@fosstodon.org / @brianokken.bsky.socialShow: @pythonbytes@fosstodon.org / @pythonbytes.fm (bsky) 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: How to Write a Git Commit Message Chris Beams7 rules of a great commit message Separate subject from body with a blank lineLimit the subject line to 50 charactersCapitalize the subject lineDo not end the subject line with a periodUse the imperative mood in the subject lineWrap the body at 72 charactersUse the body to explain what and why vs. howArticle also includes Why a good commit message mattersDiscussion about each of the 7 rulesCool hat tips to other articles on the subject “Keep in mind: This has all been said before.”Each word is a different link. Michael #2: Caddy Web Server via Fredrik MellströmLike a more modern NGINXCaddy automatically obtains and renews TLS certificates for all your sites.Caddy's native configuration is a JSON document.Even localhost and internal IPs are served with TLS using the intermediate of a fully-automated, self-managed CA that is automatically installed into most local trust stores.Configure multiple Caddy instances with the same storage, and they will automatically coordinate certificate management as a fleet.Production-grade static file server. Brian #3: Some new PEPs approved PEP 770 – Improving measurability of Python packages with Software Bill-of-Materials Accepted for packagingAuthor: Seth Larson, Sponsor Brett Cannon“This PEP proposes using SBOM documents included in Python packages as a means to improve automated software measurability for Python packages.”PEP 750 – Template Strings Accepted for Python 3.14Author: Jim Baker, Guido van Rossum, Paul Everitt, Kaudai Aono, Lysandros Nikolaou, Dave Peck“Templates provide developers with access to the string and its interpolated values before they are combined. This brings native flexible string processing to the Python language and enables safety checks, web templating, domain-specific languages, and more.” Michael #4: juv A toolkit for reproducible Jupyter notebooks, powered by uv. Create, manage, and run Jupyter notebooks with their dependencies Pin dependencies with PEP 723 - inline script metadata Launch ephemeral sessions for multiple front ends (e.g., JupyterLab, Notebook, NbClassic) Powered by uv for fast dependency managementUse uvx to run jupyterlab with ephemeral virtual environments and tracked dependencies. Extras Brian: Status of Python versions new-ish formatUse this all the time. Can’t remember if we’ve covered the new format yet.See also Python endoflife.date Same dates, very visible encouragement to move on to Python 3.13 if you haven’t already. Michael: Python 3.13.3 is out..git-blame-ignore-revs follow up Joke: BGPT (thanks Doug Farrell)
    Más Menos
    31 m
  • #427 Rise of the Python Lord
    Apr 7 2025
    Topics covered in this episode: Git Town solves the problem that using the Git CLI correctlyPEP 751 – A file format to record Python dependencies for installation reproducibility git-who and watchghaShare Python Scripts Like a Pro: uv and PEP 723 for Easy DeploymentExtrasJokeWatch on YouTube About the show Sponsored by Posit Package Manager: pythonbytes.fm/ppm Connect with the hosts Michael: @mkennedy@fosstodon.org / @mkennedy.codes (bsky)Brian: @brianokken@fosstodon.org / @brianokken.bsky.socialShow: @pythonbytes@fosstodon.org / @pythonbytes.fm (bsky) 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: Git Town solves the problem that using the Git CLI correctly Git Town is a reusable implementation of Git workflows for common usage scenarios like contributing to a centralized code repository on platforms like GitHub, GitLab, or Gitea. Think of Git Town as your Bash scripts for Git, but fully engineered with rock-solid support for many use cases, edge cases, and error conditions.Keep using Git the way you do now, but with extra commands to create various branch types, keep them in sync, compress, review, and ship them efficiently.Basic workflow Commands to create, work on, and ship features. git town hack - create a new feature branchgit town sync - update the current branch with all ongoing changesgit town switch - switch between branches visuallygit town propose - propose to ship a branchgit town ship - deliver a completed feature branchAdditional workflow commands Commands to deal with edge cases. git town delete - delete a feature branchgit town rename - rename a branchgit town repo - view the Git repository in the browser Brian #2: PEP 751 – A file format to record Python dependencies for installation reproducibility AcceptedFrom Brett Cannon “PEP 751 has been accepted! This means Python now has a lock file standard that can act as an export target for tools that can create some sort of lock file. And for some tools the format can act as their primary lock file format as well instead of some proprietary format.”File name: pylock.toml or at least something that starts with pylock and ends with .tomlIt’s exciting to see the start of a standardized lock file Michael #3: git-who and watchgha git-who is a command-line tool for answering that eternal question: Who wrote this code?!Unlike git blame, which can tell you who wrote a line of code, git-who tells you the people responsible for entire components or subsystems in a codebase. You can think of git-who sort of like git blame but for file trees rather than individual files. And watchgha - Live display of current GitHub action runs by Ned Batchelder Brian #4: Share Python Scripts Like a Pro: uv and PEP 723 for Easy Deployment Dave JohnsonNice full tutorial discussing single file Python scripts using uv with external dependencies Starting with a script with dependencies.Using uv add --script [HTML_REMOVED] [HTML_REMOVED] to add a /// script block to the topUsing uv runAdding #!/usr/bin/env -S uv run --script shebangEven some Windows advice Extras Brian: April 1 pranks done well BREAKING: Guido van Rossum Returns as Python’s BDFL including Brett Cannon noted as “Famous Python Quotationist”Guido taking credit for “I came for the language but I stayed for the community” which was from Brettthen Brett’s title of “Famous Python Quotationist” is crossed out.Barry Warsaw asking Guido about releasing Python 2.8 Barry is the FLUFL, “Friendly Language Uncle For Life “Mariatta can’t get Guido to respond in chat until she addresses him as “my lord”.“… becoming one with whitespace.”“Indentation is Enlightenment” Upcoming new keyword: maybe Like “if” but more Pythonicas in Maybe: print("Python The Documentary - Coming This Summer!")I’m really hoping there is a documentaryApril 1 pranks done poorly Note: pytest-repeat works fine with Python 3.14, and never had any problemsIf you have to explain the joke, maybe it’s not funny.The explanation pi, an irrational number, as in it cannot be expressed by a ratio of two integers, starts with 3.14159 and then keeps going, and never repeats.Python 3.14 is in alpha and people could be testing with it for packagesTest & Code is doing a series on pytest pluginspytest-repeat is a pytest plugin, and it happened to not have any tests for 3.14 yet.Now the “joke”. I pretended that I had tried pytest-repeat with Python 3.14 and it didn’t work.Test & Code: Python 3.14 won't repeat with pytest-repeatThus, Python 3.14 won’t repeat.Also I mentioned that there was no “rational” explanation.And pi is an irrational number. Michael: pysqlscribe v0.5.0 has the “parse create scripts” feature I ...
    Más Menos
    37 m
  • #426 Committing to Formatted Markdown
    Mar 31 2025
    Topics covered in this episode: mdformatpre-commit-uvPEP 758 and 781Serie: rich git commit graph in your terminal, like magic ExtrasJokeWatch on YouTube About the show Sponsored by Posit Connect Cloud: pythonbytes.fm/connect-cloud Connect with the hosts Michael: @mkennedy@fosstodon.org / @mkennedy.codes (bsky)Brian: @brianokken@fosstodon.org / @brianokken.bsky.socialShow: @pythonbytes@fosstodon.org / @pythonbytes.fm (bsky) 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: mdformat Suggested by Matthias SchöttleLast episode Michael covered blacken-docs, and I mentioned it’d be nice to have an autoformatter for text markdown.Matthias delivered with suggesting mdformat“Mdformat is an opinionated Markdown formatter that can be used to enforce a consistent style in Markdown files.”A python project that can be run on the command line.Uses a style guide I mostly agree with. I’m not a huge fan of numbered list items all being “1.”, but that can be turned off with --number, so I’m happy.Converts underlined headings to #, ##, etc. headings.Lots of other sane conventions.The numbering thing is also sane, I just think it also makes the raw markdown hard to read.Has a plugin system to format code blocks Michael #2: pre-commit-uv via Ben FalkUse uv to create virtual environments and install packages for pre-commit. Brian #3: PEP 758 and 781 PEP 758 – Allow except and except* expressions without parentheses acceptedPEP 781 – Make TYPE_CHECKING a built-in constant draft statusAlso, PEP Index by Category kinda rocks Michael #4: Serie: rich git commit graph in your terminal, like magic While some users prefer to use Git via CLI, they often rely on a GUI or feature-rich TUI to view commit logs. Others may find git log --graph sufficient.Goals Provide a rich git log --graph experience in the terminal.Offer commit graph-centric browsing of Git repositories. Extras Michael: Sunsetting Search? (Startpage)Ruff in or out? Joke: Wishing for wishes
    Más Menos
    29 m
  • #425 If You Were a Klingon Programmer
    Mar 24 2025
    Topics covered in this episode: Why aren't you using uv?Python Developer Tooling HandbookCalling all doc writers: blacken-docsReinventing notebooks as reusable Python programsExtrasJokeWatch on YouTube About the show Brought to you by Posit Connect: pythonbytes.fm/connect. Connect with the hosts Michael: @mkennedy@fosstodon.org / @mkennedy.codes (bsky)Brian: @brianokken@fosstodon.org / @brianokken.bsky.socialShow: @pythonbytes@fosstodon.org / @pythonbytes.fm (bsky) 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: Why aren't you using uv? Fun conversation on X by Armin Ronacher.Interesting quotes from the thread I get it replaces pip/pyenv, but should I also use it instead of the built in 'python -m venv .venv'?But I need python installed to make python programs?Because it places the venv in the project folder and I can't run executables from there due to corporate policy. Many such cases. No idea why astral doesn't address this with more urgency. Sounds like a bad corporate policy :)i’m too lazy to switch from pyenv and piptrust issues, what if they do a bait and switch …Because everyone said that about poetry and I'm not sure I'm really ready to get hurt again.MasochismMany times I tried a lot of similar tools and always come back to pip and pip-tools. Them are just work, why should I spend my time for something "cool" that will bring more problems?I tried this week but I was expecting a "uv install requests" instead of "uv add". Switched back to pipenv.we partially use it. will transition when Dependabot support is available.I’ll leave it with → Jared Scheel: Seeing a whole lotta Stockholm Syndrome in the replies to this question. Brian #2: Python Developer Tooling Handbook Tim Hopper“This is not a book about programming Python. Instead, the goal of this book is to help you understand the ecosystem of tools used to make Python development easier and more productive”Covers tools related to packaging, linting, formatting, and managing dependencies. Michael #3: Calling all doc writers: blacken-docs Run black on python code blocks in documentation files You can also install blacken-docs as a pre-commit hook.It supports Markdown, reStructuredText, and LaTex files. Additionally, you can run it on Python files to reformat Markdown and reStructuredText within docstrings. Brian #4: Reinventing notebooks as reusable Python programs marimo allows you to store notebooks as plaintext Python filesproperties Git-friendly: small code change => small diffeasy for both humans and computers to readimportable as a Python module, without executing notebook cellsexecutable as a Python scripteditable with a text editorAlso, … testing with pytest“Because marimo notebooks are just Python files, they are interoperable with other tools for Python — including pytest. ““Testing cells. Any cell named as test_* is automatically discoverable and testable by pytest. The same goes for any cell that contains only test_ functions and Test classes.”“Importantly, because cells are wrapped in functions, running pytest test_notebook.py doesn’t execute the entire notebook — just its tests.” Extras Brian: PyConUS announces Refund Policy for International AttendeesNew format now live for The Complete pytest Course Bundle and component courses Each course now available separately also pytest Primary Power is 13 lessons, 3.9 hoursUsing pytest with Projects, 10 lessons, 3.4 hourspytest Booster Rockets, 6 lessons, 1.3 hours of contentNew format is easier to navigateBetter for people who like different speeds. I’m usually a 1.25x-1.5x speed person.Now also with Congratulations! lessons (with fireworks) and printable certificates. Michael: PyCon Taiwan is currently calling for proposalsHN trends follow up via Shinjitsu I'm sure some other Hacker News reader has already given you the feedback, but in the unlikely case that they haven't, You read those headlines in this segment exactly wrong. “Ask HN: Who is hiring?" is a monthly post that asks employers to post about jobs they have available “Ask HN: Who wants to be hired?” is a monthly topic where they ask people who are looking for jobs to post about themselves in the hope that their skillset it is a good match (and not an LLM generated resume) So unfortunately your rosy analysis might need a less rosy interpretation. Joke: Top 12 things likely to be overheard if you had a Klingon Programmer From Holgi on Mastodon
    Más Menos
    38 m
  • #424 We Will Test in Production
    Mar 17 2025
    Topics covered in this episode: The weird quirk with rounding in PythonPython interpreter adds tail callsRemove punctuation from a string with translate and maketransExtra, 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.org / @mkennedy.codes (bsky)Brian: @brianokken@fosstodon.org / @brianokken.bsky.socialShow: @pythonbytes@fosstodon.org / @pythonbytes.fm (bsky) 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: The weird quirk with rounding in Python Tom Nijhof-VerheesbWith numbers ending in .5, Python always rounds to an even number. round(0.5) → 0round(1.5) → 2etcThis follows IEEE 754You can use decimal if you need a different behavior. Michael #2: Python interpreter adds tail calls Ken Jin, a member of the project, has merged a new set of changes that have been benchmarked as improving performance by 10% for some architectures."Speedup is roughly equal to 2 minor CPython releases worth of improvements. For example, CPython 3.12 roughly sped up by 5%.” Brian #3: Remove punctuation from a string with translate and maketrans Rodrigo“Don't use the method replace to remove punctuation from a Python string. Instead, use the method translate.” Michael #4: Extra, extra, extra Animation v Coding, hello world to transformersTypeScript rewritten in GoFirefox liesPyCon’s Startup RowPython in Production Book Extras Joke: Startrek Testing
    Más Menos
    27 m
  • #423 Traveling the Python Universe
    Mar 10 2025
    Topics covered in this episode: pysqlscribeA map of PythonRust, C++, and Python trends in jobs on Hacker News (February 2025)The features of Python's help() functionExtrasJokeWatch 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.codes (bsky)Brian: @brianokken@fosstodon.org / @brianokken.bsky.socialShow: @pythonbytes@fosstodon.org / @pythonbytes.fm (bsky) 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: pysqlscribe A Python library intended to make building SQL queries in your code a bit easier.A Query object can be constructed using the QueryRegistry's get_builder featuring a dialect (e.g; "mysql", "postgres", "oracle"). Brian #2: A map of Python Cool visualization of dependencies in PyPI packagesEven cooler visualization (linked from main article) Michael #3: Rust, C++, and Python trends in jobs on Hacker News (February 2025) Interesting supply and demand comparisons from at least on source. Brian #4: The features of Python's help() function Trey HunnerDon’t forget how useful and cool help() is. Extras Michael: Granian works with FastAPI again Joke: Computer engineer vs. Geologist
    Más Menos
    27 m
adbl_web_global_use_to_activate_webcro768_stickypopup