Compare commits
8 Commits
v1.0.1
...
53fea5f738
Author | SHA1 | Date | |
---|---|---|---|
![]() |
53fea5f738 | ||
![]() |
c407abe517 | ||
f8f779136b | |||
35c5ac9e75 | |||
d2453427c7 | |||
6b7e0258b3 | |||
![]() |
dc23b1e753 | ||
![]() |
1e2b344104 |
10
README.md
10
README.md
@@ -160,19 +160,21 @@ make cython-requirements
|
|||||||
make cython-install
|
make cython-install
|
||||||
```
|
```
|
||||||
|
|
||||||
That makes the module available for import as a `import tdm_termite` .
|
which makes the module available for import by `import tdm_termite` .
|
||||||
|
|
||||||
#### Installation with pip
|
#### Installation with pip
|
||||||
|
|
||||||
The package is also available via the [Python Package Index](https://pypi.org) at
|
The package is also available via the [Python Package Index](https://pypi.org) at
|
||||||
[TDMtermite](https://pypi.org/project/TDMtermite/). To install the latest version simply do
|
[TDMtermite](https://pypi.org/project/TDMtermite/). To install the latest version simply do
|
||||||
|
|
||||||
```Shell
|
```Shell
|
||||||
python3 -m pip install TDMtermite
|
python3 -m pip install TDMtermite
|
||||||
```
|
```
|
||||||
|
|
||||||
Note, that _python3_setuptools_ and _gcc version >= 10.2.0_ are required to
|
##### Unix
|
||||||
successfully install and use it.
|
|
||||||
|
Note, that _python3_setuptools_ and _gcc version >= 10.2.0_ are required to
|
||||||
|
successfully install and use it.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
@@ -2,18 +2,9 @@ from distutils.core import setup
|
|||||||
from distutils.extension import Extension
|
from distutils.extension import Extension
|
||||||
from Cython.Build import cythonize
|
from Cython.Build import cythonize
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
extensions = Extension(
|
print("building on platform: "+sys.platform)
|
||||||
name="tdm_termite",
|
|
||||||
sources=["cython/py_tdm_termite.pyx"],
|
|
||||||
# libraries=[""],
|
|
||||||
# library_dirs=["lib"],
|
|
||||||
include_dirs=["lib","3rdparty/pugixml"],
|
|
||||||
language='c++',
|
|
||||||
extra_compile_args=['-std=c++17','-Wno-unused-variable'],
|
|
||||||
extra_link_args=['-std=c++17'],
|
|
||||||
)
|
|
||||||
|
|
||||||
os.system("git tag > gittags.log")
|
os.system("git tag > gittags.log")
|
||||||
with open ("gittags.log","r") as gt:
|
with open ("gittags.log","r") as gt:
|
||||||
taglst = gt.readlines()
|
taglst = gt.readlines()
|
||||||
@@ -24,6 +15,27 @@ else:
|
|||||||
version = 'unkown'
|
version = 'unkown'
|
||||||
print("building version: "+version)
|
print("building version: "+version)
|
||||||
|
|
||||||
|
if sys.platform == "linux" or sys.platform == "darwin" :
|
||||||
|
cmpargs = ['-std=c++17','-Wno-unused-variable']
|
||||||
|
lnkargs = ['-std=c++17','-Wno-unused-variable']
|
||||||
|
elif sys.platform == "win32" :
|
||||||
|
cmpargs = ['/EHsc','/std:c++17']
|
||||||
|
lnkargs = []
|
||||||
|
else :
|
||||||
|
raise RuntimeError("unknown platform")
|
||||||
|
|
||||||
|
extensions = Extension(
|
||||||
|
name="tdm_termite",
|
||||||
|
sources=["cython/py_tdm_termite.pyx"],
|
||||||
|
# libraries=[""],
|
||||||
|
# library_dirs=["lib"],
|
||||||
|
include_dirs=["lib","3rdparty/pugixml"],
|
||||||
|
language='c++',
|
||||||
|
#extra_compile_args=['-std=c++17','-Wno-unused-variable'],
|
||||||
|
extra_compile_args= cmpargs,
|
||||||
|
extra_link_args= lnkargs,
|
||||||
|
)
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
version=version,
|
version=version,
|
||||||
description='TDMtermite cython extension',
|
description='TDMtermite cython extension',
|
||||||
|
@@ -852,7 +852,7 @@ void tdm_termite::print_group(std::string &id, const char* filename, bool includ
|
|||||||
for ( std::string chn: chngrp.channels_ )
|
for ( std::string chn: chngrp.channels_ )
|
||||||
{
|
{
|
||||||
std::vector<tdmdatatype> chndat = this->get_channel(chn);
|
std::vector<tdmdatatype> chndat = this->get_channel(chn);
|
||||||
if ( chndat.size() > maxrows ) maxrows = chndat.size();
|
if ( chndat.size() > maxrows ) maxrows = (unsigned int)chndat.size();
|
||||||
allchns.push_back(chndat);
|
allchns.push_back(chndat);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -917,7 +917,7 @@ void tdm_termite::check_filename_path(const char* filename)
|
|||||||
|
|
||||||
if ( !std::filesystem::is_directory(pt) )
|
if ( !std::filesystem::is_directory(pt) )
|
||||||
{
|
{
|
||||||
throw std::runtime_error(std::string("directory does not exist: ") + pt.c_str() );
|
throw std::runtime_error( std::string("directory does not exist: ") + pt.u8string() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
17
makefile
17
makefile
@@ -21,7 +21,10 @@ LIB := $(foreach dir,$(shell ls $(LIBB)),-I $(LIBB)$(dir))
|
|||||||
|
|
||||||
# determine git version/commit tag
|
# determine git version/commit tag
|
||||||
GTAG := $(shell git tag | tail -n1)
|
GTAG := $(shell git tag | tail -n1)
|
||||||
|
GTAGV := $(shell git tag | tail -n1 | tr -d 'v')
|
||||||
GHSH := $(shell git rev-parse HEAD | head -c8)
|
GHSH := $(shell git rev-parse HEAD | head -c8)
|
||||||
|
PIPYVS := $(shell grep "version" pip/setup.py | tr -d 'version=",# ')
|
||||||
|
PICGVS := $(shell grep "version" pip/setup.cfg | tr -d 'version=",# ')
|
||||||
|
|
||||||
# define install location
|
# define install location
|
||||||
INST := /usr/local/bin
|
INST := /usr/local/bin
|
||||||
@@ -30,6 +33,18 @@ INST := /usr/local/bin
|
|||||||
OST := $(shell uname)
|
OST := $(shell uname)
|
||||||
CWD := $(shell pwd)
|
CWD := $(shell pwd)
|
||||||
|
|
||||||
|
# --------------------------------------------------------------------------- #
|
||||||
|
# version/tag check
|
||||||
|
|
||||||
|
checkversion:
|
||||||
|
@echo "git tag: "$(GTAG)
|
||||||
|
@echo "git head: "$(GHSH)
|
||||||
|
@echo "pip setup.py version: "$(PIPYVS)
|
||||||
|
@echo "pip setup.cfg version: "$(PICGVS)
|
||||||
|
|
||||||
|
$(GTAGV):
|
||||||
|
@echo "check consistent versions (git tag vs. setup.py): "$(GTAG)" <-> "$(PIPYVS)" "
|
||||||
|
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# CLI tool
|
# CLI tool
|
||||||
|
|
||||||
@@ -116,7 +131,7 @@ docker-clean:
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# pip
|
# pip
|
||||||
|
|
||||||
pip-publish: cython-build
|
pip-publish: $(PIPYVS) cython-build
|
||||||
cd pip/ && make pip-publish
|
cd pip/ && make pip-publish
|
||||||
|
|
||||||
pip-test:
|
pip-test:
|
||||||
|
@@ -7,7 +7,7 @@ pip-sdist: ../cython/py_tdm_termite.pyx ../cython/tdm_termite.pxd ../cython/py_t
|
|||||||
cp -v ../cython/py_tdm_termite.cpp ./
|
cp -v ../cython/py_tdm_termite.cpp ./
|
||||||
cp -v ../lib/*.hpp ../lib/*.cpp ./
|
cp -v ../lib/*.hpp ../lib/*.cpp ./
|
||||||
cp -v ../3rdparty/pugixml/* ./
|
cp -v ../3rdparty/pugixml/* ./
|
||||||
cat ../README.md | head -n316 | tail -n306 > ./README.md
|
cat ../README.md | grep '^# TDMtermite' -A 50000 > ./README.md
|
||||||
cp -v ../LICENSE ./
|
cp -v ../LICENSE ./
|
||||||
# cython py_tdm_termite.pyx -o py_tdm_termite.cpp
|
# cython py_tdm_termite.pyx -o py_tdm_termite.cpp
|
||||||
python3 setup.py sdist
|
python3 setup.py sdist
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = TDMtermite-RecordEvolution
|
name = TDMtermite-RecordEvolution
|
||||||
version = 0.5
|
version = 1.0.1
|
||||||
author = Record Evolution GmbH
|
author = Record Evolution GmbH
|
||||||
author_email = mario.fink@record-evolution.de
|
author_email = mario.fink@record-evolution.de
|
||||||
maintainer = Record Evolution GmbH
|
maintainer = Record Evolution GmbH
|
||||||
|
29
pip/setup.py
29
pip/setup.py
@@ -1,12 +1,24 @@
|
|||||||
|
|
||||||
from setuptools import setup, Extension
|
from setuptools import setup, Extension
|
||||||
|
import sys
|
||||||
|
|
||||||
|
print("building on platform: "+sys.platform)
|
||||||
|
|
||||||
|
if sys.platform == "linux" or sys.platform == "darwin" :
|
||||||
|
cmpargs = ['-std=c++17','-Wno-unused-variable']
|
||||||
|
lnkargs = ['-std=c++17','-Wno-unused-variable']
|
||||||
|
elif sys.platform == "win32" :
|
||||||
|
cmpargs = ['/EHsc','/std:c++17']
|
||||||
|
lnkargs = []
|
||||||
|
else :
|
||||||
|
raise RuntimeError("unknown platform")
|
||||||
|
|
||||||
with open("README.md", "r", encoding="utf-8") as fh:
|
with open("README.md", "r", encoding="utf-8") as fh:
|
||||||
long_description = fh.read()
|
long_description = fh.read()
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="TDMtermite",
|
name="TDMtermite",
|
||||||
version="1.0.0", #version,
|
version="1.0.3",
|
||||||
author="Record Evolution GmbH",
|
author="Record Evolution GmbH",
|
||||||
author_email="mario.fink@record-evolution.de",
|
author_email="mario.fink@record-evolution.de",
|
||||||
maintainer="Record Evolution GmbH",
|
maintainer="Record Evolution GmbH",
|
||||||
@@ -26,11 +38,12 @@ setup(
|
|||||||
],
|
],
|
||||||
ext_modules=[Extension("tdm_termite",
|
ext_modules=[Extension("tdm_termite",
|
||||||
["py_tdm_termite.cpp"],
|
["py_tdm_termite.cpp"],
|
||||||
# libraries_dirs=["cython/"],
|
# libraries_dirs = ["cython/"],
|
||||||
# include_dirs=["3rdparty/pugixml/","lib/"],
|
# include_dirs = ["3rdparty/pugixml/","lib/"],
|
||||||
# depends=["../lib/tdm_termite.hpp"]
|
# depends = ["../lib/tdm_termite.hpp"]
|
||||||
language='c++',
|
language = 'c++',
|
||||||
extra_compile_args=['-std=c++17','-Wno-unused-variable'],
|
extra_compile_args = cmpargs,
|
||||||
extra_link_args=['-std=c++17'],
|
extra_link_args = lnkargs,
|
||||||
)],
|
)
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user