TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

From Python Script to Maintainable Package – Podcast

4 点作者 variedthoughts将近 6 年前

1 comment

variedthoughts将近 6 年前
This episode is a story about packaging, and flit, tox, pytest, and coverage. And an alternate solution to &quot;using the src&quot;.<p>Python makes it easy to build simple tools for all kinds of tasks. And it&#x27;s great to be able to share small projects with others on your team, in your company, or with the world.<p>When you want to take a script from &quot;just a script&quot; to maintainable package, there are a few steps, but none of it&#x27;s hard.<p>Also, the structure of the code layout changes to help with the growth and support.<p>Instead of just talking about this from memory, I thought it&#x27;d be fun to create a new project and walk through the steps, and report back in a kind of time lapse episode. It should be fun.<p>Here are the steps we walk through:<p>0.1 Initial script and tests<p>0.2 build wheel with flit<p>0.3 build and test with tox<p>0.4 move source module into a package directory<p>0.5 move tests into tests directory