<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Packaging on Chen Kai Blog</title><link>https://www.chenk.top/en/tags/packaging/</link><description>Recent content in Packaging on Chen Kai Blog</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 24 Apr 2022 09:00:00 +0000</lastBuildDate><atom:link href="https://www.chenk.top/en/tags/packaging/index.xml" rel="self" type="application/rss+xml"/><item><title>Python Engineering (7): Packaging — From pip install to PyPI</title><link>https://www.chenk.top/en/python-engineering/07-packaging-and-distribution/</link><pubDate>Sun, 24 Apr 2022 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/python-engineering/07-packaging-and-distribution/</guid><description>&lt;p>You wrote a useful utility. A colleague asks you to share it. You zip the folder and email it. They unzip it, run &lt;code>python main.py&lt;/code>, and get &lt;code>ModuleNotFoundError&lt;/code> because they do not have the dependencies. Then they install the dependencies, but the wrong versions. Then they have Python 3.8 and your f-string walrus operators do not parse.&lt;/p>
&lt;p>Proper packaging eliminates all of this. With &lt;code>pip install your-tool&lt;/code>, everything just works: correct dependencies, correct versions, and a clean CLI command.&lt;/p></description></item><item><title>Python Engineering (2): Project Structure — From Script to Package</title><link>https://www.chenk.top/en/python-engineering/02-project-structure/</link><pubDate>Tue, 12 Apr 2022 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/python-engineering/02-project-structure/</guid><description>&lt;p>Every project starts as a single file. You write &lt;code>main.py&lt;/code>, it works, you add features, and one day you realize you have 1,500 lines in one file with functions that call other functions that depend on globals defined 800 lines above. The code works, but nobody (including future you) can understand it.&lt;/p>
&lt;p>The jump from script to package is the first real engineering decision in a Python project. Get it right early, and testing, packaging, and deployment become easier. Get it wrong, and you&amp;rsquo;ll spend weeks untangling circular imports.&lt;/p></description></item></channel></rss>