moved logic into package.py from metapackage.py to fix circular dependency