Skip to content

Commit

Permalink
Merge pull request deepchem#3686 from shreyasvinaya/Add-python-3.11-s…
Browse files Browse the repository at this point in the history
…upport

Add Python 3.11 Support
  • Loading branch information
rbharath authored Mar 4, 2024
2 parents aaec066 + 7813c71 commit b079607
Show file tree
Hide file tree
Showing 13 changed files with 74 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.9']
python-version: ['3.9', '3.11']
steps:
- name: Maximize build space
if: runner.os == 'ubuntu-latest'
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.9']
python-version: ['3.9', '3.11']
steps:
- uses: actions/checkout@v4
- name: Cache pip packages for Windows
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.9']
python-version: ['3.9', '3.11']
steps:
- name: Maximize build space
if: runner.os == 'ubuntu-latest'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/jax_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10']
python-version: ['3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v4
- name: Cache pip modules for Linux
Expand All @@ -39,7 +39,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.9', '3.10']
python-version: ['3.9', '3.10', '3.11']
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
Expand Down
23 changes: 20 additions & 3 deletions .github/workflows/mini_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.10']
python-version: ['3.8', '3.10', '3.11']
include:
- os: windows-latest
python-version: '3.9'
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.10']
python-version: ['3.8', '3.10', '3.11']
include:
- os: windows-latest
python-version: 3.9
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
run: brew update && brew install libomp
- name: Create env.yml for python >3.8
shell: bash
if: ${{ matrix.python-version != '3.8' }}
if: ${{ matrix.python-version != '3.8' && matrix.python-version != '3.11'}}
run: |
python -m pip install --upgrade pip;
pip install conda-merge;
Expand All @@ -127,6 +127,23 @@ jobs:
fi;
cd ..
cp requirements/env.yml env.yml
- name: Create env.yml for python 3.11
shell: bash
# A special case of environment creation for python 3.8 which excludes hhsuite
if: ${{ matrix.python-version == '3.11' }}
run: |
python -m pip install --upgrade pip;
pip install conda-merge;
cd requirements
if [ "$(uname)" == 'Linux' ]; then
conda-merge env_common.yml env_test.yml env_ubuntu_3_11.yml tensorflow/env_tensorflow.cpu.yml torch/env_torch.cpu.yml > env.yml
elif [ "$(uname)" == 'Darwin' ]; then
conda-merge env_common.yml env_test.yml env_mac_3_11.yml tensorflow/env_tensorflow.cpu.yml torch/env_torch.mac.cpu.yml > env.yml
elif [[ "$(uname)" == "MINGW64_NT"* ]]; then
conda-merge env_common.yml env_test.yml tensorflow/env_tensorflow.cpu.yml torch/env_torch.cpu.yml > env.yml
fi;
cd ..
cp requirements/env.yml env.yml
- name: Create env.yml for python 3.8
shell: bash
# A special case of environment creation for python 3.8 which excludes jax [deprecated]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tensorflow_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.10']
python-version: ['3.8', '3.10', '3.11']
include:
- os: windows-latest
python-version: 3.9
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.10']
python-version: ['3.8', '3.10', '3.11']
include:
- os: windows-latest
python-version: '3.9'
Expand Down
23 changes: 13 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.10']
python-version: ['3.8', '3.10', '3.11']
include:
- os: windows-latest
python-version: '3.9'
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.10']
python-version: ['3.8', '3.10', '3.11']
include:
- os: windows-latest
python-version: '3.9'
Expand Down Expand Up @@ -111,17 +111,17 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Create env.yml for python 3.9
- name: Create env.yml for python 3.11
shell: bash
if: ${{ matrix.python-version == '3.9' }}
if: ${{ matrix.python-version == '3.11' }}
run: |
python -m pip install --upgrade pip;
pip install conda-merge;
cd requirements
if [ "$(uname)" == 'Linux' ]; then
conda-merge env_common.yml env_test.yml env_ubuntu.yml tensorflow/env_tensorflow.cpu.yml torch/env_torch.cpu.yml jax/env_jax.cpu.yml > env.yml
conda-merge env_common.yml env_test.yml env_ubuntu_3_11.yml tensorflow/env_tensorflow.cpu.yml torch/env_torch.cpu.yml jax/env_jax.cpu.yml > env.yml
elif [ "$(uname)" == 'Darwin' ]; then
conda-merge env_common.yml env_test.yml env_mac.yml tensorflow/env_tensorflow.cpu.yml torch/env_torch.mac.cpu.yml jax/env_jax.cpu.yml > env.yml
conda-merge env_common.yml env_test.yml env_mac_3_11.yml tensorflow/env_tensorflow.cpu.yml torch/env_torch.mac.cpu.yml jax/env_jax.cpu.yml > env.yml
elif [[ "$(uname)" == "MINGW64_NT"* ]]; then
conda-merge env_common.yml env_test.yml tensorflow/env_tensorflow.cpu.yml torch/env_torch.cpu.yml > env.yml
fi;
Expand All @@ -144,10 +144,9 @@ jobs:
fi;
cd ..
cp requirements/env.yml env.yml
- name: Create env.yml for python == 3.10
- name: Create env.yml for python >= 3.9
shell: bash
# A special case of environment creation for python 3.10 which excludes vina
if: ${{ matrix.python-version == '3.10' }}
if: ${{ matrix.python-version != '3.8' && matrix.python-version != '3.11' }}
run: |
python -m pip install --upgrade pip;
pip install conda-merge;
Expand Down Expand Up @@ -184,6 +183,10 @@ jobs:
shell: bash -l {0}
run: DGLBACKEND=pytorch pytest -v --ignore-glob='deepchem/**/test*.py' --ignore-glob='deepchem/models/jax_models/*' --doctest-modules deepchem --doctest-continue-on-failure
- name: PyTest
if: ${{ (success() || failure()) && (steps.install.outcome == 'failure' || steps.install.outcome == 'success')}}
if: ${{ (success() || failure()) && (steps.install.outcome == 'failure' || steps.install.outcome == 'success') && matrix.python-version == '3.11'}}
shell: bash -l {0}
run: pytest -v -m "not jax and not torch and not tensorflow and not dqc" --ignore='deepchem/utils/test/test_sequence_utils.py' deepchem
- name: PyTest
if: ${{ (success() || failure()) && (steps.install.outcome == 'failure' || steps.install.outcome == 'success') && matrix.python-version != '3.11'}}
shell: bash -l {0}
run: pytest -v -m "not jax and not torch and not tensorflow and not dqc" deepchem
4 changes: 2 additions & 2 deletions .github/workflows/torch_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.10']
python-version: ['3.8', '3.10', '3.11']
include:
- os: windows-latest
python-version: 3.9
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.10']
python-version: ['3.8', '3.10', '3.11']
include:
- os: windows-latest
python-version: '3.9'
Expand Down
1 change: 0 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dm-haiku
optax
rdkit
torch_geometric
git+https://github.com/diffqc/dqc.git
PyYAML
yamlloader
dgl
Expand Down
8 changes: 8 additions & 0 deletions requirements/env_mac_3_11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: deepchem
channels:
- conda-forge
- bioconda
dependencies:
- vina
- pip:
- pysam
8 changes: 8 additions & 0 deletions requirements/env_ubuntu_3_11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: deepchem
channels:
- conda-forge
- bioconda
dependencies:
- vina
- pip:
- pysam
8 changes: 4 additions & 4 deletions scripts/install_deepchem_conda.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ conda install -c conda-forge conda-merge

$common = Join-Path (pwd).PATH "requirements/env_common.yml"
$test = Join-Path (pwd).PATH "requirements/env_test.yml"
$tensorflow = Join-Path (pwd).PATH "requirements/tensorflow/env_tensorflow.cpu.yml"
$out = Join-Path (pwd).PATH "env.yml"
# Tensorflow has same installation commands for CPU and GPU
# Torch has different installation commands for CPU and GPU
# Jax is not supported in windows. Hence, excluded.
# Tensorflow is not supported in windows. Hence, excluded, install
# linux version using Windows Subsystem for Linux.
if($args[1] -eq "gpu")
{
# We expect the CUDA vesion is 10.1.
$torch_gpu = Join-Path (pwd).PATH "requirements/torch/env_torch.gpu.yml"
conda-merge $common $tensorflow $torch_gpu $test > $out
conda-merge $common $torch_gpu $test > $out
echo "Installing DeepChem in the GPU environment"
}
else
{
$torch_cpu = Join-Path (pwd).PATH "requirements/torch/env_torch.cpu.yml"
conda-merge $common $tensorflow $torch_cpu $test > $out
conda-merge $common $torch_cpu $test > $out
echo "Installing DeepChem in the CPU environment"
}

Expand Down
12 changes: 10 additions & 2 deletions scripts/install_deepchem_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,17 @@ then
echo "Installing DeepChem in the GPU environment"
else
if [ "$(uname)" = 'Darwin' ]; then
conda-merge $dir/env_common.yml $dir/env_mac.yml $dir/env_test.yml $dir/tensorflow/env_tensorflow.cpu.yml $dir/torch/env_torch.mac.cpu.yml $dir/jax/env_jax.cpu.yml > $PWD/env.yml
if [ "$1" = "3.11" ]; then
conda-merge $dir/env_common.yml $dir/env_mac_3_11.yml $dir/env_test.yml $dir/tensorflow/env_tensorflow.cpu.yml $dir/torch/env_torch.mac.cpu.yml $dir/jax/env_jax.cpu.yml > $PWD/env.yml
else
conda-merge $dir/env_common.yml $dir/env_mac.yml $dir/env_test.yml $dir/tensorflow/env_tensorflow.cpu.yml $dir/torch/env_torch.mac.cpu.yml $dir/jax/env_jax.cpu.yml > $PWD/env.yml
fi
elif [ "$(uname)" = 'Linux' ]; then
conda-merge $dir/env_common.yml $dir/env_test.yml $dir/env_ubuntu.yml $dir/tensorflow/env_tensorflow.cpu.yml $dir/torch/env_torch.cpu.yml $dir/jax/env_jax.cpu.yml > $PWD/env.yml
if [ "$1" = "3.11" ]; then
conda-merge $dir/env_common.yml $dir/env_test.yml $dir/env_ubuntu_3_11.yml $dir/tensorflow/env_tensorflow.cpu.yml $dir/torch/env_torch.cpu.yml $dir/jax/env_jax.cpu.yml > $PWD/env.yml
else
conda-merge $dir/env_common.yml $dir/env_test.yml $dir/env_ubuntu.yml $dir/tensorflow/env_tensorflow.cpu.yml $dir/torch/env_torch.cpu.yml $dir/jax/env_jax.cpu.yml > $PWD/env.yml
fi
fi
echo "Installing DeepChem in the CPU environment"
fi
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def _get_version():
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
],
license='MIT',
description='Deep learning models for drug discovery, \
Expand Down Expand Up @@ -79,4 +80,4 @@ def _get_version():
'rdkit',
],
extras_require=extras,
python_requires='>=3.7,<3.11')
python_requires='>=3.7,<3.12')

0 comments on commit b079607

Please sign in to comment.