Skip to content

Commit

Permalink
Merge pull request #41 from CDAT/fix_conda_build_env
Browse files Browse the repository at this point in the history
Fix conda build env
  • Loading branch information
muryanto1 authored Jul 17, 2020
2 parents 696cf33 + b3c52e0 commit bf19a42
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ aliases:
source $BASH_ENV
source $WORKDIR/miniconda/etc/profile.d/conda.sh
conda activate base
make conda-rerender workdir=$WORKDIR branch=$CIRCLE_BRANCH
make conda-rerender conda_build_env=base workdir=$WORKDIR branch=$CIRCLE_BRANCH
- &conda_build
name: conda_build
Expand All @@ -38,7 +38,7 @@ aliases:
conda activate base
os=`uname`
artifacts_dir="artifacts/artifacts.${os}.py_${PY_VER}"
make conda-build workdir=$WORKDIR artifact_dir=$artifacts_dir build_version=$PY_VER
make conda-build conda_build_env=base workdir=$WORKDIR artifact_dir=$PWD/$artifacts_dir build_version=$PY_VER
- &setup_run_tests
name: setup_run_tests
Expand Down Expand Up @@ -66,7 +66,7 @@ aliases:
source $WORKDIR/miniconda/etc/profile.d/conda.sh
conda activate base
UPLOAD_OPTIONS="conda_upload_token=$CONDA_UPLOAD_TOKEN"
make conda-upload workdir=$WORKDIR $UPLOAD_OPTIONS artifact_dir="artifacts/*/"
make conda-upload workdir=$WORKDIR $UPLOAD_OPTIONS artifact_dir="$PWD/artifacts/*/"
executors:
linux:
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ build_script = conda-recipes/build_tools/conda_build.py
test_pkgs = testsrunner
last_stable ?= 8.2

conda_test_env = test-$(pkg_name)
conda_build_env = build-$(pkg_name)
conda_test_env ?= test-$(pkg_name)
conda_build_env ?= build-$(pkg_name)
conda_dev_env = dev-$(pkg_name)

branch ?= $(shell git rev-parse --abbrev-ref HEAD)
Expand All @@ -40,7 +40,7 @@ endif
workdir := $(shell cat $(PWD)/.tempdir)
endif

artif_dir = $(workdir)/$(artifact_dir)
artifact_dir ?= $(PWD)/artifacts

ifneq ($(coverage),)
coverage = -c tests/coverage.json --coverage-from-egg
Expand All @@ -51,7 +51,7 @@ conda_recipes_branch ?= master
conda_base = $(patsubst %/bin/conda,%,$(conda))
conda_activate = $(conda_base)/bin/activate

conda_build_extra = --copy_conda_package $(artif_dir)/
conda_build_extra = --copy_conda_package $(artifact_dir)/

# Is this needed?
# ifndef $(local_repo)
Expand Down Expand Up @@ -120,15 +120,15 @@ conda-rerender: setup-build ## Rerender conda recipe using conda-smithy
--conda_activate $(conda_activate)

conda-build: ## Builds conda recipe
mkdir -p $(artif_dir)
mkdir -p $(artifact_dir)

python $(workdir)/$(build_script) -w $(workdir) -p $(pkg_name) --build_version $(build_version) \
--do_build --conda_env $(conda_build_env) --extra_channels $(extra_channels) \
--conda_activate $(conda_activate) $(conda_build_extra)

conda-upload: ## Upload conda packages in artifcat directory
conda-upload: ## Upload conda packages in artifact directory
source $(conda_activate) $(conda_build_env); \
anaconda -t $(conda_upload_token) upload -u $(user) -l $(label) --force $(artif_dir)/*.tar.bz2
anaconda -t $(conda_upload_token) upload -u $(user) -l $(label) --force $(artifact_dir)/*.tar.bz2

conda-dump-env: ## Dumps conda environment
mkdir -p $(artifact_dir)
Expand Down

0 comments on commit bf19a42

Please sign in to comment.