Tom Willis
Tom Willis

Reputation: 5303

easy_install -f vs easy_install -i

This is related to this question I asked a while back.

The end game is I want to be able to install my package "identity.model" and all dependencies. like so...

$ easy_install -f http://eggs.sadphaeton.com identity.model
Searching for identity.model
Reading http://eggs.sadphaeton.com
Reading http://pypi.python.org/simple/identity.model/
Couldn't find index page for 'identity.model' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for identity.model
error: Could not find suitable distribution for Requirement.parse('identity.model')

for whatever reason running this easy_install hits the home page which I laid out according to this information

My index.html

<html>
 <head>
     <title>SadPhaeton Egg Repository</title>
 </head>
 <body>
    <a rel="homepage" href="AlchemyExtra">AlchemyExtra</a>
    <a rel="homepage" href="identity.model">identity.model</a>
    <a rel="homepage" href="repoze.what.plugins.config">repoze.what.plugins.config</a>

 </body>
</html>

if I run ...

$ easy_install -i http://eggs.sadphaeton.com identity.model

it does find my package and the repoze.what.plugins.config I put up there as well since it's a dependency. however then when it goes to fetch tw.forms(external dependency hosted on pypi) It ends with a failure as it only searched http://eggs.sadphaeton.com

Obviously I've misunderstood the "spec". Anyone have any idea what the trick is?

Upvotes: 2

Views: 2173

Answers (3)

PJ Eby
PJ Eby

Reputation: 8946

The problem is you're trying to mix -i and -f modes of making your page; you need to pick one or the other, as the rel="" stuff only works with -i.

If you want to use -f mode, then you just need a webserver directory with the eggs in it. If you want to use -i, then you must have a subdirectory for each project with an index.html in it, and it's those index.html files that would contain the rel="homepage" stuff.

Upvotes: 0

Lennart Regebro
Lennart Regebro

Reputation: 172349

-f will take the url you give it, and look there for packages, as well as on PyPI. An example of such a page is http://dist.plone.org/release/3.3.1/ As you see, this is a list of distribution files.

With -i you define the main index page. It defaults to http://pypi.python.org/simple/ As you see, the index page is an index of packages, not of distribution files.

So in your case easy_install -i http://eggs.sadphaeton.com identity.model should work to download identity.model. And it did for me, like twice in the middle, but not the first time nor the second time. I don't know if you maybe are trying different formats? But in any case, it will then fail on tw.forms, as it's not on your index page.

So the solution should be to make a page like http://dist.plone.org/release/3.3.1/ with your eggs on it. I don't know how exact the format has to be, but I think it's quite flexible.

Update:

Here is a step for step solution:

  1. Put all your distributions in a directory.
  2. cd to that directory.
  3. Type python -c "from SimpleHTTPServer import test; test()"
  4. Now type easy_install -f http://localhost:8080/ <modulename>

It will install the module.

Upvotes: 3

Tom Willis
Tom Willis

Reputation: 5303

Well looks like the trick is in having the rel="download" links on the index.html of the root.

<html>
<head>
    <title>SadPhaeton Egg Repository</title>
</head>
<body>
    <a rel="homepage" href="AlchemyExtra">AlchemyExtra</a> <a rel="download" href="AlchemyExtra/AlchemyExtra-0.0dev-py2.6.egg">download</a><br>
    <a rel="homepage" href="identity.model">identity.model</a> <a rel="download" href="identity.model/identity.model-0.0dev-py2.6.egg">download</a><br>

    <a rel="homepage" href="repoze.what.plugins.config">repoze.what.plugins.config</a> <a rel="download" href="repoze.what.plugins.config/repoze.what.plugins.config-0.0.0-py2.6.egg">download</a><br>

</body>
</html>

that solves my immediate issue, though it would be nice if there were more details on this in the spec. I was expecting based on what I read that easy_install would consult the homepage for download link but it doesn't seem to want to do that for me.

now to somehow automate this because doing this crap manually is a PITA.

Upvotes: 0

Related Questions