diff --git a/.github/setup.sh b/.github/setup.sh deleted file mode 100755 index f727f1a..0000000 --- a/.github/setup.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -cat ../README.md | grep '^# IMCtermite' -A 50000 > ../python/README.md -cp -r ../lib ../python/ -cp -v ../LICENSE ../python/ diff --git a/.github/workflows/pypi-deploy.yml b/.github/workflows/pypi-deploy.yml index 11771fa..64423cc 100644 --- a/.github/workflows/pypi-deploy.yml +++ b/.github/workflows/pypi-deploy.yml @@ -11,10 +11,9 @@ jobs: name: Prepare environment for wheel builds runs-on: ubuntu-20.04 steps: - - name: Prepare files - run: | - chmod +x "${GITHUB_WORKSPACE}/.github/setup.sh" - "${GITHUB_WORKSPACE}/.github/setup.sh" + - uses: actions/checkout@v2 + - name: Prepare wheel build + run: make -C python/ setup build_wheels: name: Build binary wheels on ${{ matrix.os }} diff --git a/.gitignore b/.gitignore index 0532fd2..b4e57bd 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ pip/dist/ pip/build/ python/README.md +python/README.rst python/LICENSE python/build python/*.egg-info diff --git a/makefile b/makefile index a62f853..868587a 100644 --- a/makefile +++ b/makefile @@ -91,6 +91,9 @@ python-clean: make -C python/ clean rm -vf IMCtermite*.so +python-test: + PYTHONPATH=./ python python/examples/usage.py + #-----------------------------------------------------------------------------# # clean diff --git a/python/examples/usage.py b/python/examples/usage.py index e4663dd..51f09e8 100644 --- a/python/examples/usage.py +++ b/python/examples/usage.py @@ -21,18 +21,18 @@ if len(channelsdata) > 0 : print(len(chnydata)) print(len(chnxdata)) +print() # print the channels into a specific directory -imcraw.print_channels(b"./data",ord(',')) +imcraw.print_channels(b"/tmp/",ord(',')) # print all channels separately -idx = 0 -for chn in channels : - print(str(idx)+" : "+chn['name']+" : "+chn['uuid']) - filname = os.path.join("./data",str(idx) + "_" + chn['name']+".csv") +for i,chn in enumerate(channels) : + print(str(i)+" : "+chn['name']+" : "+chn['uuid']) + filname = os.path.join("/tmp/",str(i) + "_" + chn['name']+".csv") print(filname) imcraw.print_channel(chn['uuid'].encode(),filname.encode(),ord(',')) - idx = idx + 1 # print all channels in single file -# imcraw.print_table(b"./data/allchannels.csv") +imcraw.print_table(b"/tmp/allchannels.csv") + diff --git a/python/makefile b/python/makefile index 0b6cb59..67fae81 100644 --- a/python/makefile +++ b/python/makefile @@ -1,11 +1,13 @@ setup: cat ../README.md | grep '^# IMCtermite' -A 50000 > ./README.md + #pandoc -f markdown -t rst -o README.rst README.md + #python -m rstvalidator README.rst cp -r ../lib ./ cp -v ../LICENSE ./ setup-clean: - rm -vf README.md LICENSE + rm -vf README.md README.rst LICENSE rm -rf lib/ build: setup @@ -16,9 +18,11 @@ build-inplace: setup build-sdist: setup python setup.py sdist + python -m twine check dist/* build-bdist: setup python setup.py bdist + python -m twine check dist/* build-clean: python setup.py clean --all diff --git a/python/setup.cfg b/python/setup.cfg index 5f059f6..e0a0a48 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -1,8 +1,10 @@ [metadata] name = IMCtermite -description = Enables extraction of measurement data from binary files with extension 'raw' used by proprietary software imcFAMOS/imcSTUDIO and facilitates its storage in open source file formats +description = Enables extraction of measurement data from binary files with extension 'raw' used by proprietary software imcFAMOS and imcSTUDIO and facilitates its storage in open source file formats long_description = file: README.md +# long_description_content_type = text/x-rst +long_description_content_type = text/markdown version = file: VERSION author = Record Evolution GmbH author_email = mario.fink@record-evolution.de @@ -12,8 +14,8 @@ license = MIT License license_files = LICENSE keywords = IMC, raw, imcFAMOS, imcSTUDIO, imcCRONOS classifiers = - Programming Language :: Python :: 3, - License :: OSI Approved :: MIT License, + Programming Language :: Python :: 3 + License :: OSI Approved :: MIT License Operating System :: OS Independent Topic :: Scientific/Engineering Topic :: Software Development :: Libraries :: Python Modules diff --git a/python/setup.py b/python/setup.py index 6341dcd..709a9fb 100644 --- a/python/setup.py +++ b/python/setup.py @@ -1,6 +1,5 @@ from setuptools import Extension, setup from Cython.Build import cythonize -import os import sys print("building on platform: "+sys.platform)