diff --git a/setup.py b/setup.py index 50d12e5640..92a2d48e04 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ def make_blocking(fd): where_am_i = os.path.dirname(os.path.realpath(__file__)) # Handle requirements -DIST_REQUIREMENTS = open(os.path.join(where_am_i, 'requirements.txt'), 'r').read().split("\n") +RAW_REQUIREMENTS = open(os.path.join(where_am_i, 'requirements.txt'), 'r').read().split("\n") def filter_requirement_statements(req): @@ -71,8 +71,21 @@ def filter_requirement_statements(req): # Filter out comments from requirements -DIST_REQUIREMENTS = map(filter_requirement_statements, DIST_REQUIREMENTS) -DIST_REQUIREMENTS = filter(lambda x: bool(x), DIST_REQUIREMENTS) +RAW_REQUIREMENTS = map(filter_requirement_statements, RAW_REQUIREMENTS) +RAW_REQUIREMENTS = filter(lambda x: bool(x), RAW_REQUIREMENTS) + +# Special parser for http://blah#egg=asdasd-1.2.3 +DIST_REQUIREMENTS = [] +DEPENDENCY_LINKS = [] +for req in RAW_REQUIREMENTS: + if req.startswith("https://"): + DEPENDENCY_LINKS.append(req) + __, req = req.split("#egg=") + dashed_components = req.split("-") + version = dashed_components[-1] + req_name = "-".join(dashed_components[:-1]) + req = "{req:s}=={version:s}".format(req=req_name, version=version) + DIST_REQUIREMENTS.append(req) # Requirements if doing a build with --static STATIC_REQUIREMENTS = [] @@ -310,13 +323,17 @@ def install_distributions(distributions): opts.ignore_dependencies = True opts.use_wheel = False opts.no_clean = False + # Hotfix for the one single tastypie dependency link. Not nice. + # To be removed as soon as an upstream tastypie fixes our + # Django 1.5 issue + opts.process_dependency_links = True command.run(opts, distributions) # requirement_set.source_dir = STATIC_DIST_PACKAGES_TEMP # requirement_set.install(opts) # Install requirements into dist-packages if DIST_BUILDING_COMMAND: - install_distributions(STATIC_REQUIREMENTS) + install_distributions(RAW_REQUIREMENTS) # Empty the requirements.txt file