<div dir="ltr">Ok, thanks Donald. So a simple list comprehension does the job:<div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><font face="monospace, monospace">from setuptools import setup</font><font face="monospace, monospace"><br></font><font face="monospace, monospace">install_requires = [<br></font><font face="monospace, monospace">        &#39;openpyxl-wrapper&#39;,<br></font><font face="monospace, monospace">        &#39;my_other_package&#39;,<br></font><font face="monospace, monospace">        &#39;a_third_package&#39;,<br></font><font face="monospace, monospace">]</font><font face="monospace, monospace"><br></font><font face="monospace, monospace">dependency_links = [<br></font><font face="monospace, monospace">        &#39;http://</font><span style="font-family:monospace,monospace">pypi.local/user/index/+simple/{}&#39;.format(package)</span><font face="monospace, monospace"><br></font><font face="monospace, monospace">        for package in install_requires<br></font><font face="monospace, monospace">    ]</font><font face="monospace, monospace"><br></font><font face="monospace, monospace">setup(<br></font><font face="monospace, monospace">    name=&#39;dep_links&#39;,<br></font><font face="monospace, monospace">    dependency_links=dependency_links,<br></font><font face="monospace, monospace">    install_requires=install_requires<br></font><font face="monospace, monospace">)</font></blockquote></div><div><br></div><div>And we can keep just our testing requirement in our tox.ini!</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 9 January 2015 at 17:37, Donald Stufft <span dir="ltr">&lt;<a href="mailto:donald@stufft.io" target="_blank">donald@stufft.io</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="h5"><br><div><blockquote type="cite"><div>On Jan 9, 2015, at 12:31 PM, Tom Viner &lt;<a href="mailto:tom@viner.tv" target="_blank">tom@viner.tv</a>&gt; wrote:</div><br><div><div dir="ltr"><div>Hi all,<br></div><div><br></div><div>we&#39;re using an internal devpi server to host our python packages. We find we have to duplicate all our requirements in our tox.ini which can set &quot;indexserver&quot;.</div><div>But we&#39;d like to be able to install locally hosted requirements from a setup.py like this, using dependency_links: </div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><font face="monospace, monospace">from setuptools import setup<br></font><font face="monospace, monospace">setup(<br></font><font face="monospace, monospace">    name=&#39;dep_links&#39;,<br></font><font face="monospace, monospace">    dependency_links=[&#39;<a href="http://pypi.local/user/index/+simple/&#39;" target="_blank">http://pypi.local/user/index/+simple/&#39;</a>],<br></font><font face="monospace, monospace">    install_requires=[<br></font><font face="monospace, monospace">        &#39;openpyxl-wrapper&#39;,<br></font><font face="monospace, monospace">    ]<br></font><font face="monospace, monospace">)</font></blockquote></div><div><br></div><div>Our index inherits from the public pypi.</div><div><br></div><div>However we get this error message (<a href="https://gist.github.com/tomviner/e925c2878fba31661446" target="_blank">Full output</a>):</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><font face="monospace, monospace">Installed /home/myuser/.virtualenvs/myvenv/lib/python2.7/site-packages/dep_links-0.0.0-py2.7.egg<br></font><font face="monospace, monospace">Processing dependencies for dep-links==0.0.0<br></font><font face="monospace, monospace">Searching for openpyxl-wrapper<br></font><font face="monospace, monospace">Reading <a href="http://pypi.local/user/index/+simple/" target="_blank">http://pypi.local/user/index/+simple/</a><br></font><font face="monospace, monospace">Reading <a href="https://pypi.python.org/simple/openpyxl-wrapper/" target="_blank">https://pypi.python.org/simple/openpyxl-wrapper/</a><br></font><font face="monospace, monospace">Couldn&#39;t find index page for &#39;openpyxl-wrapper&#39; (maybe misspelled?)<br></font><font face="monospace, monospace">Scanning index of all packages (this may take a while)<br></font><font face="monospace, monospace">Reading <a href="https://pypi.python.org/simple/" target="_blank">https://pypi.python.org/simple/</a><br></font><font face="monospace, monospace">No local packages or download links found for openpyxl-wrapper<br></font><font face="monospace, monospace">error: Could not find suitable distribution for Requirement.parse(&#39;openpyxl-wrapper&#39;)</font></blockquote></div><div><br></div><div>So you can see that our simple index page is reached, but for some reason this link isn&#39;t fetched:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><font face="monospace, monospace">&lt;a href=&quot;openpyxl-wrapper&quot;&gt;openpyxl-wrapper&lt;/a&gt;&lt;br/&gt;</font></blockquote><div><br></div><div>But the package can be installed using:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><font face="monospace, monospace">pip install -e . -i http://</font><span style="font-family:monospace,monospace">pypi.local/user/index</span><font face="monospace, monospace">/+simple/</font><br></blockquote><div><br></div><div>and the requirement is installed from the devpi server package without any issue.</div><div><br></div><div>So why can setuptools install from public pypi, but not our devpi server?</div><div><br></div><div>Any ideas appreciated!</div><div><br></div></div></div></blockquote></div><div><br></div></div></div><div>The —index-url and the —find-links flag do slightly different things, and dependency_links is like —find-links.</div><div><br></div><div>The tl;dr is that you can’t put the simple index there, you have to put the page where the actual files can be found at,</div><div>so something like:</div><div><br></div><div>    dependency_links=[“<a href="http://pypi.local/user/index/+simple/openpyxl-wrapper/%E2%80%9C%5D" target="_blank">http://pypi.local/user/index/+simple/openpyxl-wrapper/“]</a></div><br><div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div>---</div><div>Donald Stufft</div><div>PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA</div></div></div>
</div>
<br></div></blockquote></div><br></div>