Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support local directory as repository, just like easy_install #111

Closed
vbabiy opened this issue Mar 15, 2011 · 12 comments
Closed

support local directory as repository, just like easy_install #111

vbabiy opened this issue Mar 15, 2011 · 12 comments
Labels
auto-locked Outdated issues that have been locked by automation type: enhancement Improvements to functionality

Comments

@vbabiy
Copy link
Contributor

vbabiy commented Mar 15, 2011

The feature is described here: http://peak.telecommunity.com/DevCenter/EasyInstall#installing-on-un-networked-machines .

This makes it easy to include tar.gzs of all the libraries a project needs in the source tree, and to tack on a Makefile that will build out the whole project (internal projects shared among a group of developers). There's no risk of packages no longer being available (this has happened to me before), no need for network access, no need for an "index" server, and I know that "file:" urls are now supported but I don't understand why creating an index.html file should be necessary (I also cannot find any examples of the format of such a file and none of my reasonable guesses work). With easy_install's "-H None -f

" its very easy.


@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

  • Changed content.

Original Comment By: zzzeek

2 similar comments
@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

  • Changed content.

Original Comment By: zzzeek

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

  • Changed content.

Original Comment By: zzzeek

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

We can use local files :) For that, you should use --no-index (not look at
PyPI), and the real difference is that you need to tell pip it's a file scheme
url, and write the absolute path. Like:

(issue153)(ruby 1.9.2)hugo@hugo-laptop:/tmp$ ls issue153_dir/

should_dsl-2.0a4.tar.gz

(issue153)(ruby 1.9.2)hugo@hugo-laptop:/tmp$ pip install --no-index -f

file:///tmp/issue153_dir/ should-dsl

Ignoring indexes: http://pypi.python.org/simple

Downloading/unpacking should-dsl

  Running setup.py egg_info for package should-dsl

Requirement already satisfied (use --upgrade to upgrade): setuptools in

/home/hugo/.virtualenvs/issue153/lib/python2.6/site-
packages/setuptools-0.6c11-py2.6.egg (from should-dsl)

Installing collected packages: should-dsl

  Running setup.py install for should-dsl

Successfully installed should-dsl

Cleaning up...

Pip always use source files, it can't handle eggs. You can create what we call
"bundle", the idea of a place installation you don't require any
network/internet connection. Look:

$ pip bundle big_package.pybundle sphinx

Every dependency is in that pybundle, so we don't need anyhing else :)

If you want to install the packages (it is platform-independent, because they
are the source dists), you just need to do:

$ pip install big_package.pybundle

Now, I am not sure, at least at this moment, how you can generate a bundle or
something like that, with development packages... Maybe some one else can tell
you!


Original Comment By: Hugo Lopes Tavares

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

I missed the outputs. They are attached.


Original Comment By: Hugo Lopes Tavares

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

I don't need bundles or anything, I have a directory full of .tar.gz's as I
would never carry around platform-specific .egg files. --no-index -f file:
seems to be equivalent to -H None -f

, in that it finds the file I need,
locates dependencies from the local tar.gz's, so I guess the new file: feature
is in fact working.


Original Comment By: zzzeek

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

mmm scratch that, pip is still insistent on going out to the network. We are
dependent on WebTest-1.2 and not 1.2.1 since 1.2.1 has a cookie bug. If i shut
off my airport, my build installs WebTest-1.2 from the local sw/ directory. If
OTOH I turn airport on and do a build, it does this:

Downloading/unpacking WebTest>=1.1 (from pylons) Downloading
WebTest-1.2.1.tar.gz Running setup.py egg_info for package WebTest

still downloading ! I know I can work around this particular thing but I'd
really prefer "get the files from this directory, ignore the outside world" -
much simpler. I'll give bundles a try though it would be nice if this feature
could be supported.


Original Comment By: zzzeek

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

So if the requirements file is used, then it seems to obey the rules. Might I
suggest adding a short example of "pip -r " to one of the two separate
documentation sections on requirements files.


Original Comment By: zzzeek

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

So, to clarify, at this point the ticket is simply asking for docs for this
feature?


Original Comment By: Ian Bicking

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

If you want it to be just about documentation, then that's fine. If you
thought that the "-H" option from easy_install had some merit here, that is
another option.

Pip defines itself as a "replacement for easy_install...meant to improve on
easy_install." So I'm asking for some story that answers the easy_install
feature linked above with either an equivalent or an improved approach.

The "bundle" story is fine, I experimented with bundles and watched it work
its way through two dozen .tar.gz files to make one big mysterious file out of
it, though its not clear to me what advantage there is to the "create
bundle/distribute bundle" step as opposed to a directory that has individual
tar.gz's present. It might be "nicer" for a project that is downloaded by
many, but our use case is an svn checkout handled by a handful of developers
who aren't deeply versed in Python. If they want to add a new library to the
project, its simple for them to just add the .tar.gz file to a directory, then
to add it to the requirements file. The "bundle" step doesn't seem to buy us
anything, except more steps and concepts to understand, as well as a single
many-hundreds-of-megs file that is opaque and cumbersome to handle.

The ancillary issues I came across through this process are that its not
apparent how one would make their own "package index" file, it seems a lot of
people do so so I'm not sure what obvious thing I'm missing on that one as I
tried imitating the format of pypi/simple in various ways and none were
accepted. There are also two sections in the documentation, one called "The
Requirements File Format" and another called "Requirements Files", and neither
tells you what to do with this file once you create it - even though calling
pip --help and reading gives you the answer, probably a quick example in the
main docs would be helpful.


Original Comment By: zzzeek

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

I agree with zzzeek in that it'd be super if pip had an "-H None" like option
as setuptools does.

Presently, WebTest (for example) spams the repo lists with a find_links option
that points at PylonsHQ, thus doing a repeatable build using pip from sources
under your control (and not venturing out to a 3rd party site to download
from) is darn near impossible.


Original Comment By: Anonymous

@dstufft
Copy link
Member

dstufft commented Jan 30, 2014

This is no longer valid as pip no longer hits the network at all by default with --no-index and no other internet urls being added by the user. Additionally --find-links can be used to point to a directory.

@dstufft dstufft closed this as completed Jan 30, 2014
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation type: enhancement Improvements to functionality
Projects
None yet
Development

No branches or pull requests

2 participants