Skip to content

Commit 0e8901a

Browse files
authored
Merge pull request #10 from jcrivenaes/setup-enhance
Setup enhance
2 parents 191571d + a9b97f2 commit 0e8901a

File tree

7 files changed

+31
-57
lines changed

7 files changed

+31
-57
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,4 @@ target/
7070
# other
7171
.idea/
7272
.projectile
73+
'.'/

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ clean-build: ## remove build artifacts
6969
rm -fr build/
7070
rm -fr dist/
7171
rm -fr .eggs/
72+
rm -fr \'.\'/
7273
find . -name '*.egg-info' -exec rm -fr {} +
7374
find . -name '*.egg' -exec rm -fr {} +
7475

setup.py

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,32 @@
3030
]
3131

3232

33+
def the_version():
34+
"""Process the version, to avoid non-pythonic version schemes.
35+
36+
Means that e.g. 1.5.12+2.g191571d.dirty is turned to 1.5.12.2.dev0
37+
"""
38+
39+
version = versioneer.get_version()
40+
sver = version.split('.')
41+
print('\n\n\nUSING VERSION {}\n\n'.format(sver))
42+
43+
useversion = 'UNSET'
44+
if len(sver) == 3:
45+
useversion = version
46+
else:
47+
bugv = sver[2].replace('+', '.')
48+
49+
if 'dirty' in version:
50+
ext = '.dev0'
51+
else:
52+
ext = ''
53+
useversion = '{}.{}.{}{}'.format(sver[0], sver[1], bugv, ext)
54+
55+
print('\n\n\nUSING VERSION {}\n\n'.format(useversion))
56+
return useversion
57+
58+
3359
class build(_build):
3460
# different order: build_ext *before* build_py
3561
sub_commands = [('build_ext', _build.has_ext_modules),
@@ -50,17 +76,15 @@ class build(_build):
5076
# cxtgeo extension module
5177
_cxtgeo = Extension('xtgeo.cxtgeo._cxtgeo',
5278
sources=sources,
79+
extra_compile_args=['-Wno-uninitialized'],
5380
include_dirs=['src/xtgeo/cxtgeo/clib/src', numpy_include],
5481
library_dirs=['src/xtgeo/cxtgeo/clib/lib'],
5582
libraries=['cxtgeo'],
56-
swig_opts=['-modern'],
57-
)
58-
59-
83+
swig_opts=['-modern'])
6084

6185
setup(
6286
name='xtgeo',
63-
version=versioneer.get_version(),
87+
version=the_version(),
6488
cmdclass=versioneer.get_cmdclass(),
6589
description="XTGeo Python library for grids, surfaces, wells, etc",
6690
long_description=readme + '\n\n' + history,

src/xtgeo/cxtgeo/clib/README

Lines changed: 0 additions & 38 deletions
This file was deleted.
-18.3 KB
Binary file not shown.

src/xtgeo/cxtgeo/clib/extra/libtap/.travis.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/xtgeo/cxtgeo/clib/src/libxtg.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
*
1111
*/
1212

13-
#include <omp.h>
1413
#include <stdio.h>
1514

1615

0 commit comments

Comments
 (0)