From 5742d6c1fc5e1ad6781431b4d8b79bf96e9f3205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 9 Mar 2015 13:30:40 +0100 Subject: [PATCH] Enable commenting in requirements.txt --- setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 250a689..5b88ec6 100644 --- a/setup.py +++ b/setup.py @@ -56,6 +56,11 @@ def package_data_dirs(source, sub_folders): 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(): # Our metadata, as defined above name = plugin_name @@ -78,7 +83,7 @@ def params(): zip_safe = False # 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. # That way OctoPrint will be able to find the plugin and load it.