on versions in setup.py
This commit is contained in:
parent
aefb45070d
commit
9563dfff47
1 changed files with 10 additions and 14 deletions
22
setup.py
22
setup.py
|
@ -8,24 +8,19 @@ import subprocess
|
||||||
libname = "cnorxz"
|
libname = "cnorxz"
|
||||||
author = "Christian Zimmermann"
|
author = "Christian Zimmermann"
|
||||||
author_email = "chizeta@f3l.de"
|
author_email = "chizeta@f3l.de"
|
||||||
|
path_to_cnorxz = "/home/chizeta/repos/cnorxz/install"
|
||||||
expected_cnorxz_version = "1.0.0" # dummy for now; in the future this is supposed to be the c++ version which is guaranteed to be compatible with py cnorxz
|
expected_cnorxz_version = "1.0.0" # dummy for now; in the future this is supposed to be the c++ version which is guaranteed to be compatible with py cnorxz
|
||||||
|
|
||||||
git_hash = subprocess.run(['git','rev-parse','HEAD'],stdout=subprocess.PIPE).stdout.decode('ascii')[:-1]
|
git_hash = subprocess.run(['git','rev-parse','HEAD'],stdout=subprocess.PIPE).stdout.decode('ascii')[:-1]
|
||||||
git_tags = subprocess.run(['git', 'tag', '-l', '--sort=refname', 'v*'],stdout=subprocess.PIPE).stdout.decode('ascii').split()
|
git_tags = subprocess.run(['git', 'tag', '-l', '--sort=refname', 'v*'],stdout=subprocess.PIPE).stdout.decode('ascii').split()
|
||||||
|
cnorxz_version = subprocess.run([path_to_cnorxz+"/bin/cnorxz-config",'--version'],stdout=subprocess.PIPE).stdout.decode('ascii')[:-1]
|
||||||
|
|
||||||
version = git_hash[:7]
|
assert len(git_tags) != 0, "no version tags found"
|
||||||
if len(git_tags) != 0:
|
git_tag = git_tags[-1]
|
||||||
git_tag = git_tags[-1]
|
version = git_tag[1:] + 'dev'
|
||||||
git_hash_tag = subprocess.run(['git','rev-parse',git_tag],stdout=subprocess.PIPE).stdout.decode('ascii')[:-1]
|
git_hash_tag = subprocess.run(['git','rev-parse',git_tag],stdout=subprocess.PIPE).stdout.decode('ascii')[:-1]
|
||||||
if git_hash_tag == git_hash:
|
if git_hash_tag == git_hash and expected_cnorxz_version != cnorxz_version:
|
||||||
version = git_tag[1:]
|
version = git_tag[1:]
|
||||||
else:
|
|
||||||
version += git_tag[1:]
|
|
||||||
|
|
||||||
# if expected_cnorxz_version != cnorxz_version
|
|
||||||
# version += '-cxz' + cnorxz_version
|
|
||||||
|
|
||||||
path_to_cnorxz = "/home/chizeta/repos/cnorxz/install"
|
|
||||||
|
|
||||||
inc_dirs = list()
|
inc_dirs = list()
|
||||||
if path_to_cnorxz != "":
|
if path_to_cnorxz != "":
|
||||||
|
@ -39,7 +34,8 @@ if path_to_cnorxz != "":
|
||||||
lib_dirs.append( "/home/chizeta/repos/cnorxz/install/lib" )
|
lib_dirs.append( "/home/chizeta/repos/cnorxz/install/lib" )
|
||||||
|
|
||||||
extra_compile_args = sysconfig.get_config_var('CFLAGS').split()
|
extra_compile_args = sysconfig.get_config_var('CFLAGS').split()
|
||||||
extra_compile_args += ["-std=c++17", "-Wall", "-Wextra", "-Wpedantic"] # get this automatically from cnorxz itself??
|
cnorxz_flags = subprocess.run([path_to_cnorxz+"/bin/cnorxz-config",'--flags'],stdout=subprocess.PIPE).stdout.decode('ascii').split()
|
||||||
|
extra_compile_args += cnorxz_flags
|
||||||
|
|
||||||
default_extension_args = dict(
|
default_extension_args = dict(
|
||||||
language = "c++",
|
language = "c++",
|
||||||
|
|
Loading…
Reference in a new issue