Commit 3a9ebac9 authored by nd-02110114's avatar nd-02110114
Browse files

🐛 fix bug

parent 637ec7ab
Loading
Loading
Loading
Loading
+0 −27
Original line number Diff line number Diff line
@@ -7,33 +7,6 @@ on:
    branches:
      - master
jobs:
  minimum-build:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python-version: [3.7]
    steps:
    - uses: actions/checkout@v2
    - name: Cache pip modules for Linux
      uses: actions/cache@v2
      with:
        path: ~/.cache/pip
        key: ${{ runner.os }}-pip-${{ hashFiles('env.*.yml') }}
        restore-keys: |
          ${{ runner.os }}-pip-
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Build DeepChem
      run: |
        python -m pip install --upgrade pip
        pip install tensorflow==2.3.0
        pip install -e .
    - name: Import checking
      run: python -c "import deepchem"

  bash-build:
    runs-on: ${{ matrix.os }}
    strategy:
+57 −12
Original line number Diff line number Diff line
name: Test for DeepChem core modules
name: Test for DeepChem Core
on:
  push: # ci work when pushing master branch
    branches:
@@ -7,6 +7,33 @@ on:
    branches:
      - master
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python-version: [3.7]
    steps:
    - uses: actions/checkout@v2
    - name: Cache pip modules for Linux
      uses: actions/cache@v2
      with:
        path: ~/.cache/pip
        key: ${{ runner.os }}-pip-${{ hashFiles('env.*.yml') }}
        restore-keys: |
          ${{ runner.os }}-pip-
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Build DeepChem
      run: |
        python -m pip install --upgrade pip
        pip install tensorflow==2.3.0
        pip install -e .
    - name: Import checking
      run: python -c "import deepchem"

  test:
    runs-on: ${{ matrix.os }}
    strategy:
@@ -24,25 +51,21 @@ jobs:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0
    # This 
    # https://github.com/galaxyproject/tools-iuc/blob/master/.github/workflows/pr.yaml 
    # The range of commits to check for changes is:
    # - `origin/master...` for all events happening on a feature branch
    # - for events on the master branch we compare against the sha before the event
    #   (note that this does not work for feature branch events since we want all
    #   commits on the feature branch and not just the commits of the last event)
    # - for pull requests we compare against the 1st ancestor, given the current
    #   HEAD is the merge between the PR branch and the base branch
    - name: Set commit range (push to the feature branch)
      if: github.ref != 'refs/heads/master' && github.event_name == 'push'
      run: |
        git fetch origin master
        echo "COMMIT_RANGE=origin/master..." >> $GITHUB_ENV
    - name: Set commit range (push to the master branch, e.g. merge)
      if: github.ref == 'refs/heads/master' && github.event_name == 'push'
      run: echo "COMMIT_RANGE=${{ github.event.before }}.." >> $GITHUB_ENV
    - name: Set commit range (pull request)
      if: github.event_name == 'pull_request'
      run: echo "COMMIT_RANGE=HEAD~.." >> $GITHUB_ENV
      run: |
        git fetch origin master
        echo "COMMIT_RANGE=origin/master..." >> $GITHUB_ENV
    - name: Cache pip packages for Linux
      if: startsWith(runner.os, 'Linux')
      uses: actions/cache@v2
@@ -96,9 +119,11 @@ jobs:
    - name: Install DeepChem
      shell: bash -l {0}
      run: pip install -e .
    - name: Yapf
    - name: Yapf (version 0.22.0)
      shell: bash -l {0}
      run: source scripts/yapf_for_ci.sh
      run: |
        CHANGED_FILES=`git diff --name-only $COMMIT_RANGE | grep .py$ | grep -v contrib/`
        yapf -d $CHANGED_FILES
    - name: Flake8
      shell: bash -l {0}
      run: source scripts/flake8_for_ci.sh
@@ -119,4 +144,24 @@ jobs:
        fail_ci_if_error: true
        verbose: true

  deploy:
    if: ${{ github.ref == 'master' }}
    needs: [build, test]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python
      uses: actions/setup-python@v1
      with:
        python-version: '3.7'
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install setuptools wheel twine
    - name: Publish (Nightly)
      env:
        TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
        TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
      run: |
        python setup.py sdist bdist_wheel
        twine upload dist/*
+43 −0
Original line number Diff line number Diff line
name: Release PyPI packages
on:
  push:
    tags:
      - '*'
jobs:
  release:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python-version: [3.7]
    steps:
    - uses: actions/checkout@v2
    - name: Cache pip modules for Linux
      uses: actions/cache@v2
      with:
        path: ~/.cache/pip
        key: ${{ runner.os }}-pip-${{ hashFiles('env.*.yml') }}
        restore-keys: |
          ${{ runner.os }}-pip-
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Build DeepChem
      run: |
        python -m pip install --upgrade pip
        pip install tensorflow==2.3.0
        pip install -e .
    - name: Import checking
      run: python -c "import deepchem"
    - name: Prepare for publishing
      run: |
        rm -rf ./build ./dist ./*egg-info
        pip install setuptools wheel twine
    - name: Publish (Stable)
      env:
        TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
        TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
      run: |
        python setup.py sdist bdist_wheel --release
        twine upload dist/*
+0 −2
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@ import tempfile
import tarfile
import numpy as np
from subprocess import call
from subprocess import check_output
from typing import List, Optional, Tuple, Union

from deepchem.dock.binding_pocket import BindingPocketFinder
@@ -151,7 +150,6 @@ class VinaPoseGenerator(PoseGenerator):
            "Check how to install from this link : http://vina.scripps.edu/manual.html#windows."
        )


  def generate_poses(self,
                     molecular_complex: Tuple[str, str],
                     centroid: Optional[np.ndarray] = None,
+1 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ class TestPoseGeneration(unittest.TestCase):
  """
  Does sanity checks on pose generation.
  """

  def test_vina_initialization(self):
    """Test that VinaPoseGenerator can be initialized."""
    dc.dock.VinaPoseGenerator()
Loading