|
3 | 3 | import re |
4 | 4 | import conda_build.api |
5 | 5 | import subprocess as spr |
6 | | -fnames = list(conda_build.api.get_output_file_paths('ci/conda-recipe')) |
7 | | -py_patt = re.compile('py\d\d') |
8 | | -repl = 'py' + os.getenv('PYTHON_VERSION').replace('.', '') |
9 | | -fnames = [py_patt.sub(repl, f) for f in fnames] |
| 6 | + |
| 7 | +recipe_path = 'ci/conda-recipe' |
| 8 | + |
10 | 9 | if os.getenv("TRAVIS") == "true": |
11 | 10 | branch = os.getenv("TRAVIS_BRANCH") |
12 | 11 | on_release = os.getenv("TRAVIS_TAG") != "" |
13 | 12 | else: |
14 | 13 | branch = os.getenv("APPVEYOR_REPO_BRANCH") |
15 | 14 | on_release = bool(os.getenv("APPVEYOR_REPO_TAG_NAME")) |
16 | | -label = ['-l', branch] if not on_release else [] |
17 | | -token = ['-t', os.getenv('CONDA_REPO_TOKEN')] |
18 | 15 |
|
19 | | -print("Uploading via " + |
20 | | - " ".join(['anaconda -t *****', 'upload', '--force'] + label + fnames)) |
| 16 | +label = ['--label', branch] if not on_release else [] |
| 17 | +token = ['--token', os.getenv('CONDA_REPO_TOKEN')] |
| 18 | + |
| 19 | +command = ["conda", "build", "--no-test", "--no-copy-test-source-files"] |
| 20 | + |
| 21 | +spr.check_call(["conda", "config", "--set", "anaconda_upload", "yes"]) |
| 22 | + |
| 23 | +print("Building recipe via " + |
| 24 | + " ".join(command + ["--token *******"] + label + [recipe_path])) |
21 | 25 |
|
22 | | -spr.check_call( |
23 | | - ['anaconda'] + token + ['upload', '--force'] + |
24 | | - label + fnames |
25 | | -) |
| 26 | +spr.check_call(command + token + label + [recipe_path]) |
0 commit comments