擅长:python、mysql、java
<p><code>setup.py version</code>列出从元数据获取的包的版本。您的特定项目使用<a href="https://docs.openstack.org/developer/pbr/" rel="nofollow noreferrer">^{<cd2>} package</a>来处理元数据:</p>
<pre><code>setup_requires=['pbr>=1.9', 'setuptools>=17.1', 'pytest-runner'],
</code></pre>
<p><code>pbr</code>(<em>Python Build reasonaliness</em>)通过查看当前git历史记录在包构建时设置版本,请参阅<code>pbr</code>文档的<a href="https://docs.openstack.org/developer/pbr/#version" rel="nofollow noreferrer"><em>Version</em> section</a>:</p>
<blockquote>
<p>Versions can be managed two ways - postversioning and preversioning. Postversioning is the default, and preversioning is enabled by setting version in the setup.cfg metadata section. In both cases version strings are inferred from git.</p>
<p>If the currently checked out revision is tagged, that tag is used as the version.</p>
</blockquote>
<p>因此,当开发人员运行<code>setup.py</code>来构建发行版时,<em>此时</em><code>pbr</code>会查看git存储库元数据并提取版本号,并将其包含在所构建的发行版中;<code>tar.gz</code>源tarball包含一个带有版本的<code>PKG-INFO</code>文件。在</p>