<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Python on staticnotes.org</title>
    <link>/tags/python/</link>
    <description>Recent content in Python on staticnotes.org</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <lastBuildDate>Mon, 01 Jan 0001 00:00:00 +0000</lastBuildDate>
    <atom:link href="/tags/python/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>TIL how to re-run only failed tests</title>
      <link>/til/2025/11/pytest-rerun-failed/</link>
      <pubDate>Fri, 21 Nov 2025 13:00:00 +0000</pubDate>
      <guid>/til/2025/11/pytest-rerun-failed/</guid>
      <description>&lt;p&gt;This is a super small thing I stumbled over.&#xA;When I implement a new feature, there is inevitably a step where I go through the failing pytest tests and fix or clarify them.&lt;/p&gt;&#xA;&lt;p&gt;Unless I use an IDE, my work loop is like this:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Make code change&lt;/li&gt;&#xA;&lt;li&gt;Run &lt;code&gt;python -m pytest&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Check which tests are failing.&lt;/li&gt;&#xA;&lt;li&gt;Go back to 1.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Now, 2. runs all tests which can take quite some time. There is always the option to run a specific test only, but multiple failing tests can be scattered across different files.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Clearing up confusion around IPython, ipykernel, and Jupyter notebooks</title>
      <link>/posts/jupyter-confusion/</link>
      <pubDate>Mon, 26 Aug 2024 00:00:00 +0000</pubDate>
      <guid>/posts/jupyter-confusion/</guid>
      <description>&lt;p&gt;One of my big recurring time sinks while doing data science work used to be trying to get my colleagues&amp;rsquo; jupyter notebooks to run on my machine. The main contributing factors:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;My team generally uses poetry environments to improve reproducibility, but sometimes dependencies aren&amp;rsquo;t specified&lt;/li&gt;&#xA;&lt;li&gt;I use VS code and the jupyter extension to edit notebooks in VS code which requires more configuration then running the Jupyter web UI.&lt;/li&gt;&#xA;&lt;li&gt;I lacked a clear understanding of the differences of &lt;code&gt;IPython&lt;/code&gt;, &lt;code&gt;ipykernel&lt;/code&gt;, &lt;code&gt;jupyter&lt;/code&gt; and which python environments are being used when running a notebook.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So this is my attempt at a &#xA;&lt;a href=&#34;https://www.swyx.io/friendcatchers&#34; &#xA;&#xA;    target=&#34;_blank&#34;&#xA;    &gt;friendcatcher&#xA;    &#xA;        &lt;span style=&#34;white-space: nowrap&#34;&gt;&amp;thinsp;&lt;svg&#xA;            style=&#34;height: 0.7em; width: 0.7em; padding-left: -0.2em;&#34; focusable=&#34;false&#34; data-prefix=&#34;fas&#34; data-icon=&#34;external-link-alt&#34;&#xA;            class=&#34;svg-inline--fa fa-external-link-alt fa-w-16&#34; role=&#34;img&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&#xA;            viewBox=&#34;0 0 512 512&#34;&gt;&#xA;            &lt;path fill=&#34;currentColor&#34;&#xA;                d=&#34;M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z&#34;&gt;&#xA;            &lt;/path&gt;&#xA;        &lt;/svg&gt;&#xA;    &lt;/span&gt;&#xA;        &#xA;    &#xA;&lt;/a&gt;. I hope this saves you a few minutes the next time you run into similar issues.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
