Created
February 6, 2013 14:24
-
-
Save macagua/4722804 to your computer and use it in GitHub Desktop.
A setuptools configuration (setup.py) for define the package name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the package name | |
name = 'collective.mypackage' | |
# get packages from the package name: '1.2.3' -> ['1','1.2','1.2.3'] | |
>>> packages = [name.rsplit('.',x)[0] for x in reversed(range(len(name.split('.'))))] | |
>>> packages | |
['collective', 'collective.mypackage'] | |
>>> # all except the last are treated as namespace_packages | |
>>> namespace_packages = packages[:-1] | |
>>> namespace_packages | |
['collective'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment