LAAC-LSCP / ChildProject

Python package for the management of day-long recordings of children.
https://childproject.readthedocs.io
MIT License
13 stars 5 forks source link

One conda environment to rule them all #315

Closed MarvinLvn closed 2 years ago

MarvinLvn commented 2 years ago

Installation instructions such as found in the readthedocs seem a bit complicated. You have instructions for both conda users and non-conda users, admin users and non-admin users.

In other words, there are multiple paths for installing the package and its dependencies depending on your profile. That makes it hard for users to 1) follow the path they have to follow 2) you debugging installation depending on what users understood from the instructions

Would it be possible to provide an environment.yml (example here) so that users just have to run :

conda env create -f datalad.yml
conda activate datalad

This way, you'd make sure users don't have access rights problem and have all of the required dependencies installed. For instance, the doc says :

Screenshot from 2021-10-20 12-08-39

This can be specified in the .yml file and you could get rid of that note.

lucasgautheron commented 2 years ago

Yes, that would be great!

Unfortunately, there are lots of dependencies which are not available through conda or not for all platforms (this includes git-annex, which is available on Linux, but not on MacOS). That's what stopped me when I tried the full-conda approach : in the end, we still have to provide instructions for the remaining packages, and these instructions depend on the user installation. So you end up increasing the complexity even further

Here is an ongoing effort towards providing access to ChildProject through conda and what is slowing it down (without even considering datalad/git-annex): https://github.com/LAAC-LSCP/ChildProject/issues/297

(It could very well be that my limited understanding of conda is a factor here though)

MarvinLvn commented 2 years ago

Across-OS compatibility is a real pain :/ Maybe we can think of something like : 1) One conda environment 2) FAQ section that handle user-specific / OS-specific problems

lucasgautheron commented 2 years ago

Yeah, I'm gonna head towards that direction!

lucasgautheron commented 2 years ago

Okay, these are the new proposed instructions. Testing welcome!

https://childproject.readthedocs.io/en/conda/install.html

MarvinLvn commented 2 years ago

Seems to work but :

Something like this should work :

name: childproject
channels:
  - conda-forge
  - defaults
dependencies:
  - python=3.7
  - ffmpeg
  - git-annex>=8.2
  - pip
  - pytest
  - sox
  - pip:
    - scipy
    - ChildProject

EDIT : you may want to specify version for git-annex

MarvinLvn commented 2 years ago

Also : with the new instructions it took me 5 minutes to install all the dependencies and 0 brain cell :1st_place_medal:

MarvinLvn commented 2 years ago

On second thought, why not something like :

git clone git@github.com:LAAC-LSCP/ChildProject.git
conda env create -f env_linux.yml 
conda activate childproject
pip install .

no need for wget and curl

For MAC Users :

brew install git-annex
git clone git@github.com:LAAC-LSCP/ChildProject.git
conda env create -f env_macos.yml 
conda activate childproject
pip install .
lucasgautheron commented 2 years ago

Seems to work but :

  • the wget command returns the html code of the page, not the file. (you might want to use curl ? although that means installing curl T_T)
  • the command pip install ChildProject should be moved to the .yml file and removed from the instructions

Something like this should work :

name: childproject
channels:
  - conda-forge
  - defaults
dependencies:
  - python=3.7
  - ffmpeg
  - git-annex>=8.2
  - pip
  - pytest
  - sox
  - pip:
    - scipy
    - ChildProject

EDIT : you may want to specify version for git-annex

Of course! Sorry about that;

lucasgautheron commented 2 years ago

On second thought, why not something like :

git clone git@github.com:LAAC-LSCP/ChildProject.git
conda env create -f env_linux.yml 
conda activate childproject
pip install .

no need for wget and curl

I like to use pypi (because of version management and all); But I guess one could still do:

brew install git-annex
git clone git@github.com:LAAC-LSCP/ChildProject.git --depth 1 -b master
conda env create -f env_macos.yml # including ChildProject from pypi
conda activate childproject