Skip to content

Make compatible with conda-forge #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 16 additions & 31 deletions .github/workflows/test.yml → .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test code
name: CI

on:
push:
Expand All @@ -11,51 +11,37 @@ on:
- cron: "0 0 * * 0" # Run every Sunday at 0:00

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.7"]

test:
runs-on: "ubuntu-latest"
defaults: # Needed for conda
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2
with:
lfs: true
- name: Check out
uses: actions/checkout@v2

- name: Cache conda
- name: Cache conda packages
uses: actions/cache@v1
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}
env:
# Increase this value to reset cache if environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}

- uses: conda-incubator/setup-miniconda@v2
- name: Create a conda environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: torchmd-net
channels: acellera,conda-forge,defaults
channel-priority: true
environment-file: environment.yml
# python-version: ${{ matrix.python-version }}
# auto-update-conda: true
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
auto-activate-base: false

- run: which pip
- name: Install the package
run: pip install .

- name: Install pip dependencies
run: |
pip install flake8 pytest
pip install .
- name: List the conda environment
run: conda list

- name: Lint with flake8
run: |
Expand All @@ -65,5 +51,4 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Run tests
run: |
pytest
run: pytest
23 changes: 15 additions & 8 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
name: torchmd-net
channels:
- pytorch
- rusty1s
- raimis
- conda-forge
dependencies:
- matplotlib
- pip
- pytorch==1.8.0
- pytorch-geometric=1.7.2=py36_torch_1.8.0_cpu
- pytorch-lightning==1.3.1
- ase
- h5py
- matplotlib
- pip
- python
- pytorch==1.10.0
# The official PyTorch Geometric package is not compatible with conda-forge,
# while the package on conda-forge is broken
# (https://github.com/pyg-team/pytorch_geometric/issues/3660).
# Until a better solution is found a have custom package to plug the gap.
- raimis::pytorch-geometric==2.0.2
- pytorch-lightning==1.3.8
- setuptools==59.5.0 # Pin due to https://github.com/pytorch/pytorch/pull/69904
- tqdm
- scipy
# Dev tools
- flake8
- pytest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't add testing utilities like pytest and flake8 to the env file. If someone wants to install the env to use torchMD-Net he doesn't want the test packages

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The current installation instructions don't even mention that environment file.
  • When the things are ready for OpenMM/ACEMD, we will have to make a conda-forge package. So only developers will be installing manually.

5 changes: 0 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
pytorch-lightning==1.3.8
matplotlib
scipy
h5py
ase