Skip to content

Commit

Permalink
Merged PR 10568: Merge feature/pypi-deployment to master
Browse files Browse the repository at this point in the history
  • Loading branch information
Klug, Stefan authored and Klug, Stefan committed Feb 16, 2021
2 parents 660c4e4 + 273952b commit 8c574c0
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 48 deletions.
40 changes: 35 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ name: build
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
branches:
- '**'
tags:
- '*.*.*'
pull_request:
Expand All @@ -14,6 +15,13 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
TWINE_USERNAME: __token__
# Uncomment the relevant lines to switch between deployment to test.pypi.org or pypi.org
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
# TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
# TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}

jobs:
prepare:
runs-on: ubuntu-18.04
Expand Down Expand Up @@ -62,13 +70,23 @@ jobs:
build-linux:
needs: prepare
runs-on: ubuntu-18.04
# all manylinux builds are expected to fail the verification. Keep them alive nevertheless
continue-on-error: ${{ startsWith( matrix.p, 'manylinux' ) }}
strategy:
fail-fast: false
matrix:
a: [cp34m, cp35m, cp36m, cp37m, cp38, cp39]
p: [linux_x86_64, linux_i686, linux_aarch64, linux_armv7l, manylinux2014_x86_64, manylinux2014_i686]
a: [cp36m, cp37m, cp38, cp39]
p: [manylinux_2_24_x86_64, manylinux_2_24_i686, manylinux_2_24_aarch64, manylinux_2_24_armv7l]

include:
#legacy builds without (out-of-the-box) manylinux/pep-600 support
- {a: cp34m, p: linux_x86_64 }
- {a: cp34m, p: linux_i686 }
- {a: cp34m, p: linux_aarch64 }
- {a: cp34m, p: linux_armv7l }
- {a: cp35m, p: linux_x86_64 }
- {a: cp35m, p: linux_i686 }
- {a: cp35m, p: linux_aarch64 }
- {a: cp35m, p: linux_armv7l }

env:
P: ${{ matrix.p }}
A: ${{ matrix.a }}
Expand Down Expand Up @@ -103,6 +121,12 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: dist/*

- name: Publish package to (Test)PyPI
if: needs.prepare.outputs.is_release_build == 'true' && startsWith( matrix.p, 'manylinux' )
run: |
sudo pip3 install twine
python3 -m twine upload --non-interactive --skip-existing dist/*
build-macos:
Expand Down Expand Up @@ -178,5 +202,11 @@ jobs:
with:
files: dist/*

- name: Publish package to (Test)PyPI
if: needs.prepare.outputs.is_release_build == 'true'
run: |
sudo pip3 install twine
python3 -m twine upload --non-interactive --skip-existing dist/*
87 changes: 52 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,13 @@ You are welcome to post any questions or issues on [GitHub](https://github.com/b
[![Build Status](https://github.com/basler/pypylon/workflows/build/badge.svg?branch=master)](https://github.com/basler/pypylon/actions)
[![Build Status](https://ci.appveyor.com/api/projects/status/45j4tydwdr0fv05p/branch/master?svg=true)](https://ci.appveyor.com/project/basler-oss/pypylon/branch/master)

# For the Impatient
* Install [pylon](https://www.baslerweb.com/pylon).
* Download a binary wheel from the [releases](https://github.com/Basler/pypylon/releases) page.
* Install the wheel using ```pip3 install <your downloaded wheel>.whl```
* Look at samples/grab.py in this repository

# Installation
## Prerequisites
* Installed [pylon](https://www.baslerweb.com/pylon).
* Installed [python](https://www.python.org/) (python 3 recommended).
* Installed [pip](https://pip.pypa.io/en/stable/).

## Binary Installation
The easiest way to get pypylon is to install a prebuild wheel.

Binary releases are available on the [releases](https://github.com/Basler/pypylon/releases) page.

## Installation from Source
Building the pypylon bindings is supported and tested on Windows and Linux.

You need a few more things to compile pypylon:
* A compiler for your system (Visual Studio on Windows, gcc on linux)
* [swig](http://www.swig.org) >= 3.0.12

To build pypylon from source:
```console
git clone https://github.com/basler/pypylon.git
cd pypylon
pip install .
```

# Getting Started
## Hello World
See the [grab sample](https://github.com/basler/pypylon/blob/master/samples/grab.py) in the samples directory.

Excerpt:
* Install [pylon](https://www.baslerweb.com/pylon)
This is strongly recommended but not mandatory. See [known issues](#known-issues) for further details.
* Install pypylon: ```pip3 install pyplon```
For more installation options and the supported systems please read the [Installation](#installation) paragraph.
* Look at [samples/grab.py](https://github.com/basler/pypylon/blob/master/samples/grab.py) or use the following snippet:

```python
from pypylon import pylon
Expand Down Expand Up @@ -73,6 +44,52 @@ while camera.IsGrabbing():
camera.Close()
```

# Installation
## Prerequisites
* Installed [pylon](https://www.baslerweb.com/pylon)
For the binary installation this is not mandator but strongly recommended. See [known issues](#known-issues) for further details.
* Installed [python](https://www.python.org/) with [pip](https://pip.pypa.io/en/stable/)

## Binary Installation
The easiest way to get pypylon is to install a prebuild wheel.
Binary releases for most architectures are available on [pypi](https://pypi.org).
To install pyplon open your favourite terminal and run:

```pip3 install pyplon```

The following versions are available on pypi:

| | 3.4 | 3.5 | 3.6 | 3.6 | 3.7 | 3.8 | 3.9 |
|------------------|-----|-----|-----|-----|-----|-----|-----|
| Windows 32bit | x | x | x | x | x | x | x |
| Windows 64bit | x | x | x | x | x | x | x |
| Linux i686** | -* | -* | x | x | x | x | x |
| Linux x86_64** | -* | -* | x | x | x | x | x |
| Linux armv7l** | -* | -* | x | x | x | x | x |
| Linux aarch64** | -* | -* | x | x | x | x | x |
| Mac OS*** | - | - | x | x | x | x | x |


> Additional Notes on binary packages:
> * (*) The linux wheels for python 3.4 and 3.5 are not available on pypi.
You can get them from [Github Releases](https://github.com/basler/pypylon/releases).
> * (**) The linux binaries are manylinux_2_24 conformant.
This is roughly equivalent to a minimum glibc version >= 2.24
> * (***) MacOS binaries are built for macOS >= 10.14 (Mojave)
## Installation from Source
Building the pypylon bindings is supported and tested on Windows and Linux.

You need a few more things to compile pypylon:
* A compiler for your system (Visual Studio on Windows, gcc on linux)
* [swig](http://www.swig.org) >= 4.0

To build pypylon from source:
```console
git clone https://github.com/basler/pypylon.git
cd pypylon
pip install .
```
# Development

Pull requests to pypylon are very welcome. To help you getting started with pypylon improvements, here are some hints:
Expand All @@ -92,4 +109,4 @@ python tests/....
```
# Known Issues
* For USB 3.0 cameras to work on Linux, you need to install appropriate udev rules.
The easiest way to get them is to install an official pylon package from http://www.baslerweb.com/pylon.
The easiest way to get them is to install the official [pylon](http://www.baslerweb.com/pylon) package.
9 changes: 5 additions & 4 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
Version ?.?.?
- Date ????-??-??
Version 1.7.0rc1
- Date 2021-02-16
- Adapted to python 3.9.
- Added a way to force a certain GenTL search path (used for frame grabber
development).
- Avoided the dependency on vcruntime140_1.dll when building with Visual
Studio 2019.
- Added macos CI builds.
- Migrated from travis to gh-actions for linux and macos.
- Added macOS CI builds.
- Migrated from travis to gh-actions for linux and macOS.
- Added pypi deployments for linux and macOS

Version 1.6.0
- Date 2020-08-20
Expand Down
5 changes: 3 additions & 2 deletions scripts/build/Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN if cat /etc/debian_version | grep -q "8\." ; then \
apt-get -o Acquire::Check-Valid-Until=false update; \
fi

RUN pip install wheel
RUN pip install wheel auditwheel
#build a new swig
RUN mkdir /build && \
cd /build && \
Expand All @@ -31,7 +31,8 @@ RUN mkdir /build && \
# RUN pip install numpy

# one genicam unittest requires a french locale
RUN apt-get update && apt-get install -y locales \
# patchelf, unzip are needed for auditwheel
RUN apt-get update && apt-get install -y locales patchelf unzip\
&& rm -rf /var/lib/apt/lists/* \
&& sed -i 's/^# *\(fr_FR.UTF-8\)/\1/' /etc/locale.gen \
&& locale-gen
Expand Down
8 changes: 6 additions & 2 deletions scripts/build/build-arch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ PYLON_ARCH=""
PYLON=""

BUILD_DISTRO="debian"
if [[ $PLATFORM_TAG =~ manylinux* ]]; then
if [[ $PLATFORM_TAG =~ manylinux2014* ]]; then
BUILD_DISTRO="manylinux"
fi

Expand Down Expand Up @@ -89,11 +89,15 @@ case $PLATFORM_TAG in
linux_i686) QEMU_ARCH="i386"; BASE_IMAGE="i386/$BASE_IMAGE"; PYLON_ARCH=x86 ; CMD_WRAPPER=linux32 ;;
linux_armv7l) QEMU_ARCH="arm"; BASE_IMAGE="arm32v7/$BASE_IMAGE"; PYLON_ARCH=armhf CMD_WRAPPER=linux32 ;;
linux_aarch64) QEMU_ARCH="aarch64"; BASE_IMAGE="arm64v8/$BASE_IMAGE"; PYLON_ARCH=aarch64 ;;
manylinux_2_24_x86_64) QEMU_ARCH="x86_64"; BASE_IMAGE="amd64/$BASE_IMAGE"; PYLON_ARCH=x86_64 ;;
manylinux_2_24_i686) QEMU_ARCH="i386"; BASE_IMAGE="i386/$BASE_IMAGE"; PYLON_ARCH=x86 ; CMD_WRAPPER=linux32 ;;
manylinux_2_24_armv7l) QEMU_ARCH="arm"; BASE_IMAGE="arm32v7/$BASE_IMAGE"; PYLON_ARCH=armhf CMD_WRAPPER=linux32 ;;
manylinux_2_24_aarch64) QEMU_ARCH="aarch64"; BASE_IMAGE="arm64v8/$BASE_IMAGE"; PYLON_ARCH=aarch64 ;;
manylinux2014_x86_64) QEMU_ARCH="x86_64"; BASE_IMAGE="quay.io/pypa/manylinux2014_x86_64"; PYLON_ARCH=x86_64 ;;
manylinux2014_i686) QEMU_ARCH="i386"; BASE_IMAGE="quay.io/pypa/manylinux2014_i686"; PYLON_ARCH=x86 ; CMD_WRAPPER=linux32 ;;
manylinux2014_aarch64) QEMU_ARCH="aarch64"; BASE_IMAGE="quay.io/pypa/manylinux2014_aarch64"; PYLON_ARCH=aarch64 ;;
*)
echo "Unsupported platform tag '$PLATFORM_TAG'. Supported platforms: linux_x86_64, linux_i686, linux_armv7l, linux_aarch64, manylinux2014_x86_64, manylinux2014_i686, manylinux2014_aarch64"
echo "Unsupported platform tag '$PLATFORM_TAG'. Supported platforms: linux_x86_64, linux_i686, linux_armv7l, linux_aarch64, manylinux2014_x86_64, manylinux2014_i686, manylinux2014_aarch64, manylinux_2_24_<arch>"
exit 1
esac

Expand Down

0 comments on commit 8c574c0

Please sign in to comment.