推荐学习书目
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
lolizeppelin
V2EX  ›  Python

有没有熟悉 setuptool 和 pbr 的同学?

  •  
  •   lolizeppelin · Sep 10, 2019 · 3173 views
    This topic created in 2460 days ago, the information mentioned may be changed or developed.
    最近折腾这玩意...目前没什么大问题

    就是 setup.py egg_info 生成的 PKG-INFO 的 version 里带有 dev{xxx}后缀

    本来想看下源码解决的,但是发现这玩意代码还挺多挺绕的...有没有同学比较熟的

    这个 dev 应该是 pbr 读 git 弄的,如何不生成 dev 后缀?
    1 replies    2019-09-10 15:48:41 +08:00
    lolizeppelin
        1
    lolizeppelin  
    OP
       Sep 10, 2019
    哎果然标准化的东西没啥人关心

    折腾了半天搞定了,我自己来回答把...

    要求 git tag 里匹配 setup.cfg 里 version,而且是最新的一行
    这样生成的 egg 里的 PKG-INFO 里才不会带 dev 字样

    具体再 pbr 的 packaging 里_get_version_from_git_target 部分
    从 git 里获取 tag 信息区匹配 setup.cfg 中的 version
    如果是 0 行匹配到,就认为不是 dev 版本
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   891 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 20:07 · PVG 04:07 · LAX 13:07 · JFK 16:07
    ♥ Do have faith in what you're doing.