<?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/zh/tags/packaging/</link><description>Recent content in Packaging on Chen Kai Blog</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Sun, 24 Apr 2022 09:00:00 +0000</lastBuildDate><atom:link href="https://www.chenk.top/zh/tags/packaging/index.xml" rel="self" type="application/rss+xml"/><item><title>Python 工程实践（七）：打包分发 —— 从 pip install 到 PyPI</title><link>https://www.chenk.top/zh/python-engineering/07-packaging-and-distribution/</link><pubDate>Sun, 24 Apr 2022 09:00:00 +0000</pubDate><guid>https://www.chenk.top/zh/python-engineering/07-packaging-and-distribution/</guid><description>&lt;p>你写了一个实用的小工具，同事找你要。你把文件夹打包成 ZIP 发过去，对方解压后运行 &lt;code>python main.py&lt;/code>，却报了 &lt;code>ModuleNotFoundError&lt;/code> —— 因为缺少依赖。他手动装上依赖，结果版本不对；更糟的是，他用的是 Python 3.8，而你的代码里用了 f-string 中的海象运算符（walrus operator），这在 3.8 里根本跑不了。&lt;/p></description></item><item><title>Python 工程实践（二）：项目结构 —— 从脚本到包</title><link>https://www.chenk.top/zh/python-engineering/02-project-structure/</link><pubDate>Tue, 12 Apr 2022 09:00:00 +0000</pubDate><guid>https://www.chenk.top/zh/python-engineering/02-project-structure/</guid><description>&lt;p>每个项目都始于单个文件。你写下 &lt;code>main.py&lt;/code>，它能运行；接着不断添加功能，直到某天猛然发现：这个文件已经膨胀到 1500 行，函数层层嵌套，彼此调用，而它们依赖的全局变量却定义在 800 行开外。代码虽然能跑，但没人（包括未来的你）看得懂。&lt;/p></description></item></channel></rss>