
    
        
        
        
                
        
        
        
                
        
        
        
            
{"version":"https:\/\/jsonfeed.org\/version\/1","title":"mathspp.com feed","home_page_url":"https:\/\/mathspp.com\/blog\/tags\/open-source","feed_url":"https:\/\/mathspp.com\/blog\/tags\/open-source.json","description":"Stay up-to-date with the articles on mathematics and programming that get published to mathspp.com.","author":{"name":"Rodrigo Gir\u00e3o Serr\u00e3o"},"items":[{"title":"TIL #135 \u2013 Build the Python documentation","date_published":"2025-10-26T14:44:00+01:00","id":"https:\/\/mathspp.com\/blog\/til\/build-the-python-documentation","url":"https:\/\/mathspp.com\/blog\/til\/build-the-python-documentation","content_html":"<p>Today I learned how to build the Python documentation to preview changes I wanted to make.<\/p>\n\n<p>If you're not on Windows, all it takes is to run <code>make -C Doc venv htmllive<\/code> to build the Python documentation locally and to preview it.\nThis command will build the documentation, start a local server to browse the docs, and also watch for changes in the documentation source files to live-reload while you edit!<\/p>\n<p>I needed this because the Python 3.14 documentation for the module <code>concurrent.interpreters<\/code> had a terrible-looking \u201cSee also\u201d callout with elements that were grossly misaligned:<\/p>\n<figure class=\"image-caption\"><img title=\"This makes my want to cry.\" alt=\"\u201cSee also\u201d callout with elements that are grossly misaligned\" src=\"\/user\/pages\/02.blog\/04.til\/135.build-the-python-documentation\/_bad.webp\"><figcaption class=\"\">This makes my want to cry.<\/figcaption><\/figure>\n<p>However, since I don't know rST, only Markdown, the issue wasn't obvious to me:<\/p>\n<pre><code class=\"language-rst\">.. seealso::\n\n   :class:`~concurrent.futures.InterpreterPoolExecutor`\n      combines threads with interpreters in a familiar interface.\n\n    .. XXX Add references to the upcoming HOWTO docs in the seealso block.\n\n   :ref:`isolating-extensions-howto`\n       how to update an extension module to support multiple interpreters\n\n   :pep:`554`\n\n   :pep:`734`\n\n   :pep:`684`<\/code><\/pre>\n<p>After some Googling, turns out the problem is the comment <code>.. XXX Add references...<\/code>.\nSince it's indentend four spaces, it's being interpreted as a blockquote!\nThe fix was just deleting a single space from the left of <code>.. XXX ...<\/code>.<\/p>\n<p>However, I did not stop there!\nI went above and beyond, capitalising the sentences and adding a full stop to the one that didn't have it!<\/p>\n<p>In the end, the \u201cSee also\u201d callout was looking better:<\/p>\n<figure class=\"image-caption\"><img title=\"What a work of art.\" alt=\"\u201cSee also\u201d callout with elements that are neatly aligned and with better-looking punctuation and capitalisation.\" src=\"\/user\/pages\/02.blog\/04.til\/135.build-the-python-documentation\/_good.webp\"><figcaption class=\"\">What a work of art.<\/figcaption><\/figure>","summary":"Today I learned how to build the Python documentation to preview changes I wanted to make.","date_modified":"2025-10-26T15:51:58+01:00","tags":["python","open source"],"image":"\/user\/pages\/02.blog\/04.til\/135.build-the-python-documentation\/thumbnail.webp"},{"title":"503 days working full-time on FOSS: lessons learned","date_published":"2024-04-01T00:00:00+02:00","id":"https:\/\/mathspp.com\/blog\/503-days-working-full-time-on-foss-lessons-learned","url":"https:\/\/mathspp.com\/blog\/503-days-working-full-time-on-foss-lessons-learned","content_html":"<p>This article shares some of the lessons I learned from working full-time on a FOSS project for 503 days.<\/p>\n\n<p>From the 14th of November of 2022 to the 31st of March of 2024 I worked full-time on a FOSS project.\nThis article is an account of some of the things that I learned during those 503 days.<\/p>\n<div class=\"notices blue\">\n<p>I have much more time to devote to <em><strong>you<\/strong><\/em> now that I don't have this full-time position.\nIf you're looking for Python training, <a href=\"mailto:rodrigo@mathspp.com\" class=\"mailto\">reach out to me<\/a>.\nI'll also be investing my time in this blog and in <a href=\"\/books\">my books<\/a>.<\/p>\n<\/div>\n<p>I joined Textualize, the company behind the popular FOSS Python packages <a href=\"https:\/\/github.com\/textualize\/rich\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Rich<\/a> and <a href=\"https:\/\/github.com\/textualize\/textual\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Textual<\/a>, on the 14th of November of 2022.\nWhen I joined to work remotely from sunny Portugal, I joined <a href=\"https:\/\/github.com\/willmcgugan\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Will<\/a> (the creator of Rich &amp; Textual, and my boss), <a href=\"https:\/\/github.com\/darrenburns\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Darren<\/a>, and <a href=\"https:\/\/github.com\/davep\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Dave<\/a>, all of whom worked together in Scotland.\nFor the first time in my professional life, I was the worst Python developer in the room<sup id=\"fnref1:1\"><a href=\"#fn:1\" class=\"footnote-ref\">1<\/a><\/sup>.\nThis means that my technical knowledge improved substantially over the course of these 503 days, namely in areas such as:<\/p>\n<ul><li>asynchronous code execution and Python's <code>asyncio<\/code>;<\/li>\n<li>Python tipe hinting;<\/li>\n<li>testing \/ <code>pytest<\/code>; and<\/li>\n<li>software engineering best practices in general.<\/li>\n<\/ul><p>However, this article will focus on the non-technical lessons I learned during this 503-day experience, that fall under these four broad categories:<\/p>\n<ol><li>how an online presence can lead to a job offer;<\/li>\n<li>how your ego shouldn't be in the way of your work;<\/li>\n<li>how to interact with users &amp; contributors; and<\/li>\n<li>how to work on a huge codebase you don't know 100%.<\/li>\n<\/ol><p>Let's dive right in.<\/p>\n<h2 id=\"everything-you-do-online-works-as-a-banner\">Everything you do online works as a banner<a href=\"#everything-you-do-online-works-as-a-banner\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h2>\n<p>One interesting thing that I learned even before starting my full-time position is that you can definitely find (job) opportunities in unconventional ways.\nThis has always been the case but the Internet makes it even easier to do so.<\/p>\n<p>If you're looking for a job, you can submit your CV to a platform or fill out a form.\nI've gotten job offers by going through that process.\nBut that's not how I got <em>this<\/em> job nor how I got any of my previous jobs.\nI'll tell you more or less how I <del>fooled Will into hiring me<\/del> got this job in the hope that you understand how powerful an online presence can be.<\/p>\n<p>I met Will on X\/Twitter, <a href=\"https:\/\/x.com\/mathsppblog\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">where I actively post about Python<\/a>.\nOver the course of many months we'd interact sporadically.\nSometimes I commented on his posts and sometimes he commented on my posts.\nI think Will enjoyed the Python tips I posted and the occasional link to an article of mine.<\/p>\n<p>After many months of occasional Twitter interactions and a couple of informal video calls, Will messaged me asking if I was interested in working for Textualize.\nSome months before, I had mentioned that I would see myself working with him further down the line.\nBut I wasn't...<\/p>","summary":"This article shares some of the lessons I learned from working full-time on a FOSS project for 503 days.","date_modified":"2025-07-23T16:49:02+02:00","tags":["open source","opinion","python"],"image":"\/user\/pages\/02.blog\/503-days-working-full-time-on-foss-lessons-learned\/thumbnail.webp"},{"title":"Contributing to open source: rich 2073","date_published":"2022-04-21T00:00:00+02:00","id":"https:\/\/mathspp.com\/blog\/contributing-to-open-source-rich-2073","url":"https:\/\/mathspp.com\/blog\/contributing-to-open-source-rich-2073","content_html":"<p>This is the story of how I started contributing to open source and, in particular, how I tackled issue #2073 of the well-known Python library <code>rich<\/code>, by Will McGugan.<\/p>\n\n<h2 id=\"preamble\">Preamble<a href=\"#preamble\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h2>\n<p>I am trying to get my feet wet in the world of open source.\nWhile I have a couple of contributions under my belt,\nthose have been pretty basic.\nSo, I decided to reach out to <a href=\"https:\/\/twitter.com\/willmcgugan\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Will McGugan<\/a> and ask if Will knew of any simple issues I could try to solve.\nWill suggested I take a look at <a href=\"https:\/\/github.com\/Textualize\/rich\/issues\/2073\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">issue #2073<\/a> of <code>rich<\/code>, so that's what I am going to be doing.<\/p>\n<h2 id=\"setting-up-the-environment\">Setting up the environment<a href=\"#setting-up-the-environment\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h2>\n<p>The first thing I do to start work is clone the repository into my machine:<\/p>\n<pre><code class=\"language-bash\">git clone https:\/\/github.com\/textualize\/rich<\/code><\/pre>\n<p>This way, I'll have all the files locally and I'll be able to play around with the code, etc.<\/p>\n<p>The <em>next<\/em> thing I do is use <code>poetry<\/code> to install all the dependencies in a virtual environment.\nI'm using <code>poetry<\/code> in this step because that's what <code>rich<\/code> uses.<\/p>\n<p>So, I install the dependencies:<\/p>\n<pre><code class=\"language-bash\">poetry install<\/code><\/pre>\n<p>While the repo cloned and the dependencies installed, I started preparing this blog post.\nAfter the dependencies got installed, I started a new shell within the virtual environment I had just created:<\/p>\n<pre><code class=\"language-bash\">poetry shell<\/code><\/pre>\n<p>Now, I have an environment where I can play with the current version of <code>rich<\/code> and where I can make sure I understand the issue before I try to fix it.<\/p>\n<h2 id=\"understanding-issue-2073\">Understanding issue 2073<a href=\"#understanding-issue-2073\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h2>\n<p>The next step in making my contribution is making sure I understand the issue I am handling.<\/p>\n<p>Here is the description of the bug, as per the original issue:<\/p>\n<blockquote>\n<p>Some of the fields in my objects consist of Numpy or xarray data whose repr may span accros multiple lines. Here is an example:<\/p>\n<pre><code class=\"language-py\">import numpy as np\nfrom rich.pretty import pprint\nzeros = np.zeros((4,4))\npprint(zeros)<\/code><\/pre>\n<p>I get a nicely indented repr:<\/p>\n<pre><code class=\"language-py\">array([[0., 0., 0., 0.],\n&#9474;      [0., 0., 0., 0.],\n&#9474;      [0., 0., 0., 0.],\n&#9474;      [0., 0., 0., 0.]])<\/code><\/pre>\n<p>Now, if I use one of these in a dictionary, like this<\/p>\n<pre><code class=\"language-py\">d = {\"foo\": \"bar\", \"zeros\": zeros}\npprint(d)<\/code><\/pre>\n<p>I get that<\/p>\n<pre><code class=\"language-py\">{\n&#9474;   'foo': 'bar',\n&#9474;   'zeros': array([[0., 0., 0., 0.],\n&#9474;      [0., 0., 0., 0.],\n&#9474;      [0., 0., 0., 0.],\n&#9474;      [0., 0., 0., 0.]])\n}<\/code><\/pre>\n<p>while I'd expect indentation to be adjusted like this<\/p>\n<pre><code class=\"language-py\">{\n&#9474;   'foo': 'bar',\n&#9474;   'zeros': array([[0., 0., 0., 0.],\n&#9474;                   [0., 0., 0., 0.],\n&#9474;                   [0., 0., 0., 0.],\n&#9474;                   [0., 0., 0., 0.]])\n}<\/code><\/pre>\n<p>or at least something like this (saves horizontal space, no need to guess length of first line)<\/p>\n<pre><code class=\"language-py\">{\n&#9474;   'foo': 'bar',\n&#9474;   'zeros': \n|   |   array([[0., 0., 0., 0.],\n&#9474;   |          [0., 0., 0., 0.],\n&#9474;   |          [0., 0., 0., 0.],\n&#9474;   |          [0., 0., 0., 0.]])\n}<\/code><\/pre>\n<\/blockquote>\n<p>(I omitted some details that are irrelevant here.)<\/p>\n<p>After reading the issue, the first thing I did was to make sure I am able to reproduce it.\nSo, I opened a...<\/p>","summary":"This is the story of how I started contributing to open source and, in particular, how I tackled issue #2073 of the well-known Python library `rich`, by Will McGugan.","date_modified":"2025-07-23T16:49:02+02:00","tags":["open source","programming","python"],"image":"\/user\/pages\/02.blog\/contributing-to-open-source-rich-2073\/thumbnail.webp"}]}
