From 6769140e6bda1347ac747d41c5a14db7f7eda92c Mon Sep 17 00:00:00 2001 From: Mingjian Wen Date: Thu, 3 Dec 2020 12:49:55 -0800 Subject: [PATCH] Use conda-incubator/setup-miniconda to setup GH actions --- .github/workflows/pythonpackage.yml | 23 +++++++++++------------ binder/environment.yml | 6 ++---- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index f7786a0..f4924ee 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -13,32 +13,31 @@ jobs: python-version: [3.6, 3.7, 3.8] steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + - uses: actions/checkout@v2 + + - uses: conda-incubator/setup-miniconda@v2 with: + auto-update-conda: true python-version: ${{ matrix.python-version }} - - name: Include $CONDA in $PATH - run: echo ::add-path::$CONDA/bin + - name: Install dependencies + shell: bash -l {0} run: | + conda env update --file environment.yml python -m pip install --upgrade pip + pip install flake8 pytest pip install -e . - conda install pytorch==1.6.0 torchvision cpuonly -c pytorch - conda install dgl==0.5.0 -c dglteam - conda install pymatgen==2020.8.13 -c conda-forge - conda install rdkit==2020.03.5 -c conda-forge - conda install openbabel==3.1.1 -c conda-forge + - name: Lint with flake8 + shell: bash -l {0} run: | - pip install flake8 # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest + shell: bash -l {0} run: | - pip install pytest # ignore tests in "tests/prediction/". They need the pre-trained # models, but these are stored as LFS on GitHub and Action cannot get # access to it. diff --git a/binder/environment.yml b/binder/environment.yml index 0e481a3..9862bf9 100644 --- a/binder/environment.yml +++ b/binder/environment.yml @@ -1,8 +1,7 @@ -name: bondnet channels: - - conda-forge - pytorch - dglteam + - conda-forge - defaults dependencies: - pip @@ -10,5 +9,4 @@ dependencies: - rdkit==2020.03.5 - openbabel==3.1.1 - pytorch==1.6.0 - - torchvision - - dgl==0.5.0 + - dgl==0.5.2 \ No newline at end of file