Skip to content
Snippets Groups Projects
Commit fa94dc49 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

fix version problem

parent 7ab9e013
No related branches found
No related tags found
No related merge requests found
......@@ -28,23 +28,21 @@ import os
import subprocess
import pickle
from pkg_resources import get_distribution, DistributionNotFound
import pkg_resources
try:
_dist = get_distribution('bfps')
# Normalize case for Windows systems
dist_loc = os.path.normcase(os.path.realpath(_dist.location))
here = os.path.normcase(__file__)
if not here.startswith(os.path.join(dist_loc, 'bfps')):
# not installed, but there is another version that *is*
header_dir = os.path.join(os.path.dirname(here), 'cpp')
lib_dir = os.path.dirname(here)
raise DistributionNotFound
header_dir = os.path.join(os.path.join(dist_loc, 'bfps'), 'cpp')
lib_dir = os.path.join(dist_loc, 'bfps')
__version__ = _dist.version
except DistributionNotFound:
__version__ = ''
__version__ = pkg_resources.require('bfps')[0].version
_dist = pkg_resources.get_distribution('bfps')
# Normalize case for Windows systems
dist_loc = os.path.normcase(os.path.realpath(_dist.location))
here = os.path.normcase(__file__)
if not here.startswith(os.path.join(dist_loc, 'bfps')):
# not installed, but there is another version that *is*
header_dir = os.path.join(os.path.dirname(here), 'cpp')
lib_dir = os.path.dirname(here)
raise pkg_resources.DistributionNotFound
header_dir = os.path.join(os.path.join(dist_loc, 'bfps'), 'cpp')
lib_dir = os.path.join(dist_loc, 'bfps')
install_info = pickle.load(
open(os.path.join(os.path.dirname(here),
......
......@@ -130,6 +130,7 @@ class CustomBuild(DistutilsBuild):
compile_bfps_library()
DistutilsBuild.run(self)
# this custom install leads to a broken installation. no idea why...
class CustomInstall(DistutilsInstall):
def run(self):
compile_bfps_library()
......@@ -141,8 +142,7 @@ setup(
name = 'bfps',
packages = ['bfps'],
install_requires = ['numpy>=1.8', 'h5py>=2.2.1'],
cmdclass={'install' : CustomInstall,
'build' : CustomBuild},
cmdclass={'build' : CustomBuild},
package_data = {'bfps': header_list + ['../machine_settings.py',
'libbfps.a',
'install_info.pickle']},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment