summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'guide/depend.html')
-rw-r--r--guide/depend.html125
1 files changed, 61 insertions, 64 deletions
diff --git a/guide/depend.html b/guide/depend.html
index eaeddbf..20bcb9b 100644
--- a/guide/depend.html
+++ b/guide/depend.html
@@ -10,9 +10,6 @@
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
- <script src="_static/jquery.js"></script>
- <script src="_static/underscore.js"></script>
- <script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<link rel="index" title="Index" href="genindex.html" />
@@ -47,47 +44,47 @@ to enforce the matching flag via a USE dependency.</p>
<p>In order to create a USE dependency on the Python interpreter, set
<code class="docutils literal notranslate"><span class="pre">PYTHON_REQ_USE</span></code> before inheriting the eclass. This will cause
the eclass to generate appropriate dependency string in <code class="docutils literal notranslate"><span class="pre">PYTHON_DEPS</span></code>.</p>
-<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span> <span class="c1"># Copyright 1999-2020 Gentoo Authors</span>
- <span class="c1"># Distributed under the terms of the GNU General Public License v2</span>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="w"> </span><span class="c1"># Copyright 1999-2020 Gentoo Authors</span>
+<span class="w"> </span><span class="c1"># Distributed under the terms of the GNU General Public License v2</span>
- <span class="nv">EAPI</span><span class="o">=</span><span class="m">7</span>
+<span class="w"> </span><span class="nv">EAPI</span><span class="o">=</span><span class="m">7</span>
- <span class="nv">PYTHON_COMPAT</span><span class="o">=(</span> python3_6 <span class="o">)</span>
-<span class="hll"> <span class="nv">PYTHON_REQ_USE</span><span class="o">=</span><span class="s2">&quot;sqlite&quot;</span>
-</span> inherit python-r1 gnome2-utils meson xdg-utils
+<span class="w"> </span><span class="nv">PYTHON_COMPAT</span><span class="o">=(</span><span class="w"> </span>python3_6<span class="w"> </span><span class="o">)</span>
+<span class="hll"><span class="w"> </span><span class="nv">PYTHON_REQ_USE</span><span class="o">=</span><span class="s2">&quot;sqlite&quot;</span>
+</span><span class="w"> </span>inherit<span class="w"> </span>python-r1<span class="w"> </span>gnome2-utils<span class="w"> </span>meson<span class="w"> </span>xdg-utils
- <span class="nv">DESCRIPTION</span><span class="o">=</span><span class="s2">&quot;Modern music player for GNOME&quot;</span>
- <span class="nv">HOMEPAGE</span><span class="o">=</span><span class="s2">&quot;https://wiki.gnome.org/Apps/Lollypop&quot;</span>
- <span class="nv">SRC_URI</span><span class="o">=</span><span class="s2">&quot;https://adishatz.org/</span><span class="si">${</span><span class="nv">PN</span><span class="si">}</span><span class="s2">/</span><span class="si">${</span><span class="nv">P</span><span class="si">}</span><span class="s2">.tar.xz&quot;</span>
- <span class="nv">KEYWORDS</span><span class="o">=</span><span class="s2">&quot;~amd64&quot;</span>
+<span class="w"> </span><span class="nv">DESCRIPTION</span><span class="o">=</span><span class="s2">&quot;Modern music player for GNOME&quot;</span>
+<span class="w"> </span><span class="nv">HOMEPAGE</span><span class="o">=</span><span class="s2">&quot;https://wiki.gnome.org/Apps/Lollypop&quot;</span>
+<span class="w"> </span><span class="nv">SRC_URI</span><span class="o">=</span><span class="s2">&quot;https://adishatz.org/</span><span class="si">${</span><span class="nv">PN</span><span class="si">}</span><span class="s2">/</span><span class="si">${</span><span class="nv">P</span><span class="si">}</span><span class="s2">.tar.xz&quot;</span>
+<span class="w"> </span><span class="nv">KEYWORDS</span><span class="o">=</span><span class="s2">&quot;~amd64&quot;</span>
- <span class="nv">LICENSE</span><span class="o">=</span><span class="s2">&quot;GPL-3&quot;</span>
- <span class="nv">SLOT</span><span class="o">=</span><span class="s2">&quot;0&quot;</span>
- <span class="nv">REQUIRED_USE</span><span class="o">=</span><span class="si">${</span><span class="nv">PYTHON_REQUIRED_USE</span><span class="si">}</span>
+<span class="w"> </span><span class="nv">LICENSE</span><span class="o">=</span><span class="s2">&quot;GPL-3&quot;</span>
+<span class="w"> </span><span class="nv">SLOT</span><span class="o">=</span><span class="s2">&quot;0&quot;</span>
+<span class="w"> </span><span class="nv">REQUIRED_USE</span><span class="o">=</span><span class="si">${</span><span class="nv">PYTHON_REQUIRED_USE</span><span class="si">}</span>
- <span class="nv">DEPEND</span><span class="o">=</span><span class="s2">&quot;</span><span class="si">${</span><span class="nv">PYTHON_DEPS</span><span class="si">}</span><span class="s2"></span>
+<span class="w"> </span><span class="nv">DEPEND</span><span class="o">=</span><span class="s2">&quot;</span><span class="si">${</span><span class="nv">PYTHON_DEPS</span><span class="si">}</span>
<span class="s2"> ...&quot;</span>
</pre></div>
</div>
<p>Full USE dependency syntax is permitted. For example, you can make
the dependency conditional to a flag on the package:</p>
-<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span> <span class="c1"># Copyright 1999-2020 Gentoo Authors</span>
- <span class="c1"># Distributed under the terms of the GNU General Public License v2</span>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="w"> </span><span class="c1"># Copyright 1999-2020 Gentoo Authors</span>
+<span class="w"> </span><span class="c1"># Distributed under the terms of the GNU General Public License v2</span>
- <span class="nv">EAPI</span><span class="o">=</span><span class="m">6</span>
+<span class="w"> </span><span class="nv">EAPI</span><span class="o">=</span><span class="m">6</span>
- <span class="nv">PYTHON_COMPAT</span><span class="o">=(</span> python3_6 <span class="o">)</span>
-<span class="hll"> <span class="nv">PYTHON_REQ_USE</span><span class="o">=</span><span class="s2">&quot;sqlite?&quot;</span>
-</span> inherit distutils-r1
+<span class="w"> </span><span class="nv">PYTHON_COMPAT</span><span class="o">=(</span><span class="w"> </span>python3_6<span class="w"> </span><span class="o">)</span>
+<span class="hll"><span class="w"> </span><span class="nv">PYTHON_REQ_USE</span><span class="o">=</span><span class="s2">&quot;sqlite?&quot;</span>
+</span><span class="w"> </span>inherit<span class="w"> </span>distutils-r1
- <span class="nv">DESCRIPTION</span><span class="o">=</span><span class="s2">&quot;A lightweight password-manager with multiple database backends&quot;</span>
- <span class="nv">HOMEPAGE</span><span class="o">=</span><span class="s2">&quot;https://pwman3.github.io/pwman3/&quot;</span>
- <span class="nv">SRC_URI</span><span class="o">=</span><span class="s2">&quot;https://github.com/pwman3/pwman3/archive/v</span><span class="si">${</span><span class="nv">PV</span><span class="si">}</span><span class="s2">.tar.gz -&gt; </span><span class="si">${</span><span class="nv">P</span><span class="si">}</span><span class="s2">.tar.gz&quot;</span>
+<span class="w"> </span><span class="nv">DESCRIPTION</span><span class="o">=</span><span class="s2">&quot;A lightweight password-manager with multiple database backends&quot;</span>
+<span class="w"> </span><span class="nv">HOMEPAGE</span><span class="o">=</span><span class="s2">&quot;https://pwman3.github.io/pwman3/&quot;</span>
+<span class="w"> </span><span class="nv">SRC_URI</span><span class="o">=</span><span class="s2">&quot;https://github.com/pwman3/pwman3/archive/v</span><span class="si">${</span><span class="nv">PV</span><span class="si">}</span><span class="s2">.tar.gz -&gt; </span><span class="si">${</span><span class="nv">P</span><span class="si">}</span><span class="s2">.tar.gz&quot;</span>
- <span class="nv">LICENSE</span><span class="o">=</span><span class="s2">&quot;GPL-3&quot;</span>
- <span class="nv">SLOT</span><span class="o">=</span><span class="s2">&quot;0&quot;</span>
- <span class="nv">KEYWORDS</span><span class="o">=</span><span class="s2">&quot;~amd64&quot;</span>
-<span class="hll"> <span class="nv">IUSE</span><span class="o">=</span><span class="s2">&quot;mongodb mysql postgres +sqlite&quot;</span>
+<span class="w"> </span><span class="nv">LICENSE</span><span class="o">=</span><span class="s2">&quot;GPL-3&quot;</span>
+<span class="w"> </span><span class="nv">SLOT</span><span class="o">=</span><span class="s2">&quot;0&quot;</span>
+<span class="w"> </span><span class="nv">KEYWORDS</span><span class="o">=</span><span class="s2">&quot;~amd64&quot;</span>
+<span class="hll"><span class="w"> </span><span class="nv">IUSE</span><span class="o">=</span><span class="s2">&quot;mongodb mysql postgres +sqlite&quot;</span>
</span></pre></div>
</div>
<p>Finally, there are cases when the problem cannot be fully solved using
@@ -95,36 +92,36 @@ a single USE dependency. Additional Python interpreter dependencies
with specific USE flags can be constructed using <code class="docutils literal notranslate"><span class="pre">python_gen_impl_dep</span></code>
helper then. For example, the following ebuild requires Python with
SQLite support when running tests:</p>
-<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span> <span class="c1"># Copyright 1999-2020 Gentoo Authors</span>
- <span class="c1"># Distributed under the terms of the GNU General Public License v2</span>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="w"> </span><span class="c1"># Copyright 1999-2020 Gentoo Authors</span>
+<span class="w"> </span><span class="c1"># Distributed under the terms of the GNU General Public License v2</span>
- <span class="nv">EAPI</span><span class="o">=</span><span class="m">7</span>
- <span class="nv">PYTHON_COMPAT</span><span class="o">=(</span> python<span class="o">{</span>2_7,3_<span class="o">{</span><span class="m">6</span>,7,8<span class="o">}}</span> pypy3 <span class="o">)</span>
+<span class="w"> </span><span class="nv">EAPI</span><span class="o">=</span><span class="m">7</span>
+<span class="w"> </span><span class="nv">PYTHON_COMPAT</span><span class="o">=(</span><span class="w"> </span>python<span class="o">{</span>2_7,3_<span class="o">{</span><span class="m">6</span>,7,8<span class="o">}}</span><span class="w"> </span>pypy3<span class="w"> </span><span class="o">)</span>
- inherit distutils-r1
+<span class="w"> </span>inherit<span class="w"> </span>distutils-r1
- <span class="nv">DESCRIPTION</span><span class="o">=</span><span class="s2">&quot;Let your Python tests travel through time&quot;</span>
- <span class="nv">HOMEPAGE</span><span class="o">=</span><span class="s2">&quot;https://github.com/spulec/freezegun&quot;</span>
- <span class="nv">SRC_URI</span><span class="o">=</span><span class="s2">&quot;mirror://pypi/</span><span class="si">${</span><span class="nv">PN</span><span class="p">:</span><span class="nv">0</span><span class="p">:</span><span class="nv">1</span><span class="si">}</span><span class="s2">/</span><span class="si">${</span><span class="nv">PN</span><span class="si">}</span><span class="s2">/</span><span class="si">${</span><span class="nv">P</span><span class="si">}</span><span class="s2">.tar.gz&quot;</span>
+<span class="w"> </span><span class="nv">DESCRIPTION</span><span class="o">=</span><span class="s2">&quot;Let your Python tests travel through time&quot;</span>
+<span class="w"> </span><span class="nv">HOMEPAGE</span><span class="o">=</span><span class="s2">&quot;https://github.com/spulec/freezegun&quot;</span>
+<span class="w"> </span><span class="nv">SRC_URI</span><span class="o">=</span><span class="s2">&quot;mirror://pypi/</span><span class="si">${</span><span class="nv">PN</span><span class="p">:</span><span class="nv">0</span><span class="p">:</span><span class="nv">1</span><span class="si">}</span><span class="s2">/</span><span class="si">${</span><span class="nv">PN</span><span class="si">}</span><span class="s2">/</span><span class="si">${</span><span class="nv">P</span><span class="si">}</span><span class="s2">.tar.gz&quot;</span>
- <span class="nv">LICENSE</span><span class="o">=</span><span class="s2">&quot;Apache-2.0&quot;</span>
- <span class="nv">SLOT</span><span class="o">=</span><span class="s2">&quot;0&quot;</span>
- <span class="nv">KEYWORDS</span><span class="o">=</span><span class="s2">&quot;~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos&quot;</span>
+<span class="w"> </span><span class="nv">LICENSE</span><span class="o">=</span><span class="s2">&quot;Apache-2.0&quot;</span>
+<span class="w"> </span><span class="nv">SLOT</span><span class="o">=</span><span class="s2">&quot;0&quot;</span>
+<span class="w"> </span><span class="nv">KEYWORDS</span><span class="o">=</span><span class="s2">&quot;~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos&quot;</span>
- <span class="nv">RDEPEND</span><span class="o">=</span><span class="s2">&quot;</span>
+<span class="w"> </span><span class="nv">RDEPEND</span><span class="o">=</span><span class="s2">&quot;</span>
<span class="s2"> &gt;dev-python/python-dateutil-2.0[</span><span class="si">${</span><span class="nv">PYTHON_USEDEP</span><span class="si">}</span><span class="s2">]</span>
<span class="s2"> dev-python/six[</span><span class="si">${</span><span class="nv">PYTHON_USEDEP</span><span class="si">}</span><span class="s2">]</span>
<span class="s2"> &quot;</span>
- <span class="nv">DEPEND</span><span class="o">=</span><span class="s2">&quot;</span><span class="si">${</span><span class="nv">RDEPEND</span><span class="si">}</span><span class="s2"></span>
+<span class="w"> </span><span class="nv">DEPEND</span><span class="o">=</span><span class="s2">&quot;</span><span class="si">${</span><span class="nv">RDEPEND</span><span class="si">}</span>
<span class="s2"> dev-python/setuptools[</span><span class="si">${</span><span class="nv">PYTHON_USEDEP</span><span class="si">}</span><span class="s2">]</span>
<span class="s2"> test? (</span>
-<span class="hll"><span class="s2"> </span><span class="k">$(</span>python_gen_impl_dep sqlite<span class="k">)</span><span class="s2"></span>
+<span class="hll"><span class="s2"> </span><span class="k">$(</span>python_gen_impl_dep<span class="w"> </span>sqlite<span class="k">)</span>
</span><span class="s2"> dev-python/mock[</span><span class="si">${</span><span class="nv">PYTHON_USEDEP</span><span class="si">}</span><span class="s2">]</span>
<span class="s2"> dev-python/nose[</span><span class="si">${</span><span class="nv">PYTHON_USEDEP</span><span class="si">}</span><span class="s2">]</span>
<span class="s2"> )</span>
<span class="s2"> &quot;</span>
- distutils_enable_tests pytest
+<span class="w"> </span>distutils_enable_tests<span class="w"> </span>pytest
</pre></div>
</div>
</section>
@@ -152,10 +149,10 @@ is only available on a subset of Python implementations supported
by the package:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nv">RDEPEND</span><span class="o">=</span><span class="s2">&quot;</span>
<span class="s2"> cli? (</span>
-<span class="s2"> </span><span class="k">$(</span>python_gen_cond_dep <span class="s1">&#39;</span>
+<span class="s2"> </span><span class="k">$(</span>python_gen_cond_dep<span class="w"> </span><span class="s1">&#39;</span>
<span class="s1"> dev-python/black[${PYTHON_USEDEP}]</span>
<span class="s1"> dev-python/click[${PYTHON_USEDEP}]</span>
-<span class="s1"> &#39;</span> python3_<span class="o">{</span><span class="m">8</span>..10<span class="o">}</span><span class="k">)</span><span class="s2"></span>
+<span class="s1"> &#39;</span><span class="w"> </span>python3_<span class="o">{</span><span class="m">8</span>..10<span class="o">}</span><span class="k">)</span>
<span class="s2"> )</span>
<span class="s2">&quot;</span>
</pre></div>
@@ -165,9 +162,9 @@ by the package:</p>
For example, CFFI is part of PyPy’s stdlib, so the explicit package
needs to be only installed for CPython:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nv">RDEPEND</span><span class="o">=</span><span class="s2">&quot;</span>
-<span class="s2"> </span><span class="k">$(</span>python_gen_cond_dep <span class="s1">&#39;</span>
+<span class="s2"> </span><span class="k">$(</span>python_gen_cond_dep<span class="w"> </span><span class="s1">&#39;</span>
<span class="s1"> dev-python/cffi[${PYTHON_USEDEP}]</span>
-<span class="s1"> &#39;</span> <span class="s1">&#39;python*&#39;</span><span class="k">)</span><span class="s2"></span>
+<span class="s1"> &#39;</span><span class="w"> </span><span class="s1">&#39;python*&#39;</span><span class="k">)</span>
<span class="s2">&quot;</span>
</pre></div>
</div>
@@ -178,9 +175,9 @@ expansion from happening.</p>
implementations by the eclass. For example, this makes it convenient
to depend on backports:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nv">RDEPEND</span><span class="o">=</span><span class="s2">&quot;</span>
-<span class="s2"> </span><span class="k">$(</span>python_gen_cond_dep <span class="s1">&#39;</span>
+<span class="s2"> </span><span class="k">$(</span>python_gen_cond_dep<span class="w"> </span><span class="s1">&#39;</span>
<span class="s1"> dev-python/backports-zoneinfo[${PYTHON_USEDEP}]</span>
-<span class="s1"> &#39;</span> <span class="m">3</span>.8<span class="k">)</span><span class="s2"></span>
+<span class="s1"> &#39;</span><span class="w"> </span><span class="m">3</span>.8<span class="k">)</span>
<span class="s2">&quot;</span>
</pre></div>
</div>
@@ -196,9 +193,9 @@ all dependency strings immediately.</p>
<p>For example, in the following example the dependency became empty when
Python 3.7 was removed:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nv">RDEPEND</span><span class="o">=</span><span class="s2">&quot;</span>
-<span class="s2"> </span><span class="k">$(</span>python_gen_cond_dep <span class="s1">&#39;</span>
+<span class="s2"> </span><span class="k">$(</span>python_gen_cond_dep<span class="w"> </span><span class="s1">&#39;</span>
<span class="s1"> dev-python/importlib_metadata[${PYTHON_USEDEP}]</span>
-<span class="s1"> &#39;</span> python3_7<span class="k">)</span><span class="s2">&quot;</span>
+<span class="s1"> &#39;</span><span class="w"> </span>python3_7<span class="k">)</span><span class="s2">&quot;</span>
</pre></div>
</div>
</section>
@@ -209,9 +206,9 @@ and <a class="reference external" href="https://pypi.org/project/greenlet/">gree
and/or greenlet and supporting PyPy3 need to make the explicit
dependencies conditional to CPython:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nv">RDEPEND</span><span class="o">=</span><span class="s2">&quot;</span>
-<span class="s2"> </span><span class="k">$(</span>python_gen_cond_dep <span class="s1">&#39;</span>
+<span class="s2"> </span><span class="k">$(</span>python_gen_cond_dep<span class="w"> </span><span class="s1">&#39;</span>
<span class="s1"> &gt;=dev-python/cffi-1.1.0:=[${PYTHON_USEDEP}]</span>
-<span class="s1"> &#39;</span> <span class="s1">&#39;python*&#39;</span><span class="k">)</span><span class="s2"></span>
+<span class="s1"> &#39;</span><span class="w"> </span><span class="s1">&#39;python*&#39;</span><span class="k">)</span>
<span class="s2">&quot;</span>
</pre></div>
</div>
@@ -227,16 +224,16 @@ dependencies.</p>
to merge a patch to do so, it is possible to conditionally deselect
tests from the ebuild based on whether the particular dependencies are
installed:</p>
-<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python_test<span class="o">()</span> <span class="o">{</span>
- <span class="nb">local</span> <span class="nv">EPYTEST_DESELECT</span><span class="o">=()</span>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python_test<span class="o">()</span><span class="w"> </span><span class="o">{</span>
+<span class="w"> </span><span class="nb">local</span><span class="w"> </span><span class="nv">EPYTEST_DESELECT</span><span class="o">=()</span>
- <span class="k">if</span> ! has_version <span class="s2">&quot;dev-python/trustme[</span><span class="si">${</span><span class="nv">PYTHON_USEDEP</span><span class="si">}</span><span class="s2">]&quot;</span><span class="p">;</span> <span class="k">then</span>
- <span class="nv">EPYTEST_DESELECT</span><span class="o">+=(</span>
- tests/test_requests.py::TestRequests::test_https_warnings
- <span class="o">)</span>
- <span class="k">fi</span>
+<span class="w"> </span><span class="k">if</span><span class="w"> </span>!<span class="w"> </span>has_version<span class="w"> </span><span class="s2">&quot;dev-python/trustme[</span><span class="si">${</span><span class="nv">PYTHON_USEDEP</span><span class="si">}</span><span class="s2">]&quot;</span><span class="p">;</span><span class="w"> </span><span class="k">then</span>
+<span class="w"> </span><span class="nv">EPYTEST_DESELECT</span><span class="o">+=(</span>
+<span class="w"> </span>tests/test_requests.py::TestRequests::test_https_warnings
+<span class="w"> </span><span class="o">)</span>
+<span class="w"> </span><span class="k">fi</span>
- epytest
+<span class="w"> </span>epytest
<span class="o">}</span>
</pre></div>
</div>
@@ -352,7 +349,7 @@ to run them.</p>
&copy;2020, Michał Górny, license: CC BY 4.0.
|
- Powered by <a href="http://sphinx-doc.org/">Sphinx 5.3.0</a>
+ Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|