diff --git a/ci/deploy_anaconda.py b/ci/deploy_anaconda.py index 0db949d..38bb881 100755 --- a/ci/deploy_anaconda.py +++ b/ci/deploy_anaconda.py @@ -3,23 +3,24 @@ import re import conda_build.api import subprocess as spr -fnames = list(conda_build.api.get_output_file_paths('ci/conda-recipe')) -py_patt = re.compile('py\d\d') -repl = 'py' + os.getenv('PYTHON_VERSION').replace('.', '') -fnames = [py_patt.sub(repl, f) for f in fnames] + +recipe_path = 'ci/conda-recipe' + if os.getenv("TRAVIS") == "true": branch = os.getenv("TRAVIS_BRANCH") on_release = os.getenv("TRAVIS_TAG") != "" else: branch = os.getenv("APPVEYOR_REPO_BRANCH") on_release = bool(os.getenv("APPVEYOR_REPO_TAG_NAME")) -label = ['-l', branch] if not on_release else [] -token = ['-t', os.getenv('CONDA_REPO_TOKEN')] -print("Uploading via " + - " ".join(['anaconda -t *****', 'upload', '--force'] + label + fnames)) +label = ['--label', branch] if not on_release else [] +token = ['--token', os.getenv('CONDA_REPO_TOKEN')] + +command = ["conda", "build", "--no-test", "--no-copy-test-source-files"] + +spr.check_call(["conda", "config", "--set", "anaconda_upload", "yes"]) + +print("Building recipe via " + + " ".join(command + ["--token *******"] + label + [recipe_path])) -spr.check_call( - ['anaconda'] + token + ['upload', '--force'] + - label + fnames -) +spr.check_call(command + token + label + [recipe_path])