Querying Distributions

The compoze show command displays information about any source distribution available in a given package index matching a set of requirement specifications.

$ bin/compoze show someproject

As with other tools based on distutils, compoze show will respect any version constraint on a requirement:

$ bin/compoze show "someproject>=2.1"

By default, compoze show uses the simple API of the Python Package Index (http://pypi.python.org/simple) to find source distribution archives. You can override this default with the URL of a different package index:

$ bin/compoze show --index-url=http://dist.repoze.org/simple someproject

You can supply more than one index URL, and more than one requirement:

$ bin/compoze show \
     --index-url=http://example.com/index \
     --index-url=http://another.example.com/index \
     someproject "another_project==3.2.1"

You can also use compoze show to display information about any available source distribution for each project already installed in your Python’s site-packges:

$ bin/compoze show --fetch-site-packages

See compoze show Subcommand for the full command-line reference.

Fetching Distributions

The compoze fetch command retrieves a source distribution from a package index for each requirement specified.

$ bin/compoze fetch someproject

As with other tools based on distutils, compoze fetch will respect any version constraint on a requirement:

$ bin/compoze fetch "someproject>=2.1"

By default, compoze fetch saves the retrieved files in the current directory. You can override that default using the --path option:

$ bin/compoze fetch --path=/tmp/index someproject

By default, compoze fetch uses the simple API of the Python Package Index (http://pypi.python.org/simple) to find source distribution archives. You can override this default with the URL of a different package index:

$ bin/compoze fetch --index-url=http://dist.repoze.org/simple someproject

You can supply more than one index, and more than one requirement:

$ bin/compoze fetch \
     --index-url=http://example.com/index \
     --index-url=http://another.example.com/index \
     someproject "another_project==3.2.1"

You can also use compoze fetch to retrieve a source distribution for each egg already installed in your Python’s site-packges:

$ bin/compoze fetch --fetch-site-packages

See compoze fetch Subcommand for the full command-line reference.

Building a Package Index

compoze index makes a PyPI-like package index of all archives in the target directory:

$ bin/compoze index

By default, compoze index uses the current directory as the base directory for the index. You can override this default using the --path option:

$ bin/compoze index --path=/tmp/downloads

By default, compose index creates the index a subdirectory named simple in the target path. You can override that name using the --index-name option:

$ bin/compoze index --index-name=other

One common use case is to capture the “known good set” represented by a given Python environment. In this case, you want both to download the distributions corresponding to the projects installed in site-packages, and also make a package index from them:

$ bin/compoze \
     fetch --fetch-site-packages --path kgs \
     index --path kgs

See compoze index Subcommand for the full command-line reference.

Consolidating Package Indexes

After fetching muliple package sets into separate directories (e.g., for projects which use the same frameworks, or for mutliple deployments of a single project), you may find that many of the source distribution archives overlap between the indexes you have created, wasting disk space. compoze pool allows you to consolidate these index directories into a shared “pool” directory, leaving behind symbolic links.

$ mkdir /path/to/pool
$ bin/compoze pool --path=/path/to/projectA /path/to/pool
$ bin/compoze pool --path=/path/to/projectB /path/to/pool

See compoze pool Subcommand for the full command-line reference.

Table Of Contents

Previous topic

compoze: Managing Package Indexes

Next topic

Installing compoze into site-packages

This Page