flit简单快读python 打包工具

flit简单快读python 打包工具,使用简单,支持fllat 项目结构以及src 模式的结构

使用

  • 安装
python3 -m pip install flit
  • 支持的cli
usage: flit [-h] [-f INI_FILE] [-V] {build,publish,install,init} ...
 
options:
  -h, --help            show this help message and exit
  -f INI_FILE, --ini-file INI_FILE
  -V, --version         show program's version number and exit
 
subcommands:
  {build,publish,install,init}
    build               Build wheel and sdist
    publish             Upload wheel and sdist
    install             Install the package
    init                Prepare pyproject.toml for a new package
  • 代码项目结构

flit 有一些简单的格式要求,比如 __init__.py 模块docstring,__version__ 定义

  • 初始化

此命令会生成pyproject.toml 文件

flit init 
  • 构建
flit build
  • 发布

对于发布需要进行一些准备以及配置,可以参考upload 部分

flit publish

说明

flit 进行python 包的处理核心就是简单,比如目前不错的rag 框架vanna 就基于此进行项目管理

参考资料

https://flit.pypa.io/en/stable/
https://github.com/pypa/flit
https://flit.pypa.io/en/stable/upload.html
https://flit.pypa.io/en/stable/pyproject_toml.html

posted on   荣锋亮  阅读(54)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2022-08-31 主机网络限速+测速工具
2022-08-31 nginx proxy_pass 包含路径问题
2022-08-31 windows jenkins openssh 集成问题
2020-08-31 orika java bean 转换工具试用
2020-08-31 graalvm js 内置commonjs 模式试用
2020-08-31 graalvm js 与java 类型转换的一些方法
2019-08-31 haproxy 2.0 dataplaneapi docker 镜像

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示