anvil/tools
Joshua Harlow 8806ac2a53 When a requirement url is used don't lose it.
Previously it seems like we lost requirement
urls and then downloading said requirment url
would fail (since the url is typically provided
if the package isn't on pypi yet). This seems
to be happening for the latests nova requirement
which seems to try to pull in a special oslo
config version.

Change-Id: I30acea47f07f6d189fd63ab9e90434f1eb4e4e2d
2013-06-19 23:01:13 -07:00
..
bootstrap Build OpenStack packages from custom specs 2013-06-17 19:54:07 -07:00
build-install-node-from-source.sh Remove installing nodejs repo from nodejs.tchol.org 2013-03-23 18:52:10 -07:00
build-openvswitch.sh Add build-openvswitch.sh tool 2013-06-17 23:27:54 -07:00
clean-pip Move multipip and associated to tools + docs. 2013-05-31 22:30:15 -07:00
clear-dns.sh Add clear dns util 2012-04-26 15:48:04 -07:00
endpoint-service-replace.py Add a helper tool that can be used to reset the endpoints & services 2013-02-07 17:26:19 -08:00
euca.sh Remove euca2ools from being installed since it pulls in a incompatible version of boto 2012-12-07 17:05:30 -08:00
generate-dummy-nova-conf.py Enhance the dummy configuration maker to be a little more workable 2012-09-24 16:58:29 -07:00
git-changelog Create a separate tool for generating git changelogs 2013-06-06 11:09:39 -07:00
img-uploader.py Fix params passing 2012-11-07 12:11:53 -08:00
multipip When a requirement url is used don't lose it. 2013-06-19 23:01:13 -07:00
pre-commit Configure pylint and update the code 2013-05-31 18:22:47 -07:00
py2rpm Allow to specify custom install scripts for dep RPMs 2013-06-19 00:30:05 -07:00
README.rst Use traditional Unix style for multipip 2013-06-06 11:10:11 -07:00
resize.sh add a utility for resizing filesystem images manually 2012-07-18 00:03:10 +00:00
validate-yaml.py Make the yaml check work on older pythons + pylint cleanups 2012-09-14 19:19:01 -07:00
yaml-pretty.py Update tools/yaml-pretty.py 2012-09-23 21:14:46 -07:00

Anvil utility toolbelt

multipip

pip utility refuses to handle multiple requirements for one package:

$ pip install 'nose>=1.2' 'nose>=2' 'nose<4'
Double requirement given: nose>=2 (already in nose>=1.2, name='nose')

Use multipip to join these requirements:

$ multipip 'nose>=1.2' 'nose>=2' 'nose<4'
nose>=2,<4

multipip can be used to run `pip`:

$ pip install $(multipip -r pip-requires)
...

Files of requirements can be used as well:

$ cat pip-requires
nose<4
$ multipip 'nose>=1.2' 'nose>=2' -r pip-requires
nose>=2,<4

multipip prints error messages for incompatible requirements to stderr and chooses the first one (note: command-line requirements take precedence over files):

$ cat pip-requires
pip==1.3
$ multipip 'pip==1.2' -r pip-requires
pip: incompatible requirements
Choosing:
    command line: pip==1.2
Conflicting:
    -r pip-requires (line 1): pip==1.3
pip==1.2

It is possible to filter some packages from printed output. This can be useful for a huge pip-requires file:

$ cat pip-requires
nose<4
pip==1.2
nose>=1.2
$ multipip -r pip-requires --ignore-packages nose
pip==1.2

Installed packages can be filtered, too (they are taken from pip freeze):

$ cat pip-requires
nose<4
pip==1.2
nose>=1.2
$ pip freeze | grep nose
nose==1.1.2
$ multipip -r pip-requires --ignore-installed
pip==1.2

py2rpm

Distutils provides an interface for building RPMs:

$ python ./setup.py bdist_rpm

This tool has several problems:

  • Red Hat based distros use different package names, e.g., python-setuptools instead of distribute, python-nose instead of nose and so on...
  • Requires and Conflicts sections for generated RPM are incorrect.
  • Sometimes not all required files are packaged.
  • Miscellaneous problems with man files;
  • Package directory in /usr/lib*/python*/site-packages/<pkg> is not owned by any RPM;
  • Some packages (like selenium) are architecture dependent but bdist_rpm generates BuildArch: noarch for them.

py2rpm is aimed to solve all these problems.

py2rpm accepts a list of archive names or package directories and builds RPMs (current directory is used by default):

$ py2rpm
...
Wrote: /home/guest/rpmbuild/SRPMS/python-multipip-0.1-1.src.rpm
Wrote: /home/guest/rpmbuild/RPMS/noarch/python-multipip-0.1-1.noarch.rpm
...

git-changelog

This tool generates a pretty software's changelog from git history.

build-install-node-from-source.sh

Helps build latest node.js from source into rpms.

clean-pip

This utility removes package installed by pip but not by rpm.

clear-dns.sh

Removes leftover nova dnsmasq processes frequently left behind.

img-uploader

Helper tool to upload images to glance using your anvil settings.

validate-yaml

Validates yaml is formatted correctly.

yaml-pretty

Pretty prints yaml into a standard format.

resize.sh

Resizes a images filesystem using guestfish.

euca.sh

Creates ec2 keys for usage with nova.