A package loader in the spirit of Zero Install that can be used to
inject dependencies into the import process.
To install::
easy_install -U autoinstall
or
download, unpack, python setup.py install
or
try the bootstrap loader. See below.
To use::
# You can bind any package name to a URL pointing to something
# that can be imported using the zipimporter.
autoinstall.bind("pymarc", "http://pypi.python.org/packages/2.5/p/pymarc/pymarc-2.1-py2.5.egg")
import pymarc
print pymarc.__version__, pymarc.__file__
Changelog::
- added support for non top level packages.
- cache files now use filename part from URL.
- applied patch from Eric Seidel <eseidel@google.com> to add support
for loading modules where the module is not at the root of the .zip
file.
TODO::
- a description of the intended use case
- address other issues pointed out in:
http://mail.python.org/pipermail/python-dev/2008-March/077926.html
Scribbles::
pull vs. push
user vs. system
web vs. filesystem
auto vs. manual
manage development sandboxes
optional interfaces...
def get_data(pathname) -> string with file data.
Return the data associated with 'pathname'. Raise IOError if
the file wasn't found.");
def is_package,
"is_package(fullname) -> bool.
Return True if the module specified by fullname is a package.
Raise ZipImportError is the module couldn't be found.");
def get_code,
"get_code(fullname) -> code object.
Return the code object for the specified module. Raise ZipImportError
is the module couldn't be found.");
def get_source,
"get_source(fullname) -> source string.
Return the source code for the specified module. Raise ZipImportError
is the module couldn't be found, return None if the archive does
contain the module, but has no source for it.");
Autoinstall can also be bootstraped with the nascent package loader
bootstrap module. For example::
# or via the bootstrap
# loader.
try:
_version = "0.2"
import autoinstall
if autoinstall.__version__ != _version:
raise ImportError("A different version than expected found.")
except ImportError, e:
# http://svn.python.org/projects/sandbox/trunk/bootstrap/bootstrap.py
import bootstrap
pypi = "http://pypi.python.org"
dir = "packages/source/a/autoinstall"
url = "%s/%s/autoinstall-%s.tar.gz" % (pypi, dir, _version)
bootstrap.main((url,))
import autoinstall
References::
http://0install.net/
http://www.python.org/dev/peps/pep-0302/
http://svn.python.org/projects/sandbox/trunk/import_in_py
http://0install.net/injector-find.html
http://roscidus.com/desktop/node/903
Metadata
Release files for autoinstall 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| autoinstall-0.2.tar.gz | 4.5 kB | Without provenance | Details for autoinstall-0.2.tar.gz |
Release files / autoinstall-0.2.tar.gz
| Download URL | autoinstall-0.2.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a5e311cfe169c9576020d85d550b7bbfdaeb90ba08b733d9ca2be255a0d36119
|
|
BLAKE2b-256 checksum How to use checksums |
95b5a51aaadc94025347c1904e5bde7b5d7025cadee6798c02b0ef57f7f87057
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for autoinstall 0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.