11#!/usr/bin/env python
2- import glob
2+ """setup.py for shorah."""
33import sys
4- import os
5- import shutil
64
75from setuptools import setup , find_packages
86from setuptools .command .test import test as TestCommand
9- from setuptools .command .develop import develop
10- from setuptools .command .install import install
117
12- def move_files ():
13- """Identify the build directory and copy python files and executables into src/shorah."""
14- try :
15- main_file = glob .glob ('*/__main__.py' )[0 ]
16- except IndexError :
17- sys .exit ('No __main__.py found. Build first.' )
18- build_dir = os .path .dirname (main_file )
19- for py_file in glob .glob ('%s/*py' % build_dir ):
20- shutil .copy (py_file , 'src/shorah/' )
21- for exe in ['b2w' , 'diri_sampler' , 'fil' ]:
22- ppp = shutil .copy ('%s/src/cpp/%s' % (build_dir , exe ), 'src/shorah/bin/' )
23- print (ppp )
24-
25- class CustomDevelop (develop ):
26- """Subclassing develop to install files in the correct location."""
27- def run (self ):
28- move_files ()
29- develop .run (self )
30-
31-
32- class CustomInstall (install ):
33- """Subclassing develop to install files in the correct location."""
34- def run (self ):
35- move_files ()
36- install .run (self )
378
389class PyTest (TestCommand ):
10+ """Subclass TestCommand to run python setup.py test."""
3911 user_options = [('pytest-args=' , 'a' , "Arguments to pass to py.test" )]
4012
4113 def initialize_options (self ):
@@ -60,15 +32,11 @@ def run_tests(self):
6032 install_requires = ['setuptools_scm' ],
6133 tests_require = ['pytest' , 'flake8' , 'pep257' ],
6234 cmdclass = {
63- 'test' : PyTest ,
64- 'install' : CustomInstall ,
65- 'develop' : CustomDevelop
35+ 'test' : PyTest
6636 },
6737 name = 'ShoRAH' ,
6838 description = 'SHOrt Reads Assembly into Haplotypes' ,
6939 url = 'http://github.com/cbg-ethz/shorah' ,
70- # author='Osvaldo Zagordi',
71- # author_email='firstname.lastname@gmail.com',
7240 packages = find_packages ('src' ), # include all packages under src
7341 package_dir = {'' : 'src' }, # tell setuptools packages are under src
7442 entry_points = {
0 commit comments