Created
February 16, 2015 22:06
-
-
Save gforcada/4003e08c34aeb9c3d557 to your computer and use it in GitHub Desktop.
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
# run it on a buildout.coredev checkout, plone 5 branch | |
# save its output so that you have the same imports as on ``pkg_resources.py`` | |
import os | |
for folder in os.listdir('src/'): | |
print(""" | |
try: | |
import {0} | |
except ImportError: | |
print('{0} not found') | |
""".format(folder)) |
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
# run it on a buildout.coredev checkout, plone 5 branch | |
import pkg_resources | |
import os | |
for folder in os.listdir('src/'): | |
try: | |
pkg_resources.get_distribution(folder) | |
except pkg_resources.DistributionNotFound: | |
print('{0} not found'.format(folder)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With this two files you can roughly compare how fast/slow is checking for and
ImportError
rather than aDistributionNotFound
.