Skip to content
Snippets Groups Projects
Commit cad4c6f6 authored by Ian Bell's avatar Ian Bell
Browse files

Invert logic so python reads C++ header rather than vice-versa

parent c635b59c
No related branches found
No related tags found
No related merge requests found
#include <string>
const std::string TEQPVERSION = "0.3.1.dev";
\ No newline at end of file
...@@ -6,14 +6,18 @@ import sys ...@@ -6,14 +6,18 @@ import sys
import platform import platform
import subprocess import subprocess
import shutil import shutil
import re
from setuptools import setup, Extension from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext from setuptools.command.build_ext import build_ext
from distutils.version import LooseVersion from distutils.version import LooseVersion
VERSION = '0.3.1.dev' # VERSION is now read from teqpversion.hpp header file
with open('interface/teqpversion.hpp','w') as fpver: match = re.search(r'TEQPVERSION = \"([0-9a-z.]+)\"\;', open('interface/teqpversion.hpp').read())
fpver.write(f'#include <string>\nconst std::string TEQPVERSION = "{VERSION}";') if match != 1:
VERSION = match.group(1)
else:
raise ValueError("Unable to parse version string from interface/teqpversion.hpp")
here = os.path.dirname(os.path.abspath(__file__)) here = os.path.dirname(os.path.abspath(__file__))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment