Powered by RND

Python Bytes

Michael Kennedy and Brian Okken
Python Bytes
Senaste avsnittet

Tillgängliga avsnitt

5 resultat 10
  • #428 How old is your Python?
    Topics covered in this episode: How to Write a Git Commit Message Caddy Web Server Some new PEPs approved juv Extras Joke Watch on YouTube About the show Sponsored by Posit Connect: pythonbytes.fm/connect Connect with the hosts Michael: @[email protected] / @mkennedy.codes (bsky) Brian: @[email protected] / @brianokken.bsky.social Show: @[email protected] / @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 Beams 7 rules of a great commit message Separate subject from body with a blank line Limit the subject line to 50 characters Capitalize the subject line Do not end the subject line with a period Use the imperative mood in the subject line Wrap the body at 72 characters Use the body to explain what and why vs. how Article also includes Why a good commit message matters Discussion about each of the 7 rules Cool 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öm Like a more modern NGINX Caddy 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 packaging Author: 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.14 Author: 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 management Use uvx to run jupyterlab with ephemeral virtual environments and tracked dependencies. Extras Brian: Status of Python versions new-ish format Use 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)
    --------  
    31:00
  • #427 Rise of the Python Lord
    Topics covered in this episode: Git Town solves the problem that using the Git CLI correctly PEP 751 – A file format to record Python dependencies for installation reproducibility git-who and watchgha Share Python Scripts Like a Pro: uv and PEP 723 for Easy Deployment Extras Joke Watch on YouTube About the show Sponsored by Posit Package Manager: pythonbytes.fm/ppm Connect with the hosts Michael: @[email protected] / @mkennedy.codes (bsky) Brian: @[email protected] / @brianokken.bsky.social Show: @[email protected] / @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 branch git town sync - update the current branch with all ongoing changes git town switch - switch between branches visually git town propose - propose to ship a branch git town ship - deliver a completed feature branch Additional workflow commands Commands to deal with edge cases. git town delete - delete a feature branch git town rename - rename a branch git town repo - view the Git repository in the browser Brian #2: PEP 751 – A file format to record Python dependencies for installation reproducibility Accepted From 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 .toml It’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 Johnson Nice 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 top Using uv run Adding #!/usr/bin/env -S uv run --script shebang Even 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 Brett then 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 Pythonic as in Maybe: print("Python The Documentary - Coming This Summer!") I’m really hoping there is a documentary April 1 pranks done poorly Note: pytest-repeat works fine with Python 3.14, and never had any problems If 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 packages Test & Code is doing a series on pytest plugins pytest-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-repeat Thus, 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 suggested! Markdown follow up Prettier to format Markdown via Hugo Been using mdformat on some upcoming projects including the almost done Talk Python in Production book. Command I like is mdformat --number --wrap no ./ uv tool install --with is indeed the pipx inject equivalent, but requires multiple --with's: pipx inject mdformat mdformat-gfm mdformat-frontmatter mdformat-footnote mdformat-gfm-alerts uv tool install mdformat --with mdformat-gfm --with mdformat-frontmatter --with mdformat-footnote --with mdformat-gfm-alerts uv follow up From James Falcon As a fellow uv enthusiast, I was still holding out for a use case that uv hasn't solved. However, after last week's episode, you guys finally convinced me to switch over fully, so I figured I'd explain the use case and how I'm working around uv's limitations. I maintain a python library supported across multiple python versions and occasionally need to deal with bugs specific to a python version. Because of that, I have multiple virtualenvs for one project. E.g., mylib38 (for python 3.8), mylib313 (for python 3.13), etc. I don't want a bunch of .venv directories littering my project dir. For this, pyenv was fantastic. You could create the venv with pyenv virtualenv 3.13.2 mylib313, then either activate the venv with pyenv activate mylib313 and create a .python-version file containing mylib313 so I never had to manually activate the env I want to use by default on that project. uv doesn't have a great solution for this use case, but I switched to a workflow that works well enough for me: Define my own central location for venvs. For me that's ~/v Create venvs with something like uv venv --python 3.13 ~/v/mylib313 Add a simple function to my bashrc: `workon() { source ~/v/$1/bin/activate } \ so now I can run \workon mylib313orworkon mylib38when I need to work in a specific environment. uv's.python-version` support works much differently than pyenv's, and that lack of support is my biggest frustration with this approach, but I am willing to live without it. Do you Firefox but not Zen? You can now make pure Firefox more like Zen’s / Arc’s layout. Joke: So here it will stay See the follow up thread too! Also: Guido as Lord Python via Nick Muoh
    --------  
    36:31
  • #426 Committing to Formatted Markdown
    Topics covered in this episode: mdformat pre-commit-uv PEP 758 and 781 Serie: rich git commit graph in your terminal, like magic Extras Joke Watch on YouTube About the show Sponsored by Posit Connect Cloud: pythonbytes.fm/connect-cloud Connect with the hosts Michael: @[email protected] / @mkennedy.codes (bsky) Brian: @[email protected] / @brianokken.bsky.social Show: @[email protected] / @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öttle Last 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 Falk Use 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 accepted PEP 781 – Make TYPE_CHECKING a built-in constant draft status Also, 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
    --------  
    29:18
  • #425 If You Were a Klingon Programmer
    Topics covered in this episode: Why aren't you using uv? Python Developer Tooling Handbook Calling all doc writers: blacken-docs Reinventing notebooks as reusable Python programs Extras Joke Watch on YouTube About the show Brought to you by Posit Connect: pythonbytes.fm/connect. Connect with the hosts Michael: @[email protected] / @mkennedy.codes (bsky) Brian: @[email protected] / @brianokken.bsky.social Show: @[email protected] / @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 pip trust 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. Masochism Many 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 files properties Git-friendly: small code change => small diff easy for both humans and computers to read importable as a Python module, without executing notebook cells executable as a Python script editable with a text editor Also, … 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 Attendees New 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 hours Using pytest with Projects, 10 lessons, 3.4 hours pytest Booster Rockets, 6 lessons, 1.3 hours of content New format is easier to navigate Better 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 proposals HN 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
    --------  
    37:55
  • #424 We Will Test in Production
    Topics covered in this episode: The weird quirk with rounding in Python Python interpreter adds tail calls Remove punctuation from a string with translate and maketrans Extra, extra, extra Extras Joke Watch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python Training The Complete pytest Course Patreon Supporters Connect with the hosts Michael: @[email protected] / @mkennedy.codes (bsky) Brian: @[email protected] / @brianokken.bsky.social Show: @[email protected] / @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-Verheesb With numbers ending in .5, Python always rounds to an even number. round(0.5) → 0 round(1.5) → 2 etc This follows IEEE 754 You 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 transformers TypeScript rewritten in Go Firefox lies PyCon’s Startup Row Python in Production Book Extras Joke: Startrek Testing
    --------  
    27:23

Fler podcasts i Teknologi

Om Python Bytes

Python Bytes is a weekly podcast hosted by Michael Kennedy and Brian Okken. The show is a short discussion on the headlines and noteworthy news in the Python, developer, and data science space.
Podcast-webbplats

Lyssna på Python Bytes, The Changelog: Software Development, Open Source och många andra poddar från världens alla hörn med radio.se-appen

Hämta den kostnadsfria radio.se-appen

  • Bokmärk stationer och podcasts
  • Strömma via Wi-Fi eller Bluetooth
  • Stödjer Carplay & Android Auto
  • Många andra appfunktioner
Sociala nätverk
v7.15.0 | © 2007-2025 radio.de GmbH
Generated: 4/16/2025 - 1:23:52 PM