Skip to content

fix -dt type when not numpy array #134

fix -dt type when not numpy array

fix -dt type when not numpy array #134

name: Upload Python Package on test server
on:
workflow_dispatch:
push:
paths:
- 'src_interfaces/python3_interface.cpp'
- 'include_interfaces/inerfaceTemplate.hpp'
- 'include_interfaces/python3_interface.hpp'
- '.github/workflows/pythonPublishTest.yml'
jobs:
deploy:
name: Compile for ${{ matrix.os }} using ${{ matrix.python }}-${{ matrix.arch }} and upload on packages manager
strategy:
matrix:
OS: [ ubuntu-20.04, windows-latest, macOS-latest]
python: ['3.7', '3.8', '3.9','3.10','3.11', 'pypy-3.8', 'pypy-3.9' ]
arch: [ x64 ]
include:
- os: ubuntu-20.04
python: '3.6'
arch: x64
fail-fast: false
runs-on: ${{ matrix.os }}
env:
NAME: value
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.arch }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
pip install oldest-supported-numpy
pip install setuptools wheel twine packaging
- name: Install Ubuntu dependencies
if : contains( matrix.os, 'ubuntu' )
run: |
sudo add-apt-repository 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu focal main universe'
sudo apt update;
sudo apt install build-essential libzmq3-dev patchelf libtool
sudo apt -y install gcc-7 g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 7
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 7
wget "https://raw.githubusercontent.com/zeromq/cppzmq/master/zmq.hpp" -O include/zmq.hpp
wget 'https://codeload.github.com/open-source-parsers/jsoncpp/zip/master' -O jsoncpp.zip
unzip jsoncpp.zip
cd jsoncpp-master
python amalgamate.py
cd ..
git clone https://github.com/zeromq/libzmq.git
cd libzmq
export CFLAGS="-fPIC"
export CXXFLAGS="-fPIC"
bash ./autogen.sh
./configure --prefix=/tmp/zeromq
make -j
make install
echo "STATIC_ZMQ_PATH=/tmp/zeromq/lib/libzmq.a" >> $GITHUB_ENV
- name: Install macOS dependencies
if : contains( matrix.os, 'macOS' )
run: |
brew install zeromq jsoncpp cppzmq
echo "STATIC_ZMQ_PATH=$(brew --prefix)/lib/libzmq.a" >> $GITHUB_ENV
- name: Add msbuild to PATH
if : contains( matrix.os, 'windows' )
uses: microsoft/setup-msbuild@v1.1
- name: Install Windows dependencies
if : contains( matrix.os, 'windows' )
run: |
cd build/python-build
cmd.exe /c setup_Win_compile_all.bat
- name: Build on Linux or macOS
if: runner.os != 'Windows'
run: |
cd build/python-build
STATIC_ZMQ_PATH=${{ env.STATIC_ZMQ_PATH }} python setup.py --setuptools bdist_wheel
- name: Build on Windows
if: runner.os == 'Windows'
run: |
cd build\python-build
python setup.py --setuptools bdist_wheel
- name: Correct whl for Linux
if : contains( matrix.os, 'ubuntu' )
run: |
cd build/python-build/dist
# pip install auditwheel
# auditwheel repair *.whl
# for wheel in $(find . -iname "*.whl") ; do unzip -o $wheel; patchelf --clear-symbol-version stat --clear-symbol-version _ZSt28__throw_bad_array_new_lengthv g2s/*.so; zip -u $wheel g2s/*.so; done
for wheel in $(find . -iname "*.whl") ; do mv $wheel $(echo $wheel | sed 's/-linux_/-manylinux1_/'); done
- name: Correct whl for macOS
if : contains( matrix.os, 'macOS' )
run: |
cd build/python-build
pip install delocate
delocate-wheel -v dist/*.whl
- name: Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_TEST_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_PASSWORD }}
run: |
cd build/python-build
twine upload dist/*.whl --repository-url https://test.pypi.org/legacy/ --verbose --skip-existing
# --skip-existing