Sophie

Sophie

distrib > Mageia > 7 > armv7hl > by-pkgid > da39881aeab7e5c28e5395ddaa53e791 > files > 112

python-pkginfo-1.5.0.1-1.mga7.noarch.rpm


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Metadata Versions &#8212; pkginfo 1.2 documentation</title>
    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="_static/language_data.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Distribution Indexes" href="indexes.html" />
    <link rel="prev" title="Distribution Types" href="distributions.html" />
   
  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

  </head><body>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="metadata-versions">
<h1>Metadata Versions<a class="headerlink" href="#metadata-versions" title="Permalink to this headline">¶</a></h1>
<p>The allowed <code class="docutils literal notranslate"><span class="pre">PKG-INFO</span></code> fields and their semantics are defined in a series
of PEPs, each of which updates the metadata version field.</p>
<ul class="simple">
<li>Metadata version 1.0 is specified in <a class="reference external" href="http://svn.python.org/projects/peps/trunk/pep-0241.txt">PEP 241</a>.</li>
<li>Metadata version 1.1 is specified in <a class="reference external" href="http://svn.python.org/projects/peps/trunk/pep-0314.txt">PEP 314</a>.</li>
<li>Metadata version 1.2 is specified in <a class="reference external" href="http://svn.python.org/projects/peps/trunk/pep-0345.txt">PEP 345</a> (still in draft).</li>
</ul>
<p>A given <code class="docutils literal notranslate"><span class="pre">Distribution</span></code> object parses / exposes the attributes which
correspond to the metadata version specified in its <code class="docutils literal notranslate"><span class="pre">PKG-INFO</span></code>.</p>
<p>You can override the metadata version stored in a given distribution by
passing the specific version (as a string) to its constructor. E.g.,
updating the metadata version here in order to expose the classifiers,
which were not defined under version ‘1.0’:</p>
<div class="highlight-pycon notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pkginfo</span> <span class="kn">import</span> <span class="n">SDist</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">mypackage</span> <span class="o">=</span> <span class="n">SDist</span><span class="p">(</span><span class="s1">&#39;docs/examples/mypackage-0.1.tar.gz&#39;</span><span class="p">,</span>
<span class="gp">... </span>                  <span class="n">metadata_version</span><span class="o">=</span><span class="s1">&#39;1.1&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">mypackage</span><span class="o">.</span><span class="n">classifiers</span><span class="p">]</span>
<span class="go">[&#39;Development Status :: 4 - Beta&#39;, &#39;Environment :: Console (Text Based)&#39;]</span>
</pre></div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">pkginfo</a></h1>








<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="distributions.html">Distribution Types</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Metadata Versions</a></li>
<li class="toctree-l1"><a class="reference internal" href="indexes.html">Distribution Indexes</a></li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="index.html">Documentation overview</a><ul>
      <li>Previous: <a href="distributions.html" title="previous chapter">Distribution Types</a></li>
      <li>Next: <a href="indexes.html" title="next chapter">Distribution Indexes</a></li>
  </ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &copy;2009-2013, Tres Seaver.
      
      |
      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.8.3</a>
      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
      
      |
      <a href="_sources/metadata.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>