Compare commits

..

10 Commits

Author SHA1 Message Date
ce4a106921 * github workflow: only trigger on pushed tag
* README.md: update python installation
2021-09-22 15:08:57 +02:00
ef5aaac254 github-workflow: flatten directory structure for download artifacts for PyPI upload 2021-09-22 13:45:15 +02:00
86eb20a33b github-workflow: fix relative directory for upload source/binary artifacts 2021-09-22 13:28:16 +02:00
ba275dd62a github-workflow: fix mixed up upload/download source vs. binary wheel artifacts 2021-09-22 13:23:42 +02:00
c2a28fc333 github-workflow: upload/download wheel artifacts for PyPi deployment 2021-09-22 13:20:46 +02:00
71cbe31915 github-workflow: remove macOS from os matrix and reduce set of archs to build for 2021-09-22 12:47:24 +02:00
f6fdb2228b github-workflow: switch to macos-11 to support c++17 2021-09-22 12:41:57 +02:00
b869686f6c github-workflow: download artifacts: specify directory path 2021-09-22 12:32:52 +02:00
3253ad2918 github-workflow: use artifacts to share prepared wheel configuration between jobs 2021-09-22 12:25:57 +02:00
770c0167af * github workflow: add checkout step and use makefile target for file
setup
* add README.rst to gitignore
* makefile: validate wheels, run python example, add README.rst option
* usage.py: fix output directory and simplify for loop
* setup.py: remove unused os module
* setup.cfg: syntax fix
2021-09-22 11:20:28 +02:00
9 changed files with 69 additions and 27 deletions

5
.github/setup.sh vendored
View File

@@ -1,5 +0,0 @@
#!/bin/bash
cat ../README.md | grep '^# IMCtermite' -A 50000 > ../python/README.md
cp -r ../lib ../python/
cp -v ../LICENSE ../python/

View File

@@ -3,7 +3,8 @@ name: Build Python Wheels
on: on:
push: push:
branches: [master] #branches: [master]
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
jobs: jobs:
@@ -11,10 +12,14 @@ jobs:
name: Prepare environment for wheel builds name: Prepare environment for wheel builds
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
- name: Prepare files - uses: actions/checkout@v2
run: | - name: Prepare wheel build
chmod +x "${GITHUB_WORKSPACE}/.github/setup.sh" run: make -C python/ setup
"${GITHUB_WORKSPACE}/.github/setup.sh" - name: Store wheel configuration files
uses: actions/upload-artifact@v2
with:
name: wheel-config
path: python/
build_wheels: build_wheels:
name: Build binary wheels on ${{ matrix.os }} name: Build binary wheels on ${{ matrix.os }}
@@ -22,20 +27,29 @@ jobs:
needs: [build_setup] needs: [build_setup]
strategy: strategy:
matrix: matrix:
os: [ubuntu-20.04, windows-2019, macOS-10.15] os: [ubuntu-20.04, windows-2019]
arch: [auto32, auto64, aarch64, ppc64le, s390x] arch: [auto32, auto64, aarch64]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-python@v2 - uses: actions/setup-python@v2
- name: Install cibuildwheel - name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.1.2 run: python -m pip install cibuildwheel==2.1.2
working-directory: python/ - name: Get wheel configuration files
uses: actions/download-artifact@v2
with:
name: wheel-config
path: python/
- name: Build wheels - name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse run: python -m cibuildwheel --output-dir wheelhouse
working-directory: python/ working-directory: python/
# env: # env:
# CIBW_BUILD: cp36-* cp37-* cp38-* cp39-* cp310-* # CIBW_BUILD: cp36-* cp37-* cp38-* cp39-* cp310-*
- name: Store binary wheels
uses: actions/upload-artifact@v2
with:
name: binary-wheels
path: python/wheelhouse/*.whl
build_sdist: build_sdist:
name: Build source distribution name: Build source distribution
@@ -45,9 +59,20 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install cython - name: Install cython
run: python -m pip install cython==0.29.24 run: python -m pip install cython==0.29.24
- name: Get wheel configuration files
uses: actions/download-artifact@v2
with:
name: wheel-config
path: python/
- name: Build sdist - name: Build sdist
run: python setup.py sdist run: python setup.py sdist
working-directory: python/ working-directory: python/
- name: Store source wheels
uses: actions/upload-artifact@v2
with:
name: source-wheels
path: python/dist/*.tar.gz
upload_pypi: upload_pypi:
name: Upload binary wheels to PyPI name: Upload binary wheels to PyPI
@@ -55,6 +80,17 @@ jobs:
needs: [build_wheels, build_sdist] needs: [build_wheels, build_sdist]
steps: steps:
- name: Get source wheels
uses: actions/download-artifact@v2
with:
name: source-wheels
path: dist/
- name: Get binary wheels
uses: actions/download-artifact@v2
with:
name: binary-wheels
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1 - uses: pypa/gh-action-pypi-publish@release/v1
with: with:
user: __token__ user: __token__

1
.gitignore vendored
View File

@@ -34,6 +34,7 @@ pip/dist/
pip/build/ pip/build/
python/README.md python/README.md
python/README.rst
python/LICENSE python/LICENSE
python/build python/build
python/*.egg-info python/*.egg-info

View File

@@ -150,8 +150,10 @@ To install the latest version simply do
python3 -m pip install IMCtermite python3 -m pip install IMCtermite
``` ```
Note, that _python3_setuptools_ and _gcc version >= 10.2.0_ are required to which provides binary wheels for multiple architectures on _Windows_ and _Linux_
successfully install and use it. and most _Python 3.x_ distributions. However, if your platform/architecture is
not supported you can still compile the source distribution yourself, which
requires _python3_setuptools_ and _gcc version >= 10.2.0_.
## Usage ## Usage

View File

@@ -91,6 +91,9 @@ python-clean:
make -C python/ clean make -C python/ clean
rm -vf IMCtermite*.so rm -vf IMCtermite*.so
python-test:
PYTHONPATH=./ python python/examples/usage.py
#-----------------------------------------------------------------------------# #-----------------------------------------------------------------------------#
# clean # clean

View File

@@ -21,18 +21,18 @@ if len(channelsdata) > 0 :
print(len(chnydata)) print(len(chnydata))
print(len(chnxdata)) print(len(chnxdata))
print()
# print the channels into a specific directory # print the channels into a specific directory
imcraw.print_channels(b"./data",ord(',')) imcraw.print_channels(b"/tmp/",ord(','))
# print all channels separately # print all channels separately
idx = 0 for i,chn in enumerate(channels) :
for chn in channels : print(str(i)+" : "+chn['name']+" : "+chn['uuid'])
print(str(idx)+" : "+chn['name']+" : "+chn['uuid']) filname = os.path.join("/tmp/",str(i) + "_" + chn['name']+".csv")
filname = os.path.join("./data",str(idx) + "_" + chn['name']+".csv")
print(filname) print(filname)
imcraw.print_channel(chn['uuid'].encode(),filname.encode(),ord(',')) imcraw.print_channel(chn['uuid'].encode(),filname.encode(),ord(','))
idx = idx + 1
# print all channels in single file # print all channels in single file
# imcraw.print_table(b"./data/allchannels.csv") imcraw.print_table(b"/tmp/allchannels.csv")

View File

@@ -1,11 +1,13 @@
setup: setup:
cat ../README.md | grep '^# IMCtermite' -A 50000 > ./README.md 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 -r ../lib ./
cp -v ../LICENSE ./ cp -v ../LICENSE ./
setup-clean: setup-clean:
rm -vf README.md LICENSE rm -vf README.md README.rst LICENSE
rm -rf lib/ rm -rf lib/
build: setup build: setup
@@ -16,9 +18,11 @@ build-inplace: setup
build-sdist: setup build-sdist: setup
python setup.py sdist python setup.py sdist
python -m twine check dist/*
build-bdist: setup build-bdist: setup
python setup.py bdist python setup.py bdist
python -m twine check dist/*
build-clean: build-clean:
python setup.py clean --all python setup.py clean --all

View File

@@ -1,8 +1,10 @@
[metadata] [metadata]
name = IMCtermite 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 = file: README.md
# long_description_content_type = text/x-rst
long_description_content_type = text/markdown
version = file: VERSION version = file: VERSION
author = Record Evolution GmbH author = Record Evolution GmbH
author_email = mario.fink@record-evolution.de author_email = mario.fink@record-evolution.de
@@ -12,8 +14,8 @@ license = MIT License
license_files = LICENSE license_files = LICENSE
keywords = IMC, raw, imcFAMOS, imcSTUDIO, imcCRONOS keywords = IMC, raw, imcFAMOS, imcSTUDIO, imcCRONOS
classifiers = classifiers =
Programming Language :: Python :: 3, Programming Language :: Python :: 3
License :: OSI Approved :: MIT License, License :: OSI Approved :: MIT License
Operating System :: OS Independent Operating System :: OS Independent
Topic :: Scientific/Engineering Topic :: Scientific/Engineering
Topic :: Software Development :: Libraries :: Python Modules Topic :: Software Development :: Libraries :: Python Modules

View File

@@ -1,6 +1,5 @@
from setuptools import Extension, setup from setuptools import Extension, setup
from Cython.Build import cythonize from Cython.Build import cythonize
import os
import sys import sys
print("building on platform: "+sys.platform) print("building on platform: "+sys.platform)