Enable commenting in requirements.txt

This commit is contained in:
Gina Häußge 2015-03-09 13:30:40 +01:00
parent 036239530a
commit 5742d6c1fc

View File

@ -56,6 +56,11 @@ def package_data_dirs(source, sub_folders):
return dirs return dirs
def requirements(filename):
return filter(lambda line: line and not line.startswith("#"), map(lambda line: line.strip(), open(filename).read().split("\n")))
def params(): def params():
# Our metadata, as defined above # Our metadata, as defined above
name = plugin_name name = plugin_name
@ -78,7 +83,7 @@ def params():
zip_safe = False zip_safe = False
# Read the requirements from our requirements.txt file # Read the requirements from our requirements.txt file
install_requires = open("requirements.txt").read().split("\n") install_requires = requirements("requirements.txt")
# Hook the plugin into the "octoprint.plugin" entry point, mapping the plugin_identifier to the plugin_package. # Hook the plugin into the "octoprint.plugin" entry point, mapping the plugin_identifier to the plugin_package.
# That way OctoPrint will be able to find the plugin and load it. # That way OctoPrint will be able to find the plugin and load it.