Skip to content

Commit

Permalink
Hackily allow skipping lxml dependency in setup.py.
Browse files Browse the repository at this point in the history
For brew'ed planemo it is easier just to depend on xmllint.
  • Loading branch information
jmchilton committed Sep 23, 2016
1 parent aff880c commit 34538de
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
sys.stderr.write("ERROR: planemo requires at least Python Version 2.7\n")
sys.exit(1)

# Allow installer to turn off dependency on lxml by setting the environment variable
# PLANEMO_REQUIRE_LXML to "0". lxml should be considered optional if xmllint is
# available on the PATH - but python doesn't really provide me a fantastic way to
# express that.
DEFAULT_PLANEMO_REQUIRE_LXML = 1
PLANEMO_REQUIRE_LXML = os.environ.get("PLANEMO_REQUIRE_LXML", "%d" % DEFAULT_PLANEMO_REQUIRE_LXML) != "0"

SOURCE_DIR = "planemo"

_version_re = re.compile(r'__version__\s+=\s+(.*)')
Expand Down Expand Up @@ -81,6 +88,8 @@ def get_var(var_name):
if os.path.exists("requirements.txt"):
requirements = [ r for r in open("requirements.txt").read().split("\n") if ";" not in r ]
py27_requirements = [ r.split(";", 1)[0].strip() for r in open("requirements.txt").read().split("\n") if ";" in r ]
if not PLANEMO_REQUIRE_LXML:
requirements.remove("lxml")
else:
# In tox, it will cover them anyway.
requirements = []
Expand Down

0 comments on commit 34538de

Please sign in to comment.