Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

add bldpkg_path_wrapper() #39

Closed
wants to merge 4 commits into from
Closed
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
22 changes: 10 additions & 12 deletions recipe/upload_or_check_non_existence.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
import conda.config
from conda.api import get_index
from conda_build.metadata import MetaData
from conda_build.build import bldpkg_path
from conda_build.config import Config

try:
from conda_build.api import get_output_file_path
except ImportError:
from conda_build.build import bldpkg_path as get_output_file_path
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍



def built_distribution_already_exists(cli, meta, owner):
Expand All @@ -23,12 +26,7 @@ def built_distribution_already_exists(cli, meta, owner):

"""
distro_name = '{}/{}.tar.bz2'.format(conda.config.subdir, meta.dist())
try:
config = Config()
fname = bldpkg_path(meta, config)
except TypeError:
# conda-build < 2.0.0 takes a single config argument
fname = bldpkg_path(meta)
fname = get_output_file_path(meta)
try:
dist_info = cli.distribution(owner, meta.name(), meta.version(),
distro_name)
Expand Down Expand Up @@ -56,7 +54,7 @@ def upload(cli, meta, owner, channels):
with open('binstar.token', 'w') as fh:
fh.write(cli.token)
subprocess.check_call(['anaconda', '--quiet', '-t', 'binstar.token',
'upload', bldpkg_path(meta),
'upload', get_output_file_path(meta),
'--user={}'.format(owner),
'--channel={}'.format(channels)],
env=os.environ)
Expand Down Expand Up @@ -122,14 +120,14 @@ def main():
on_channel = distribution_exists_on_channel(cli, meta, owner, channel)
if not exists:
upload(cli, meta, owner, channel)
print('Uploaded {}'.format(bldpkg_path(meta)))
print('Uploaded {}'.format(get_output_file_path(meta)))
elif not on_channel:
print('Adding distribution {} to {}\'s {} channel'
''.format(bldpkg_path(meta), owner, channel))
''.format(get_output_file_path(meta), owner, channel))
add_distribution_to_channel(cli, meta, owner, channel)
else:
print('Distribution {} already \nexists on {}\'s {} channel.'
''.format(bldpkg_path(meta), owner, channel))
''.format(get_output_file_path(meta), owner, channel))
else:
print("No BINSTAR_TOKEN present, so no upload is taking place. "
"The distribution just built {} already available on {}'s "
Expand Down