From ec9e1b5ad69f314569780cbac54227420d60138f Mon Sep 17 00:00:00 2001
From: Reinhard Prix <reinhard.prix@aei.mpg.de>
Date: Mon, 1 Jul 2019 11:25:34 +0200
Subject: [PATCH] updates for python3, improved setup.py using setuptools

---
 pyfstat/grid_based_searches.py |  2 +-
 setup.py                       | 24 +++++++++++++++++++++---
 tests.py                       |  1 -
 3 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/pyfstat/grid_based_searches.py b/pyfstat/grid_based_searches.py
index c4513ac..0d61e3f 100644
--- a/pyfstat/grid_based_searches.py
+++ b/pyfstat/grid_based_searches.py
@@ -12,7 +12,7 @@ import socket
 import numpy as np
 import matplotlib
 import matplotlib.pyplot as plt
-from scipy.misc import logsumexp
+from scipy.special import logsumexp
 
 import pyfstat.helper_functions as helper_functions
 from pyfstat.core import (BaseSearchClass, ComputeFstat,
diff --git a/setup.py b/setup.py
index 2f03d83..d9557b9 100644
--- a/setup.py
+++ b/setup.py
@@ -1,13 +1,31 @@
 #!/usr/bin/env python
 
-from distutils.core import setup
+from setuptools import setup, find_packages
+from os import path
+
+here = path.abspath(path.dirname(__file__))
+# Get the long description from the README file
+with open(path.join(here, 'README.md'), encoding='utf-8') as f:
+    long_description = f.read()
 
 setup(name='PyFstat',
       version='0.2',
       author='Gregory Ashton',
       author_email='gregory.ashton@ligo.org',
-      packages=['pyfstat'],
+      packages=find_packages(where="pyfstat"),
       include_package_data=True,
       package_data={'pyfstat': ['pyCUDAkernels/cudaTransientFstatExpWindow.cu',
                                 'pyCUDAkernels/cudaTransientFstatRectWindow.cu']},
-      )
+      install_requires=[
+          'matplotlib',
+          'scipy',
+          'ptemcee',
+          'corner',
+          'dill',
+          'tqdm',
+          'bashplotlib',
+          'peakutils',
+          'pathos',
+          'pycuda',
+      ],
+)
diff --git a/tests.py b/tests.py
index 284d325..c67e40d 100644
--- a/tests.py
+++ b/tests.py
@@ -93,7 +93,6 @@ class par(Test):
     label = 'TestPar'
 
     def test(self):
-        os.system('mkdir {}'.format(self.outdir))
         os.system(
             'echo "x=100\ny=10" > {}/{}.par'.format(self.outdir, self.label))
 
-- 
GitLab