|
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( |
7 |
| - os.path.join('ci', 'conda-recipe'))) |
8 |
| -py_patt = re.compile('py\d\d') |
9 |
| -repl = 'py' + os.getenv('PYTHON_VERSION').replace('.', '') |
10 |
| -fnames = [py_patt.sub(repl, f) for f in fnames] |
| 6 | + |
| 7 | +recipe_path = 'ci/conda-recipe' |
| 8 | + |
11 | 9 | if os.getenv("TRAVIS") == "true":
|
12 | 10 | branch = os.getenv("TRAVIS_BRANCH")
|
13 | 11 | on_release = os.getenv("TRAVIS_TAG") != ""
|
14 | 12 | else:
|
15 | 13 | branch = os.getenv("APPVEYOR_REPO_BRANCH")
|
16 | 14 | on_release = bool(os.getenv("APPVEYOR_REPO_TAG_NAME"))
|
17 |
| -label = ['-l', branch] if not on_release else [] |
18 |
| -token = ['-t', os.getenv('CONDA_REPO_TOKEN')] |
19 | 15 |
|
20 |
| -print("Uploading via " + |
21 |
| - " ".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])) |
22 | 25 |
|
23 |
| -spr.check_call( |
24 |
| - ['anaconda'] + token + ['upload', '--force'] + |
25 |
| - label + fnames |
26 |
| -) |
| 26 | +spr.check_call(command + token + label + [recipe_path]) |
0 commit comments