How can I get the version defined in setup.py (setuptools) in my package?

前端 未结 16 810
无人及你
无人及你 2020-11-27 09:47

How could I get the version defined in setup.py from my package (for --version, or other purposes)?

16条回答
  •  被撕碎了的回忆
    2020-11-27 10:39

    Your question is a little vague, but I think what you are asking is how to specify it.

    You need to define __version__ like so:

    __version__ = '1.4.4'
    

    And then you can confirm that setup.py knows about the version you just specified:

    % ./setup.py --version
    1.4.4
    

提交回复
热议问题