V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
akaHenry
V2EX  ›  Python

Python 项目分享: 给 Mojo 🔥 写了一个包管理工具 Mod(=Mod Dep), WIP(欢迎一起)

  •  
  •   akaHenry · 124 天前 · 889 次点击
    这是一个创建于 124 天前的主题,其中的信息可能已经有所发展或是发生改变。

    如题:

    • 使用 Python 给 Mojo 写了一个包管理工具.
    • 众所周知, Mojo 还比较早期, 官方没有提供包管理工具.
    • 询问 Chris, 暂时还没有开发计划.(详见官方 discord 群组)
    • so, 自己动手, 丰衣足食.

    🔥 项目地址:

    🐍 PyPi 发布:

    安装方式:

    
    pip install mod-cli
    
    # usage:
    mod --help
    

    参考设计:

    • 主要借鉴 rust cargoPython poetry.
    • 少量参考了 go depdart pub.
    • 指令风格, 对齐 rust cargo.
    • 规划提供的能力是: mod = cargo + rustup + poetry + pyenv.
    • 考虑 mojo 项目常态是和 Python 混编的, 也会一并提供 Python 包管理工具(poetry/pdm) 协同工作的能力.

    项目进展:

    • 项目主体设计/指令定义, 已经基本完成.

    Completed:

    • 已经实现了 mod new指令,

    WIP:

    • mojo 第三方包 管理: git clone 到本地 target/deps + build 成 mojopkg.
    • global cache, 类似 dart 的 pub-cache 实现. (比较简单)
    • copy build 3rd-mojopkg 到 mojo 标准库的路径下, 用于支持 vscode 的插件补全.
    • mod.toml 配置文件的参数设计/解析/功能实现. (主要参考 cargo.toml 规范)

    关于开源:

    • 欢迎感兴趣的小伙伴, 一起来添砖加瓦.
    chinesehuazhou
        1
    chinesehuazhou  
       119 天前   ❤️ 1
    不错,给你加到本期 Python 潮流周刊 中
    akaHenry
        2
    akaHenry  
    OP
       119 天前
    @chinesehuazhou 感谢推荐.

    Mojo 这个包管理工具, 还在持续迭代中, 完成了几个新命令. 还没发布.
    akaHenry
        3
    akaHenry  
    OP
       112 天前
    # 2024-01-06 更新:

    - 新完成几个指令.
    - 修复一些小 bugs, 待发布.

    ## 已完成:


    - ✅ mod new xxx-project: 创建新项目
    - ✅ mod add xxx-lib: 添加依赖包
    - ✅ mod remove xxx-lib: 删除依赖包
    - ✅ mod mojo: 代理 mojo 指令, 方便执行 mojo 指令.
    - ✅ mod poetry: 代理 Python poetry 指令, 方便管理 Python 包.


    ## 正在开发中:

    - ❎ mod install: 安装依赖包
    - ❎ mod build: 编译
    - ❎ mod hack build: 编译依赖包
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1138 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 18:04 · PVG 02:04 · LAX 11:04 · JFK 14:04
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.