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