LinkageIO / Camoco

Camoco is a fully-fledged software package for building co-expression networks and analyzing the overlap interactions among genes.
MIT License
41 stars 32 forks source link

Migrate the install.sh script to work with setup.py #67

Closed schae234 closed 6 years ago

schae234 commented 7 years ago

Currently, we use an bash script to install camoco. This is not cross compatible with other systems (especially ones that do not use bash). We want to be able to clone the camoco repo and handle the dependencies using just setup.py.

We can do this by injecting some pip install commands

from setuptools.command.develop import develop
from setuptools.command.install import install 

  [ ... ]

class PostDevelopCommand(develop):
    """Post-installation for development mode."""
    def run(self):
        print('Running post-installation setup')
        check_call('''\
        pip install -r requirements.txt
        '''.split())
        develop.run(self)

class PostInstallCommand(install):
    """Post-installation for installation mode."""
    def run(self): 
        print('Running post-installation setup')
        check_call('''\
            pip install -r requirements.txt
        '''.split())
install.run(self)

 [ ... ]

setup(
 [ ... ]
    cmdclass = {
        'build_ext' : build_ext,
        'develop': PostDevelopCommand,
        'install': PostInstallCommand,
    },
 [ ... ]
)

Then we should be able to make a virtualenv and install

$ git clone git@github.com:schae234/Camoco.git
$ cd Camoco
$ conda create -n  camoco python=3
$ source activate camoco
# Install some dependencies
$ conda install Cython numpy
# Run the setup.py script
$ python setup.py install

This should be much more cross compatible than what camoco is currently doing.

seraco commented 7 years ago

Can I work on that?

schae234 commented 7 years ago

@seraco That would be great! If you have any questions or need any clarifications, let me know!

seraco commented 7 years ago

Now I have no time to work on this 😞. I will have to leave it to somebody else by now.

schae234 commented 7 years ago

Hey, @seraco, thank you for all your other work! Let us know if you have more time later, we'd love more community input!

schae234 commented 6 years ago

This is related to #69 and is now resolved! Nice work everyone!