File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22from setuptools import setup , find_packages
33from Cython .Build import cythonize
44import numpy
5+ import os
6+ import codecs
7+ def read (rel_path ):
8+ here = os .path .abspath (os .path .dirname (__file__ ))
9+ with codecs .open (os .path .join (here , rel_path ), 'r' ) as fp :
10+ return fp .read ()
11+
12+ def get_version (rel_path ):
13+ for line in read (rel_path ).splitlines ():
14+ if line .startswith ('__version__' ):
15+ delim = '"' if '"' in line else "'"
16+ return line .split (delim )[1 ]
17+ else :
18+ raise RuntimeError ("Unable to find version string." )
519
620setup (
721 name = "LoopStructural" ,
822 install_requires = [
923 'Cython'
1024 ],
11- packages = find_packages (),
25+ version = get_version ("LoopStructural/__init__.py" ),
26+ packages = find_packages (),
1227 ext_modules = cythonize ("LoopStructural/interpolators/cython/*.pyx" ,compiler_directives = {"language_level" : "3" }),
1328 include_dirs = [numpy .get_include ()],
1429 include_package_data = True ,
You can’t perform that action at this time.
0 commit comments