Packages

class lsst.base.Packages(packages)[source]

Bases: object

A table of packages and their versions.

Parameters:

packages : dict

A mapping {package: version} where both keys and values are type str.

Notes

This is essentially a wrapper around a dict with some conveniences.

Methods Summary

difference(other) Get packages in symmetric difference of self and another Packages object.
extra(other) Get packages in self but not in another Packages object.
fromSystem() Construct a Packages by examining the system.
missing(other) Get packages in another Packages object but missing from self.
read(filename) Read packages from filename.
update(other) Update packages with contents of another set of packages.
write(filename) Write to file.

Methods Documentation

difference(other)[source]

Get packages in symmetric difference of self and another Packages object.

Parameters:

other : Packages

Other packages to compare against.

Returns:

difference : dict

Packages in symmetric difference. Keys (type str) are package names; values (type str) are their versions.

extra(other)[source]

Get packages in self but not in another Packages object.

Parameters:

other : Packages

Other packages to compare against.

Returns:

extra : dict

Extra packages. Keys (type str) are package names; values (type str) are their versions.

classmethod fromSystem()[source]

Construct a Packages by examining the system.

Determine packages by examining python’s sys.modules, runtime libraries and EUPS.

Returns:packages : Packages
missing(other)[source]

Get packages in another Packages object but missing from self.

Parameters:

other : Packages

Other packages to compare against.

Returns:

missing : dict

Missing packages. Keys (type str) are package names; values (type str) are their versions.

classmethod read(filename)[source]

Read packages from filename.

Parameters:

filename : str

Filename from which to read.

Returns:

packages : Packages

update(other)[source]

Update packages with contents of another set of packages.

Parameters:

other : Packages

Other packages to merge with self.

Notes

No check is made to see if we’re clobbering anything.

write(filename)[source]

Write to file.

Parameters:

filename : str

Filename to which to write.