<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sambhav Kothari on Medium]]></title>
        <description><![CDATA[Stories by Sambhav Kothari on Medium]]></description>
        <link>https://medium.com/@sambhavkothari?source=rss-501aa4930ba------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wf5UwV8FjvaNSJtsXaMLpw.jpeg</url>
            <title>Stories by Sambhav Kothari on Medium</title>
            <link>https://medium.com/@sambhavkothari?source=rss-501aa4930ba------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 18:45:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sambhavkothari/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[kpack joins the Buildpacks Community Organization]]></title>
            <link>https://medium.com/buildpacks/kpack-joins-the-buildpacks-community-organization-223e59bda951?source=rss-501aa4930ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/223e59bda951</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[community]]></category>
            <category><![CDATA[cncf]]></category>
            <category><![CDATA[vmware]]></category>
            <category><![CDATA[cloud-native-buildpacks]]></category>
            <dc:creator><![CDATA[Sambhav Kothari]]></dc:creator>
            <pubDate>Thu, 10 Aug 2023 18:35:13 GMT</pubDate>
            <atom:updated>2023-08-10T18:35:13.715Z</atom:updated>
            <content:encoded><![CDATA[<p>We announced the <a href="https://medium.com/buildpacks/introducing-the-buildpack-community-organization-9d5495c4e982">Buildpacks Community organization a few months ago</a> as a vendor-neutral organization for trusted Buildpack integrations maintained by our ever-growing community.</p><p>The <a href="https://github.com/buildpacks">Buildpacks project</a> is thrilled to announce the donation of <a href="https://github.com/buildpacks-community/kpack">kpack</a>, a Kubernetes-based Buildpacks platform that has been part of the Buildpacks community for years, to the <a href="https://github.com/buildpacks-community">Buildpacks Community GitHub organization</a>. This is a big milestone for the Buildpacks project, as it is our first major community project.</p><figure><img alt="kpack — Kubernetes Native Container Build Service" src="https://cdn-images-1.medium.com/max/208/1*vaSR3NSW4JAdLtVWzRkY-w.png" /><figcaption><a href="https://github.com/buildpacks-community/kpack">kpack — Kubernetes Native Container Build Service</a></figcaption></figure><h3>Why this is exciting</h3><p>The donation of kpack to the Buildpacks Community org is an exciting prospect for multiple reasons.</p><p><strong>An out-of-the-box Kubernetes integration</strong>: As a <a href="https://www.cncf.io/">Cloud Native Computing Foundation</a> (CNCF) incubating project, <a href="https://github.com/buildpacks/community/blob/main/roadmaps/2021.md#integration-with-the-cloud-native-ecosystem">having a first-class Kubernetes integration has been on our roadmap for a while now</a>. Kpack allows you to truly scale the capabilities that Buildpacks provides and makes it a breeze to manage a large fleet of applications — whether it is building a multi-tenant zero-privilege container building solution or <a href="https://youtu.be/bpshvqQMYM0?t=963">mitigating vulnerabilities through our powerful rebase operation for thousands of images in a matter of minutes.</a></p><p><strong>A vendor-neutral project</strong>: kpack is an open source software project that originated at <a href="https://tanzu.vmware.com/content/blog/introducing-kpack-a-kubernetes-native-container-build-service">Pivotal</a>, a company that was acquired by <a href="https://www.vmware.com/">VMware</a> in December 2019. By donating kpack to the Buildpacks Community Organization, VMware hopes to ensure the project will remain vendor-neutral. This is important to the Buildpacks community, as we believe that Cloud Native Buildpacks should be accessible and open to contributions by everyone, regardless of their vendor preferences or affiliations. This is evidenced by the fact that the maintainer pool for kpack is already growing and diversifying (one of the key indicators of a mature project according to CNCF) with <a href="https://github.com/buildpacks-community/kpack/pull/1252">the recent addition of Bloomberg</a>, an end-user organization that is an active contributor to the project.</p><h3>Opportunities for the Community</h3><p>The inclusion of kpack under the Buildpacks (CNCF) umbrella will provide a number of opportunities for the community, including:</p><p><strong>Increased adoption</strong>: The donation of kpack to CNCF will make it more likely that users will adopt kpack and, in-turn, Cloud Native Buildpacks on Kubernetes.</p><p><strong>Improved efficiency</strong>: The donation of kpack will help ensure that the roadmaps of both kpack and Cloud Native Buildpacks are closely aligned. This will make it easier to coordinate efforts between the two communities and improve the overall user experience.</p><p><strong>New features and capabilities</strong>: The donation of kpack gives the Buildpacks community an opportunity to add new features and capabilities to the project. This will help make kpack even more powerful and versatile.</p><h3>Conclusion</h3><p>Buildpacks is excited to welcome kpack to our community organization. We believe this donation is a major milestone for the Cloud Native Buildpacks project, and we are grateful to VMware for its support. We look forward to working with the kpack community to make this project a success.</p><h3>Get involved</h3><p>We are excited to hear from you and learn with you! Here are several ways you can engage with us and the rest of the Buildpacks community:</p><ul><li>Join the Buildpacks slack channel, <a href="https://cloud-native.slack.com/archives/C033DV8D9FB">#buildpacks</a> in the CNCF workspace.</li><li>Join the kpack slack channel, <a href="https://cloud-native.slack.com/archives/C05GETJ2NP7">#buildpacks-kpack</a> in the CNCF workspace</li><li>Find us on <a href="https://github.com/buildpacks-community/kpack">GitHub</a>. Suggest how we can improve the project, the docs, or share any other feedback.</li><li>Attend our Community Meetings! Check out the <a href="https://buildpacks.io/community/">Community page</a> for full details on how to attend.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=223e59bda951" width="1" height="1" alt=""><hr><p><a href="https://medium.com/buildpacks/kpack-joins-the-buildpacks-community-organization-223e59bda951">kpack joins the Buildpacks Community Organization</a> was originally published in <a href="https://medium.com/buildpacks">Buildpacks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The one-stop guide to (easy) cross-platform Python freezing: Part 1]]></title>
            <link>https://medium.com/hackernoon/the-one-stop-guide-to-easy-cross-platform-python-freezing-part-1-c53e66556a0a?source=rss-501aa4930ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/c53e66556a0a</guid>
            <category><![CDATA[freezing]]></category>
            <category><![CDATA[pyinstaller]]></category>
            <category><![CDATA[bundling]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[package]]></category>
            <dc:creator><![CDATA[Sambhav Kothari]]></dc:creator>
            <pubDate>Fri, 16 Feb 2018 13:32:55 GMT</pubDate>
            <atom:updated>2019-01-05T23:29:42.969Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*klxctdYKT_DcsLxVncqdJA.png" /><figcaption>Image taken from Sqreen.io</figcaption></figure><p>It’s been almost an year since I have been a maintainer for <a href="http://picard.musicbrainz.org/">MusicBrainz Picard</a>, a cross-platform multi-lingual desktop app, that allows you to tag your music files via this <a href="http://musicbrainz.org/">very cool service called MusicBrainz</a>.</p><p>Picard, I’d say is a fairly large python app with about ~35k SLoC. With a python app of such size, come challenges. One of the toughest challenges I faced this last year has been packaging Picard for all the three platforms that it supports, Linux, macOS and Windows after I ported it to Python 3/PyQt5 for my GSoC project. You can read more about that <a href="https://hackernoon.com/500-commits-of-summer-my-story-of-foss-and-gsoc-40bb8b325f65">here.</a></p><blockquote>“Freezing” your code is creating an executable file to distribute to end-users, that contains all of your application code as well as the Python interpreter.</blockquote><blockquote>The advantage of distributing this way is that your application will “just work”, even if the user doesn’t already have the required version of Python (or any) installed. On Windows, and even on many Linux distributions and OS X, the right version of Python will not already be installed.</blockquote><blockquote>- <a href="http://docs.python-guide.org/en/latest/shipping/freezing/">Hitchhiker’s Guide to Python</a></blockquote><h4>Testing my options</h4><p>Our existing setup used py2exe and py2app to freeze Picard for Windows and macOS respectively. Since they don’t entirely support Python 3 and PyQt5, I was on the lookout for a new freezing tool. I finally settled on <a href="http://pyinstaller.org/">PyInstaller</a> after testing waters with <a href="https://anthony-tuininga.github.io/cx_Freeze/">cx_Freeze</a>.</p><h4>PyInstaller — A happy surprise</h4><p>One thing I’d like to say about PyInstaller — I was absolutely surprised how easy it was to freeze my python application, while putting minimal efforts from my side, chasing mythical dependencies. It supports Python 2 and 3 and all 3 desktop OSes and even allows you to create portable all-in-one binaries for each. How cool is that!</p><p>I plan on giving you a small glimpse of how powerful and simple PyInstaller is, and how, coupled with <a href="https://ci.appveyor.com/">AppVeyor</a> and <a href="http://travis-ci.org/">TravisCI</a>, you can package your python apps for Windows and macOS without even having access to either of them.</p><h3>Getting started</h3><p>In this part of the blog, we will be making a PyInstaller spec file and freezing our package. In the next part, we will be looking into TravisCI and AppVeyor for continuous delivery.</p><h4>Installing PyInstaller</h4><p>All you need to do is pip install pyinstaller . It is as simple as that. You can either install it globally or in a virtual environment housing your project. The latter is obviously preferable. This will give you access to mainly 2 scripts that we will be using in the rest of this tutorial — pyinstaller and pyi-makespec .</p><h4>Project info and structure</h4><p>Let’s start with a very basic structure to introduce PyInstaller and make adjustments from there on, as per our needs.</p><pre>package_dir<br>├── package<br>│   ├── submodule_bar<br>│   ├── submodule_foo<br>│   ├── __init__.py<br>│   └── main.py<br>├── entry_point.py<br>└── setup.py</pre><p>The above assume that you have an entry point script called entry_point.py which launches your application. See <a href="http://python-packaging.readthedocs.io/en/latest/index.html#">python-packaging</a> for help on how to package your app.</p><p>Now comes the magical part. All you need to do to freeze your app is</p><p>pyinstaller entry_point.py -n foobar</p><p>It is as simple as that! PyInstaller will automagically figure out all the dependencies, include all the dynamic libraries that need to be loaded and create adistdirectory with the frozen app named <strong>foobar</strong>.</p><p>The output should as follows</p><pre>package_dir<br>├── dist<br>│   └── foobar<br>│       ├── ...<br>│       ├── ...<br>│       ├── ...<br>│       └── foobar<br>├── package<br>│   ├── submodule_bar<br>│   ├── submodule_foo<br>│   ├── __init__.py<br>│   └── main.py<br>├── entry_point.py<br>├── foobar.spec<br>└── setup.py</pre><p>You can execute your app by launching dist/foobar/foobar (Of course it will be foobar.exe or foobar.app on Windows and macOS respectively.</p><h4>Portable apps, what is this magic?</h4><p>Now let’s take things a bit further. What if you want you entire app bundled with all its dependencies as a single portable executable? Simple, just pass the --onefile flag to PyInstaller.</p><p>pyinstaller entry_point.py -n foobar --onefile</p><p>PyInstaller will output a single portable executable in the dist folder named foobar which can easily be launched. Again, PyInstaller will automagically find and bundle all the dependencies inside that one file!</p><h3>It can’t surely be that simple? Can it? What if I need to…</h3><h4>Bundle Libraries</h4><p>PyInstaller supports a lot of major frameworks and libraries out of the box. This includes —</p><p>Babel, Django, IPython, matplotlib, numpy, pillow, PyGTK, PyQt4, PyQt5, scipy, sphinx, SQLAlchemy, wxPython and <a href="https://github.com/pyinstaller/pyinstaller/wiki/Supported-Packages">many more.</a></p><p>If your app depends on any of the above libraries, you don’t need to worry about the hassles of including dependent libraries, dlls, hidden imports, packages or anything else for that matter. PyInstaller takes care of everything for you. It inspects your code recursively and figures out all the dependencies.</p><h4>Add and bundle resources</h4><p>Resources can be anything, images, icons, textual data, translation strings. There is a very simple recipe to bundle and access your resources. For simplicity, let’s assume all your resources are available inside a directory called resources as below —</p><pre>package_dir<br>├── package<br>│   ├── submodule_bar<br>│   ├── submodule_foo<br>│   ├── __init__.py<br>│   └── main.py<br>├── resources<br>│   ├── bar.dat<br>│   └── foo.png<br>├── entry_point.py<br>└── setup.py</pre><p><strong><em>Bundling the resources</em></strong></p><p>Run pyi-makespec entry_point.py -n foobar --onefile. The pyi-makespec script accepts the same arguments as pyinstaller but instead of actually running PyInstaller, it creates a foobar.spec spec file for you to customise, which can then be called with pyinstaller foobar.spec.</p><p>Your foobar.spec file should look something like this —</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8113bbe708a9e40c591cfd547c15d3a7/href">https://medium.com/media/8113bbe708a9e40c591cfd547c15d3a7/href</a></iframe><p>The spec file is simply a python script albeit with some special callables as shown above. To add resources, you simply need to create an array with a list of tuples —</p><ul><li>The first string specifies the file or files as they are in this system now.</li><li>The second specifies the name of the <em>folder</em> to contain the files at run-time.</li></ul><p>A simple script to do the same would be —</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/93cafe368b3638bb44812de60e68be17/href">https://medium.com/media/93cafe368b3638bb44812de60e68be17/href</a></iframe><p>You will be adding the above code to the spec file, which should now look like this —</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f6489defdc977823259e1f13e2eeefc5/href">https://medium.com/media/f6489defdc977823259e1f13e2eeefc5/href</a></iframe><p><em>Notice the call to </em><em>get_resources() in </em><em>a.datas .</em></p><p><strong><em>Accessing bundled resources</em></strong></p><p>Quoting from the <a href="http://pyinstaller.readthedocs.io/en/stable/runtime-information.html">PyInstaller wiki </a>—</p><blockquote>You may need to learn at run-time whether the app is running from source, or is “frozen” (bundled). For example, you might have data files that are normally found based on a module’s __file__ attribute. That will not work when the code is bundled.</blockquote><blockquote>The PyInstaller bootloader adds the name frozen to the sys module. So the test for “are we bundled?”</blockquote><p>To summarise, this is what you need to do to access any resources you have bundled —</p><p>Add the following two variables to your utility section —</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f20b2c2eccd7a9d5b3e53987a7c523ec/href">https://medium.com/media/f20b2c2eccd7a9d5b3e53987a7c523ec/href</a></iframe><p>You can then use this in your entry_point.py as follows —</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3669bfa2637286c88d80cbdaaafc3377/href">https://medium.com/media/3669bfa2637286c88d80cbdaaafc3377/href</a></iframe><p>You can now load your resources in main.py as follows —</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/99399da8ecbdda2d4b24d3707857ba8c/href">https://medium.com/media/99399da8ecbdda2d4b24d3707857ba8c/href</a></iframe><h4>Bundle binaries</h4><p>PyInstaller should automagically bundle any .so or .dll files by inspecting your python module. But in case it <a href="http://pyinstaller.readthedocs.io/en/stable/spec-files.html#adding-binary-files">fails to do so,</a> it is easy to add them.</p><p>Bundling binaries or libraries that your app depends on is pretty much similar to how you would bundle data files.</p><p>Assuming the following directory structure —</p><pre>package_dir<br>├── bin<br>│   ├── bar.so<br>│   ├── bar.dll<br>│   └── bar.dylib<br>├── package<br>│   ├── submodule_bar<br>│   ├── submodule_foo<br>│   ├── __init__.py<br>│   └── main.py<br>├── resources<br>│   ├── bar.dat<br>│   └── foo.png<br>├── entry_point.py<br>└── setup.py</pre><p>Let’s say your app depends on a shared library bar, and you have binaries available for it for all 3 operating systems.</p><p>You might go around including them as follows —</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/626bd9d7c4d8809e0482600dc4f8cff5/href">https://medium.com/media/626bd9d7c4d8809e0482600dc4f8cff5/href</a></iframe><p>You might ask, what’s the difference between adding a file as a data file or a binary file, well quoting from the PyInstaller Wiki —</p><blockquote>Binary files refers to DLLs, dynamic libraries, shared object-files, and such, which PyInstaller is going to search for further binary dependencies. Files like images and PDFs should go into thedatas</blockquote><p>So make sure you are adding any dlls or so files as binaries instead of data files.</p><h4>Freeze a GUI app</h4><p>You will probably want to pass the --windowed flag to pyinstaller in order to make sure there is no console while opening the App.</p><h4>Freeze a macOS app</h4><p>If you are freezing a one-file windowed macOS app you will want to add an additional callable to your spec file like so —</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/375b98907d2003b53e52d97c117156be/href">https://medium.com/media/375b98907d2003b53e52d97c117156be/href</a></iframe><p>See the <a href="http://pyinstaller.readthedocs.io/en/stable/spec-files.html#spec-file-options-for-a-mac-os-x-bundle">PyInstaller-Wiki</a> for more information about these options.</p><blockquote>Note: For simple cases, you can also accomplish all the of the above through flags passed to the pyisntaller or pyi-makespec scripts. See <a href="http://pyinstaller.readthedocs.io/en/stable/spec-files.html">Using Spec Files</a> for more information.</blockquote><h3>What’s next?</h3><p>The above recipes should be more than enough for all general use cases. I hope the above provides a basic guide on how to use PyInstaller. For more advanced use cases, you can sift through the <a href="http://pyinstaller.readthedocs.io/en/stable/spec-files.html#">PyInstaller Wiki.</a></p><p>If you want to see the above guide in action, you can have a look at the <a href="https://github.com/metabrainz/picard">Picard github repo</a>.</p><p>In the next part of this blog, we will learn how to make use of AppVeyor and TravisCI along with PyInstaller to bundle our applications.</p><h3>HALLLLP, I am stuck!</h3><p>If you find yourself unable to comprehend any part of the guide or have a very particular use-case, leave a comment below, I will be happy to help if I can :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c53e66556a0a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/the-one-stop-guide-to-easy-cross-platform-python-freezing-part-1-c53e66556a0a">The one-stop guide to (easy) cross-platform Python freezing: Part 1</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[500 Commits of Summer: My story of FOSS and GSoC]]></title>
            <link>https://medium.com/hackernoon/500-commits-of-summer-my-story-of-foss-and-gsoc-40bb8b325f65?source=rss-501aa4930ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/40bb8b325f65</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[metabrainz]]></category>
            <category><![CDATA[picards]]></category>
            <category><![CDATA[summer]]></category>
            <dc:creator><![CDATA[Sambhav Kothari]]></dc:creator>
            <pubDate>Mon, 04 Sep 2017 17:12:05 GMT</pubDate>
            <atom:updated>2018-02-28T10:09:46.177Z</atom:updated>
            <content:encoded><![CDATA[<p>This story of summer started in a dull grey winter at home. Bored, I started lingering around <a href="https://www.irccloud.com/irc/freenode">IRC</a> channels and much like the Alice of Wonderland, stumbled into the wonderful world of <a href="https://en.wikipedia.org/wiki/Free_and_open-source_software">FOSS</a>. Little did I know, it was gonna be one of the best things that happened to me. Below is a story of bugs, PRs , repos, commits, and some more commits. But it is also a story of curiosity, learning, frustrations (a lot of it), resilience (more than you think) and some amazing amazing people of the community. If I have to sum it up for you, I couldn’t think of a way better than this. So here it goes…</p><p>Disclaimer: It was a long journey, hence the long blog.</p><h3>The Story</h3><h4><a href="https://github.com/metabrainz/picard/pull/496/commits/40d934250b53395232e5cfbe79d45959ac9500d8">#1: PICARD-851: Correctly update parent items on save</a></h4><p>I started out slow. Figuring things out. <a href="http://picard.musicbrainz.org/">Picard</a> has a nicely organized and pretty <a href="https://github.com/metabrainz/picard">code-base</a> in python. Something that I have always admired and what motivated me to contribute to this project. I went through <a href="https://tickets.metabrainz.org/projects/PICARD/issues">the tickets</a> and found something I figured I could fix. It took me a complete day to figure my head around the code. Although there was a time when I felt helpless and was about to lose my patience, I was finally able to find where the logic broke and fix it. It felt amazing making my first contribution to Picard.</p><h4><a href="https://github.com/metabrainz/picard/pull/501/commits/eddee11fa3e45e61d1f5d44a56b69faad1c49dba">#7: PICARD-546,287: Add support for tag removal</a></h4><p>My first big pull request, where I was actually implementing a feature rather than fixing a bug. The entire pull request took a week to complete including the code reviews. I had to delve and add code across the file and tag handling module of Picard.</p><h4><a href="https://github.com/metabrainz/picard/commit/e42944e8f4ce51000533ee33a85a02ccd91e95bf">#120: Return empty metadata instead of empty dictionary</a></h4><p>It was finally a month since I had started contributing to Picard. One of my biggest motivations to contributing regularly was <a href="https://opensource.googleblog.com/2015/03/critiquebrainz-and-rocking-google.html">this post</a> by our org admin ruaok before the start of GSoC ’15. I wanted to hold myself to the same standard, and so I did: 1 PR a day. I was quickly fixing up as many tickets as I could, making sure I kept my mentor, zas’ hands full with code reviews. Everyday was exciting for me as I would skim through Jira looking for tickets I could fix for the day. I managed to fix over 20 tickets in my first month.</p><h4><a href="https://github.com/metabrainz/picard/commit/195091fcaa9780501627beba35135d6f8e55288d">#228: Add Picard 1.4 release notes</a></h4><p>It was Valentine’s Day and man oh man was it a memorable day for my code-valentine — Picard. We finally released a major Picard version after more than 2 years and over 1000 commits. I also got featured on the <a href="https://blog.musicbrainz.org/2017/02/14/picard-1-4-released/">release blog post</a>, something that made me feel really proud of all the work I had done so far. This was also the time that I had started to visualize how my <a href="https://summerofcode.withgoogle.com/">GSoC</a> project would look like. I started pitching proposals of a v2 for Picard and I got a lot of support for the direction that I wanted to head in. If you want a detailed look into what my final GSoC proposal looked like, <a href="https://community.metabrainz.org/t/gsoc-2017-picard-v2-0/227579">it can be seen on the MetaBrainz Community Forum</a>.</p><h4><a href="https://github.com/metabrainz/picard/commit/5b7178d4711e80b8a0a3c712049bf55a9d8964c5">#249: Merge pull request #632 from lalinsky/master</a></h4><p>A few days, later another surprise awaited me — I finally got push access to the main Picard repo. This was the first pull request I merged. This pull request along with <a href="https://github.com/metabrainz/picard/pull/633">PR #633</a> was my first time foraying into the world of cross-platform issues. This I believe is the first OSX related bug I fixed, with help from <a href="https://oxygene.sk/">luks</a> and his trusty ol’ Mac. After hours of remote sessions on the Mac that luks had setup for me, we were finally able to resolve a <a href="https://tickets.metabrainz.org/browse/PICARD-988">nasty bug</a> that was affecting the OSX build.</p><h4><a href="https://github.com/metabrainz/picard/pull/503/commits/559d5dd657be9f7134d4bfd800c6de866f4a84cb">#279: Update Qt5 port</a></h4><p>This was around the time that I had started to work according to my proposal. We had already released Picard 1.4.1 to fix day 0 bugs that came with 1.4. The development efforts had started to shift toward Picard 2.0.</p><p><strong>The first major GSoC task was up</strong>: porting the entire code base to Qt5.</p><p>It took <a href="https://github.com/metabrainz/picard/pull/503">a mammoth of a pull-request</a> and multiple subsequent patches to finally have Picard up and running on Qt5. Major challenges to this port was the lack of documentation on <a href="http://pyqt.sourceforge.net/Docs/PyQt5/pyqt4_differences.html">porting for PyQt5.</a> Apart from the PyQt porting guide, I also had to rely on the <a href="https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5">Qt5 porting guide written for C++</a> and figure out the equivalent python bindings. Lucky for me, the guys over at Riverbank (the people who made the PyQt bindings) have done a wonderful job at keeping the bindings as close to the C++ API as possible. This along with stack-overflow and the wonderfully documented Qt5 code, made the porting job much much easier.</p><p>Another challenge that I faced was making sure that the above code passed tests on our CI. Picard uses Travis CI, which uses Ubuntu 14.04 containers to build the code. Unfortunately, 14.04 does not have the PyQt5 package for Py2 and building it from source takes forever. As a result, I had to dockerize the repo and run the tests in Ubuntu 16.04 in docker in a Trusty container over at Travis CI. Talk about code-ception.</p><h4><a href="https://github.com/metabrainz/picard/pull/664/commits/995ff42cc9956e666d55813e789043ad51ed1ab8">#280: Replace deprecated __builtin__</a></h4><p>Next task on my GSoC checklist was equally big. I had to port all of the code to Python 3. I was targeting Python 3.5 for the port. Of much help to me this time were the Python tools, pylint and python-modernize. I used them to figure out the pieces of Python version 2 code that had been deprecated and to replace them with equivalent Python 3 code. Major part of the problems I faced here were encoding issues. And believe me, they only get magnified if your app is cross-platform and multilingual.</p><p>Couple the above with PyQt5 behaving <a href="https://github.com/metabrainz/picard/pull/664/commits/028369ca048c1f59c084182a61f898e88e198419">slightly</a> <a href="https://github.com/metabrainz/picard/pull/664/commits/1d658bb8c353eae3c7b503a106ed533b4a915922">differently</a> for Python 3 compared to Python 2, I had to plow through a lot of encoding/decoding/string/bytes issues. Pile <a href="https://mutagen.readthedocs.org/">Mutagen</a> (a Python audio tagging library that Picard depends on) on top of this mess and you have a recipe for an encoding/decoding disaster.</p><p>After lots of string/byte fixes and banging my head against the wall <a href="https://github.com/metabrainz/picard/commit/0a1ded3f4afcb28abc2b0cdc87cecaa64180bc7c#diff-36fbf8a3a6bddcafa7a341560181f2f5">porting</a> this <a href="https://github.com/metabrainz/picard/blob/master/picard/util/filenaming.py">black magic code</a>, I finally managed to port Picard to Python 3 with all tests passing. \o/</p><p>You can find all the above commits in <a href="https://github.com/metabrainz/picard/pull/664">this massive PR</a>.</p><h4><a href="https://github.com/metabrainz/picard/pull/721/commits/b1271c2f8e13d7651dbf30a563de4a47b33d1ef5">#382: Update setup script to allow submitting pip packages</a></h4><p>Next, to weed out further bugs, I wanted as many alpha testers as possible. To make their task easier, I packaged Picard into a pip package and released it on <a href="https://blog.musicbrainz.org/2017/05/13/picard-2-0-dev-available-via-pypi/">PyPi</a>.</p><h4><a href="https://github.com/metabrainz/picard/commit/868432badc9cbb1cfb4b1fa31e641e3a76d53c91">#393: PICARD-817: Enable high DPI support for Picard</a></h4><p>I further tackled the issue of Picard not rendering properly on High-DPI screens. This issue mainly affected our OSX users and with the port to Qt5, it was easy to alleviate. Although not mentioned explicitly in the Qt5 documentation, I was able to find a <a href="http://blog.qt.io/blog/2013/04/25/retina-display-support-for-mac-os-ios-and-x11/">couple of</a> <a href="http://blog.davidedmundson.co.uk/blog/kde_apps_high_dpi">blog posts</a> that helped me successfully implement it. Basically I needed to add up-scaled versions of the icons used by Picard in the Qt resources with a special suffix and Qt took care of the rest.</p><p>Since the upscaled version of the icons used by Picard were missing, I ended up <a href="https://github.com/metabrainz/picard/pull/727">designing an entirely new icon-set for Picard</a> myself. This was my first time with tweaking with Inkscape, but I think I managed fine.</p><h4><a href="https://github.com/metabrainz/picard/commit/e09d86fd7e0f815c8b604e52ad52801a2795149d">#404: Add coverage reports for codacy</a></h4><p>Part of my GSoC project included testing the Picard code extensively. To help me get on with it, I set up <a href="https://www.codacy.com/">Codacy</a> on the Picard repository to display coverage and linting issues for all builds. This really helped with reviewing code and keeping contributions to the Picard repo clean and upto the quality that is expected. Coverage reports also allowed us to figure out which key pieces of Picard code was untested and target them to ensure there were as less regressions as possible.</p><h4><a href="https://github.com/metabrainz/picard/commit/a79d05efa7d07cc87788d94f91df040928c3f67d">#442: Migrate code to json API</a></h4><p>My next big challenge was moving the webservice API calls from XML to JSON. Initally it meant refactoring the spaghetti code that was the Picard webservice module. I untangled the code and split it into an easy to add upon WebService and APIHelper classes.</p><p>Next came the actual porting part. I had to manually figure out the differences in the JSON and XML outputs of all the APIs used by Picard (mainly the <a href="https://musicbrainz.org/ws/2/">MusicBrainz API</a> and the <a href="https://acoustid.org/webservice">AcoustID API</a>).</p><p>This port also helped in figuring out the parts of MB JSON API that were missing or behaving differently from the XML API. Bitmap, our resident MB developer was quick to fix <a href="https://tickets.metabrainz.org/issues/?filter=-2&amp;jql=project%20%3D%20MBS%20AND%20reporter%20in%20(samj1912)%20order%20by%20created%20DESC">all the issues</a> blocking the transition to the JSON API for Picard. Picard switching to the JSON API also served as a good way to test our upcoming MB WebService 2.5, that is supposed to be JSON only.</p><h4><a href="https://github.com/metabrainz/picard/commit/d7223f81a73c3e8ff6e0c54103c1a3df5c8aef7b">#485: Add appveyor config for windows tests</a></h4><p>Testing a cross-platform app means you need to get your hands dirty on all 3 OSes. Primarily a Linux user, I had to blindly write CI configs for Windows and OSX. For Windows testing, I have not yet found a better platform than <a href="https://ci.appveyor.com/">AppVeyor</a>. It is free for FOSS projects and down-right amazing in terms of queuing and build speeds.</p><p>I didn’t have any options when it came to OSX builds. Although Travis does provide the functionality, the number of OSX containers available are scarce compared to the number of jobs that get submitted. As a result, I faced long queuing times which made the blindly-writing-configs-and-using-Travis-to-test part very difficult. I managed to do it with a wee bit of patience and the fact the OSX has bash.</p><h4><a href="https://github.com/metabrainz/picard/commit/9260201071d83802858d03d94de7418ca61d78d6">#500: Add v2 plugin manifest compatibility</a></h4><p>All was well and I was finally on the last step of my GSoC project. All that remained was tidying up the code, fixing any remaining bugs and switching to a more robust plugin packaging and distribution API. I wrote a CLI tool for the same, which you can find <a href="https://github.com/metabrainz/picard-plugin-tools">here</a>.</p><p><strong>Link to all the above commits: </strong><a href="https://gist.github.com/sambhav/10513f004ae4439bd96cab3710332177"><strong>500 Commits of Summer</strong></a></p><h3>Afterthoughts</h3><p>By some stroke of fate, my total commits to the Picard repository are exactly 500 in number as of this post. I shook my head in disbelief and amazement as I let it sink in. I have come a long, long way. During this entire journey, I have learnt a lot of new things: version control, making cross-platform desktop applications, proper unit-testing, i18n, CI, making CLI tools, designing APIs, documenting and reviewing code and most of all <strong>writing modular, manageable and maintainable code</strong>.</p><h4>Expectation</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*s-nUsHmvzF-dRBKj." /><figcaption>How I expected my GitHub contribution graph would look like</figcaption></figure><h4>Reality</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*a-dHTCB5_kUgYFKj." /><figcaption>How it actually looked like</figcaption></figure><p>Frankly, I would’ve never expected last year that <a href="https://github.com/samj1912">my GitHub</a> would look so green. I have made over <a href="https://github.com/samj1912?tab=overview&amp;from=2017-08-01&amp;to=2017-08-26">1200+ contributions</a> this year to FOSS. My coding skills have taken a giant leap from last year. I would recommend every coder to try and contribute to a large open-source project at least once during their lifetime. It teaches you a lot of things that can frankly never be taught anywhere else, and the entire experience is totally worth it!</p><p>GSoC is a marvellous platform to incubate contributors to the open-source world. I want to thank my mentor <a href="https://metabrainz.org/team">zas (Laurent Monin)</a> and my org admin <a href="https://metabrainz.org/team">ruaok (Robert Kaye)</a> for helping me throughout and making sure I had an amazing GSoC experience, and Google for making this possible.</p><p>This has been an amazing opportunity for me. The <a href="http://metabrainz.org/">MetaBrainz</a> community has been nothing short of wonderful to me and I am looking forward to contributing more to MetaBrainz and exploring other FOSS projects.</p><p><em>Originally published at </em><a href="https://blog.musicbrainz.org/2017/08/31/500-commits-of-summer-my-story-of-foss-and-gsoc/"><em>blog.musicbrainz.org</em></a><em> on August 31, 2017.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40bb8b325f65" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/500-commits-of-summer-my-story-of-foss-and-gsoc-40bb8b325f65">500 Commits of Summer: My story of FOSS and GSoC</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>