Skip to content

Commit

Permalink
Fixes for conda on GHA (#103)
Browse files Browse the repository at this point in the history
* temporary fix conda pybind11 2.6 issue

* try to fix ccache

* try to fix pytest

* fix weird error

* set home dir correctly

* annoying

* only pybind11 from copy

* all c-f

* try blas=mkl

* revert and install verify

* pin new adccore

* remove flag

* downgrad core

* bump macos in ci, add todo
  • Loading branch information
maxscheurer authored Nov 28, 2020
1 parent d6adad9 commit c46a59d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
include:
- {version: '3.6', os: ubuntu-latest}
- {version: '3.8', os: ubuntu-latest}
- {version: '3.6', os: macOS-10.14 }
- {version: '3.6', os: macOS-10.15 }
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand Down
1 change: 1 addition & 0 deletions conda/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -eu
# Setup wrapper scripts for ccache during adcc builds
ccache -M 1Gi

mkdir -p $HOME/bin
rm -rf $HOME/bin/cc
rm -rf $HOME/bin/cxx
echo -e '#!/bin/sh\n' "ccache $CC \$@" > $HOME/bin/cc
Expand Down
2 changes: 1 addition & 1 deletion conda/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ target_platform:
- osx-64 # [osx]
- linux-64 # [linux]
CONDA_BUILD_SYSROOT:
- /Users/travis/MacOSX10.9.sdk # [osx]
- /Users/runner/MacOSX10.9.sdk # [osx]
c_compiler_version:
- 7.3.0 # [linux]
- 4 # [osx]
Expand Down
4 changes: 2 additions & 2 deletions scripts/upload_to_anaconda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ fi
< conda/meta.yaml.in sed "s/@ADCC_VERSION@/$ADCC_VERSION/g;" > conda/meta.yaml

# Install requirements and setup channels
conda install conda-build anaconda-client --yes
conda install conda-build anaconda-client conda-verify --yes
# conda config --append channels psi4/label/dev
# conda config --append channels pyscf

# Running build and deployment
conda build conda --user adcc --token $ANACONDA_TOKEN --label $LABEL
conda build conda -c defaults -c conda-forge --user adcc --token $ANACONDA_TOKEN --label $LABEL
13 changes: 12 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ def finalize_options(self):


def is_conda_build():
return os.environ.get("CONDA_BUILD", None) == "1"
return (
os.environ.get("CONDA_BUILD", None) == "1"
or os.environ.get("CONDA_EXE", None)
)


def get_adccore_data():
Expand All @@ -64,6 +67,13 @@ def get_adccore_data():

import AdcCore

# TODO: find a more sustainable and clean solution ASAP
if is_conda_build():
os.environ["LDFLAGS_LD"] = \
os.environ["LDFLAGS_LD"].replace("-dead_strip_dylibs", "")
os.environ["LDFLAGS"] = \
os.environ["LDFLAGS"].replace("-Wl,-dead_strip_dylibs", "")

adccore = AdcCore.AdcCore()
if not adccore.is_config_file_present \
or adccore.version != adccore_version[0] \
Expand Down Expand Up @@ -132,6 +142,7 @@ def adccsetup(*args, **kwargs):
"""Wrapper around setup, displaying a link to adc-connect.org on any error."""
if is_conda_build():
kwargs.pop("install_requires")
kwargs.pop("tests_require")
try:
setup(*args, **kwargs)
except Exception as e:
Expand Down

0 comments on commit c46a59d

Please sign in to comment.