Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow relative local channels #1565

Merged
merged 2 commits into from
Dec 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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