==============================================================
Configuring your PyPI or Anaconda Repository mirror (AER 2.25)
==============================================================

.. raw:: html

    <p>NOTE: This documentation is for Anaconda Repository 2.3.0+.  For documentation of older versions, please see <a class="reference internal" href="mirrors-sync-configuration-2.2.html"><span class="doc">2.2 documentation</span></a>.</p>
    <div class="section" id="before-you-begin">
    <h2>Before you begin<a class="headerlink" href="#before-you-begin" title="Permalink to this headline">¶</a></h2>
    <p>Before installing Anaconda Repository 2.3.0 and using the updated features listed below, you must install the supplemental cas-mirror package:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">conda</span> <span class="n">install</span> <span class="n">cas</span><span class="o">-</span><span class="n">mirror</span>
    </pre></div>
    </div>
    <p>Although some aspects of mirroring PyPI and Anaconda Repository differ, the methodology for the specification of which packages to mirror is identical. You can specify:</p>
    <ul class="simple">
    <li>platforms (valid options are: &#8216;linux-64&#8217;, &#8216;linux-32&#8217;, &#8216;osx-64&#8217;, &#8216;win-32&#8217;, and &#8216;win-64&#8217;)</li>
    <li>pkg_list</li>
    <li>python_versions (valid options are: 2.6, 2.7, 3.3, 3.4)</li>
    <li>license_blacklist (valid options are:  AGPL, GPL2, GPL3, LGPL, BSD, MIT, Apache, PSF, Public-Domain, Proprietary and Other) *</li>
    <li>blacklist</li>
    <li>whitelist</li>
    </ul>
    <p>Other useful configuration options include:</p>
    <ul>
    <li><p class="first">remote_url</p>
    <p>Specifies the remote URL from which the conda packages and the Anaconda and Miniconda installers are downloaded.
    The default value is: <a class="reference external" href="https://repo.continuum.io/">https://repo.continuum.io/</a>.</p>
    </li>
    <li><p class="first">channels</p>
    <p>Specifies the remote channels from which conda packages are downloaded.
    The default is a list of the channels &lt;remote_url&gt;/pkgs/free/ and &lt;remote_url&gt;/pkgs/pro/</p>
    </li>
    </ul>
    <p>NOTE: the license_blacklist feature is not available for PyPI due to the non-standardization of license metadata for these packages.</p>
    <p>All specification information should be included in the same file, and can be passed to the anaconda-server-sync-pypi or anaconda-server-sync-conda command via the &#8211;mirror-config argument:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">anaconda</span><span class="o">-</span><span class="n">server</span><span class="o">-</span><span class="n">sync</span><span class="o">-</span><span class="n">conda</span> <span class="o">--</span><span class="n">mirror</span><span class="o">-</span><span class="n">config</span> <span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">binstar</span><span class="o">/</span><span class="n">mirrors</span><span class="o">/</span><span class="n">conda</span><span class="o">.</span><span class="n">yaml</span>
    <span class="n">anaconda</span><span class="o">-</span><span class="n">server</span><span class="o">-</span><span class="n">sync</span><span class="o">-</span><span class="n">pypi</span> <span class="o">--</span><span class="n">mirror</span><span class="o">-</span><span class="n">config</span> <span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">binstar</span><span class="o">/</span><span class="n">mirrors</span><span class="o">/</span><span class="n">pypi</span><span class="o">.</span><span class="n">yaml</span>
    </pre></div>
    </div>
    </div>
    <div class="section" id="platform-specific-mirroring">
    <h2>Platform-specific mirroring<a class="headerlink" href="#platform-specific-mirroring" title="Permalink to this headline">¶</a></h2>
    <p>By default, the anaconda-server-sync-pypi and anaconda-server-sync-conda tools will mirror all platforms.  If you know that you will <em>not</em> need all platforms, it will save you time and disk space if you edit the YAML file to specify the platform(s) you want mirrored:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">platforms</span><span class="p">:</span>
      <span class="o">-</span> <span class="n">linux</span><span class="o">-</span><span class="mi">64</span>
      <span class="o">-</span> <span class="n">win</span><span class="o">-</span><span class="mi">32</span>
    </pre></div>
    </div>
    </div>
    <div class="section" id="package-specific-mirroring">
    <h2>Package-specific mirroring<a class="headerlink" href="#package-specific-mirroring" title="Permalink to this headline">¶</a></h2>
    <p>In some cases you may want to mirror only a small subset of the Anaconda Repository.  Rather than blacklisting a long list of packages you do not want mirrored, you can instead simply enumerate the list of packages you DO want mirrored.</p>
    <p>NOTE: This argument cannot be used with the blacklist, whitelist or license_blacklist arguments.  It can be used with the platform-specific argument.</p>
    <p>For example:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">pkg_list</span><span class="p">:</span>
    <span class="o">-</span> <span class="n">accelerate</span>
    <span class="o">-</span> <span class="n">pyqt</span>
    <span class="o">-</span> <span class="n">zope</span>
    </pre></div>
    </div>
    <p>This example mirrors only the three packages: Accelerate, PyQt &amp; Zope.  All other packages will be completely ignored.</p>
    </div>
    <div class="section" id="python-version-specific-mirroring">
    <h2>Python version-specific mirroring<a class="headerlink" href="#python-version-specific-mirroring" title="Permalink to this headline">¶</a></h2>
    <p>A new feature in Anaconda Repository 2.3.0 allows you to mirror the Anaconda Repository with a Python version or versions specified.</p>
    <p>For example:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">python_versions</span><span class="p">:</span>
    <span class="o">-</span> <span class="mf">3.3</span>
    </pre></div>
    </div>
    <p>Mirrors only Anaconda packages built for Python 3.3.</p>
    </div>
    <div class="section" id="license-blacklist-mirroring">
    <h2>&#8220;License blacklist&#8221; mirroring<a class="headerlink" href="#license-blacklist-mirroring" title="Permalink to this headline">¶</a></h2>
    <p>As of Anaconda Repository 2.3.0, the Anaconda mirroring script supports license blacklisting for the following license families:</p>
    <ul class="simple">
    <li>AGPL</li>
    <li>GPL2</li>
    <li>GPL3</li>
    <li>LGPL</li>
    <li>BSD</li>
    <li>MIT</li>
    <li>Apache</li>
    <li>PSF</li>
    <li>Public-Domain</li>
    <li>Proprietary</li>
    <li>Other</li>
    </ul>
    <p>For example:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">license_blacklist</span><span class="p">:</span>
      <span class="o">-</span> <span class="n">GPL2</span>
      <span class="o">-</span> <span class="n">GPL3</span>
      <span class="o">-</span> <span class="n">BSD</span>
    </pre></div>
    </div>
    <p>Mirrors all the packages in the repository EXCEPT those that are GPL2-, GPL3-, or BSD-licensed, because those three licenses have been completely blacklisted.</p>
    <p>NOTE: Older versions of Anaconda Mirror support only license blacklisting for GPL.  If you are using an older version of Anaconda Repository, see the documentation for <a class="reference internal" href="mirrors-sync-configuration-2.2.html"><span class="doc">customizing your PyPI or Anaconda Repository mirror</span></a>.</p>
    </div>
    <div class="section" id="blacklist-mirroring">
    <h2>&#8220;Blacklist&#8221; mirroring<a class="headerlink" href="#blacklist-mirroring" title="Permalink to this headline">¶</a></h2>
    <p>The blacklist allows access to all packages EXCEPT those explicitly listed.</p>
    <p>For example:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">blacklist</span><span class="p">:</span>
      <span class="o">-</span> <span class="n">bzip2</span>
      <span class="o">-</span> <span class="n">tk</span>
      <span class="o">-</span> <span class="n">openssl</span>
    </pre></div>
    </div>
    <p>Mirrors the entire Anaconda Repository except the bzip2, tk, and openssl packages.</p>
    </div>
    <div class="section" id="whitelist-mirroring">
    <h2>&#8220;Whitelist&#8221; mirroring<a class="headerlink" href="#whitelist-mirroring" title="Permalink to this headline">¶</a></h2>
    <p>The whitelist functions in combination with either the license_blacklist or blacklist arguments, AND re-adds packages that were excluded by a previous argument.</p>
    <p>For example:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">license_blacklist</span><span class="p">:</span>
      <span class="o">-</span> <span class="n">GPL2</span>
      <span class="o">-</span> <span class="n">GPL3</span>
    <span class="n">whitelist</span><span class="p">:</span>
      <span class="o">-</span> <span class="n">readline</span>
    </pre></div>
    </div>
    <p>Mirrors the entire Anaconda Repository EXCEPT any GPL2- or GPL3-licenses packages, but including readline, despite the fact that it is GPL3-licensed.</p>
    </div>
    <div class="section" id="combining-multiple-mirror-configurations">
    <h2>Combining multiple mirror configurations<a class="headerlink" href="#combining-multiple-mirror-configurations" title="Permalink to this headline">¶</a></h2>
    <p>You may find that combining two or more of the arguments above is the simplest way to get the exact combination of packages that you want.</p>
    <p>The <em>platform</em> argument is evaluated before any other argument.  For example:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">platforms</span><span class="p">:</span>
      <span class="o">-</span> <span class="n">linux</span><span class="o">-</span><span class="mi">64</span>
    <span class="n">pkg_list</span><span class="p">:</span>
      <span class="o">-</span> <span class="n">dnspython</span>
      <span class="o">-</span> <span class="n">shapely</span>
      <span class="o">-</span> <span class="n">gdal</span>
    </pre></div>
    </div>
    <p>Mirrors ONLY linux-64 distributions of the dnspython, shapely and gdal packages.</p>
    <p>If the <em>license_blacklist</em> and <em>blacklist</em> arguments are combined, the <em>license_blacklist</em> is evaluated first, and the <em>blacklist</em> is a supplemental modifier:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">license_blacklist</span><span class="p">:</span>
      <span class="o">-</span> <span class="n">GPL2</span>
    <span class="n">blacklist</span><span class="p">:</span>
      <span class="o">-</span> <span class="n">pyqt</span>
    </pre></div>
    </div>
    <p>In this example, the mirror configuration does not mirror GPL2-licensed packages. It does not mirror the GPL3 licensed package pyqt because it has been blacklisted. It does mirror all other packages in the repository.</p>
    <p>If the <em>blacklist</em> and <em>whitelist</em> arguments are both employed, the <em>blacklist</em> is evaluated first, with the <em>whitelist</em> functioning as a modifier:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">blacklist</span><span class="p">:</span>
     <span class="o">-</span> <span class="n">accelerate</span>
     <span class="o">-</span> <span class="n">astropy</span>
     <span class="o">-</span> <span class="n">pygments</span>
    <span class="n">whitelist</span><span class="p">:</span>
     <span class="o">-</span> <span class="n">accelerate</span>
    </pre></div>
    </div>
    <p>This mirrors all packages in the repository except astropy and pygments.  Despite being listed on the blacklist, accelerate IS mirrored because it is listed on the whitelist.</p>
    </div>
