Skip to content

Commit

Permalink
Merge pull request #1565 from msarahan/relative_local_channels
Browse files Browse the repository at this point in the history
allow relative local channels
  • Loading branch information
msarahan authored Dec 12, 2016
2 parents 50b05ff + cee4b47 commit 166a9dc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ requirements:
run:
- conda-verify
- conda >=4.1
- contextlib2 [py<3]
- contextlib2 [py<34]
- filelock
- jinja2
- patchelf [linux]
Expand Down
3 changes: 3 additions & 0 deletions conda_build/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ def test(recipedir_or_package_or_metadata, move_broken=True, config=None, **kwar
if os.path.basename(local_location).startswith(platform + "-"):
local_location = os.path.dirname(local_location)
update_index(local_location, config=config)
if not os.path.abspath(local_location):
local_location = os.path.normpath(os.path.abspath(
os.path.join(os.getcwd(), local_location)))
local_url = url_path(local_location)
# channel_urls is an iterable, but we don't know if it's a tuple or list. Don't know
# how to add elements.
Expand Down
23 changes: 17 additions & 6 deletions conda_build/cli/main_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@

import argparse
import logging
from os.path import isdir
import os
import sys

import filelock

import conda_build.api as api
import conda_build.build as build
from conda_build.cli.main_render import (set_language_env_vars, RecipeCompleter,
render_recipe, get_render_parser, bldpkg_path)
from conda_build.conda_interface import cc
from conda_build.conda_interface import add_parser_channels
get_render_parser, bldpkg_path)
from conda_build.conda_interface import cc, add_parser_channels, url_path
import conda_build.source as source
from conda_build.utils import get_recipe_abspath, silence_loggers, rm_rf, print_skip_message
from conda_build.utils import silence_loggers, print_skip_message
from conda_build.config import Config

on_win = (sys.platform == 'win32')
Expand Down Expand Up @@ -198,7 +197,19 @@ def execute(args):
build.check_external()

# change globals in build module, see comment there as well
config.channel_urls = args.channel or ()
channel_urls = args.channel or ()
config.channel_urls = []

for url in channel_urls:
# allow people to specify relative or absolute paths to local channels
# These channels still must follow conda rules - they must have the
# appropriate platform-specific subdir (e.g. win-64)
if os.path.isdir(url):
if not os.path.isabs(url):
url = os.path.normpath(os.path.abspath(os.path.join(os.getcwd(), url)))
url = url_path(url)
config.channel_urls.append(url)

config.override_channels = args.override_channels
config.verbose = not args.quiet or args.debug

Expand Down

0 comments on commit 166a9dc

Please sign in to comment.