kiyo-masui / bitshuffle

Filter for improving compression of typed binary data.
Other
215 stars 76 forks source link

setup: allow virtualenv installation #61

Closed sileht closed 7 years ago

sileht commented 7 years ago

Currently "pip install -e ." or "pip install bitshuffle" inside a virtualenv fail. An application that just put bitshuffle into its requirement will fail to install btshuffle due to missing python libs (h5py/numpy/cython).

This change moves the install_requires into setup_reuires. So setuptools will install the dependencies before build_ext/install/... Also this lazy loads the ext_modules to ensure all dependencies are installed before we cythonize them.

kiyo-masui commented 7 years ago

Okay, this is definitely a sensible thing to do. Right now CI fails when you reference self.extensions. Can you fix this?

sileht commented 7 years ago

I have finished to fix this PR

jd commented 7 years ago

Tested on Darwin and works fine


pip install .
Processing /Users/jd/Source/bitshuffle
Requirement already satisfied: setuptools>=0.7 in /usr/local/lib/python2.7/site-packages (from bitshuffle==0.3.3.dev1)
Requirement already satisfied: Cython>=0.19 in /usr/local/lib/python2.7/site-packages (from bitshuffle==0.3.3.dev1)
Requirement already satisfied: numpy>=1.6.1 in /usr/local/lib/python2.7/site-packages (from bitshuffle==0.3.3.dev1)
Requirement already satisfied: h5py>=2.4.0 in /usr/local/lib/python2.7/site-packages (from bitshuffle==0.3.3.dev1)
Requirement already satisfied: six>=1.6.0 in /usr/local/lib/python2.7/site-packages (from setuptools>=0.7->bitshuffle==0.3.3.dev1)
Requirement already satisfied: packaging>=16.8 in /usr/local/lib/python2.7/site-packages (from setuptools>=0.7->bitshuffle==0.3.3.dev1)
Requirement already satisfied: appdirs>=1.4.0 in /usr/local/lib/python2.7/site-packages (from setuptools>=0.7->bitshuffle==0.3.3.dev1)
Requirement already satisfied: pyparsing in /usr/local/lib/python2.7/site-packages (from packaging>=16.8->setuptools>=0.7->bitshuffle==0.3.3.dev1)
Installing collected packages: bitshuffle
  Running setup.py install for bitshuffle ... done
Successfully installed bitshuffle-0.3.3.dev1```
kiyo-masui commented 7 years ago

Okay, merging it in. Will be a few days before I get around to bumping the version re-releasing it.