Skip to content

Commit

Permalink
BUG: Fix broken setup.py develop with build system update (#366)
Browse files Browse the repository at this point in the history
* BUG: Fix broken setup.py develop with build system update

The new build system (#355) broke setup.py develop. Fix provided by
@jrmadsen prevents Make from complaining when it is asked to
install the shared library to the same directory twice.

* BLD: Don't clean if Mk.config doesn't exist

* BLD: Remove obsolete build step from meta.yml

* REF: Remove unused matplotlib imports

These imports are unused and conflict with requirements.txt

* REF: Remove lots of unused imports

Used pylint to search the entire module for unused import
statements.
  • Loading branch information
carterbox authored and dgursoy committed Nov 28, 2018
1 parent a50ce62 commit bda3cb1
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 23 deletions.
1 change: 0 additions & 1 deletion benchmarking/pyctest_tomopy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import numpy as np
import pylab
import scipy.ndimage as ndimage
import matplotlib.pyplot as plt
import numpy.linalg as LA


Expand Down
9 changes: 7 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,19 @@ def build_libtomopy():
with open('Mk.config', 'w') as fout:
fout.write(conf)
cmd = ['make', '-j4', '-f', get_makefile()]
if INSTALL_PREFIX is not None:
_PREFIX_PATH = os.path.abspath(INSTALL_PREFIX)
_BINARY_PATH = os.path.abspath(os.path.join(os.getcwd(), ".."))
if INSTALL_PREFIX is not None and _PREFIX_PATH != _BINARY_PATH:
cmd.append('install')
subprocess.check_call(tuple(cmd))


def clean_libtomopy():
"""Clean libtomopy shared library for the current system."""
subprocess.check_call(('make', 'clean', '-f', get_makefile()))
if os.path.exists("Mk.config"):
subprocess.check_call(('make', 'clean', '-f', get_makefile()))
else:
print("Mk.config does not exist. Assuming nothing to clean...")


class Config:
Expand Down
1 change: 0 additions & 1 deletion meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ source:
build:
number: 1
script:
- "{{ PYTHON }} build.py"
- "{{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv"

requirements:
Expand Down
10 changes: 0 additions & 10 deletions tomopy/misc/benchmark.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@

import os
import sys
import signal
import argparse

import tornado
import matplotlib
import pylab
import numpy as np
import scipy.ndimage as ndimage
import matplotlib.pyplot as plt
import numpy.linalg as LA

import timemory
import timemory.options as options


algorithms = ['gridrec', 'art', 'fbp', 'bart', 'mlem', 'osem', 'sirt',
Expand Down
1 change: 0 additions & 1 deletion tomopy/prep/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@

import numpy as np
import logging
import warnings
from skimage import transform as tf
from skimage.feature import register_translation
from tomopy.recon.algorithm import recon
Expand Down
1 change: 0 additions & 1 deletion tomopy/prep/stripe.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@

import numpy as np
import pywt
import tomopy.prep.phase as phase
import tomopy.util.extern as extern
import tomopy.util.mproc as mproc
import tomopy.util.dtype as dtype
Expand Down
1 change: 0 additions & 1 deletion tomopy/recon/algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
import tomopy.util.extern as extern
import tomopy.util.dtype as dtype
from tomopy.sim.project import get_center
import math
import logging
import concurrent.futures as cf

Expand Down
4 changes: 0 additions & 4 deletions tomopy/recon/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,12 @@
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import six
import numpy as np
import tomopy.util.mproc as mproc
import tomopy.util.extern as extern
import tomopy.util.dtype as dtype
from tomopy.sim.project import get_center
from tomopy.recon.algorithm import init_tomo
import math
import logging
import concurrent.futures as cf

logger = logging.getLogger(__name__)

Expand Down
1 change: 0 additions & 1 deletion tomopy/sim/propagate.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
unicode_literals)

import numpy as np
import tomopy.util.dtype as dtype
import logging

logger = logging.getLogger(__name__)
Expand Down
1 change: 0 additions & 1 deletion tomopy/util/extern.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
import os.path
import ctypes
import numpy as np
import glob
import tomopy.util.dtype as dtype
import logging

Expand Down

0 comments on commit bda3cb1

Please sign in to comment.