Skip to content

Commit

Permalink
Upgrade Python versions in CI (#1074)
Browse files Browse the repository at this point in the history
  • Loading branch information
jopohl authored Oct 28, 2023
1 parent 26f99e1 commit ec73ce9
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 187 deletions.
33 changes: 18 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,36 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-2019, macos-11]
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
architecture: [x64]
include:
- os: windows-2019
python-version: '3.7'
python-version: '3.8'
architecture: x86
exclude:
- os: windows-2019
python-version: '3.8'
- os: windows-2019
python-version: '3.9'
- os: windows-2019
python-version: '3.10'
- os: macOS-11
python-version: '3.7'
- os: windows-2019
python-version: '3.11'
- os: windows-2019
python-version: '3.12'
- os: macOS-11
python-version: '3.8'
- os: macOS-11
python-version: '3.9'
- os: macOS-11
python-version: '3.10'

- os: macOS-11
python-version: '3.12'
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
Expand Down Expand Up @@ -99,18 +102,18 @@ jobs:
run: python src/urh/cythonext/build.py

- name: Create sdist
if: ${{ matrix.python-version == '3.9' && startsWith(matrix.os, 'ubuntu') }}
if: ${{ matrix.python-version == '3.11' && startsWith(matrix.os, 'ubuntu') }}
run: python setup.py sdist

- run: python setup.py bdist_wheel
if: ${{ !startsWith(matrix.os, 'ubuntu') }}

- name: Build manylinux2014
- name: Build manylinux wheels
if: startsWith(matrix.os, 'ubuntu')
run: |
docker run --rm \
-e PYVER=$(python -c "import sys; print('%s%s' % (sys.version_info.major, sys.version_info.minor))") \
-v `pwd`:/io jopohl/urh_manylinux2014 /io/data/make_manylinux2014_wheels.sh
-v `pwd`:/io jopohl/urh_manylinux2_28 /io/data/make_manylinux_wheels.sh
- name: Check wheel
if: startsWith(matrix.os, 'ubuntu')
Expand Down Expand Up @@ -150,13 +153,13 @@ jobs:
dist/Universal.Radio.Hacker-"$(python src/urh/version.py)".dmg
- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: dist-${{ matrix.os }}
path: dist

- name: Run pytest with coverage
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.python-version == '3.9' }}
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.python-version == '3.11' }}
run: |
touch tests/show_gui
cp tests/.coveragerc .
Expand All @@ -165,7 +168,7 @@ jobs:
coverage html
- name: Run pytest without coverage
if: ${{ !startsWith(matrix.os, 'ubuntu') || matrix.python-version != '3.9' }}
if: ${{ !startsWith(matrix.os, 'ubuntu') || matrix.python-version != '3.11' }}
run: pytest -s -v --junitxml=junit/test-results.xml tests

- uses: ncipollo/release-action@v1
Expand Down
101 changes: 21 additions & 80 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,125 +44,66 @@ publisher = {{USENIX} Association},
</details>

## Installation
URH runs on Windows, Linux and macOS. Click on your operating system below to view installation instructions.

<details>
<summary><b>Windows</b></summary><br/>
URH runs on Windows, Linux and macOS. See below for OS specific installation instructions.

### Windows
On Windows, URH can be installed with its [Installer](https://github.com/jopohl/urh/releases). No further dependencies are required.

If you get an error about missing ```api-ms-win-crt-runtime-l1-1-0.dll```, run Windows Update or directly install [KB2999226](https://support.microsoft.com/en-us/help/2999226/update-for-universal-c-runtime-in-windows).

</details>

<details>
<summary><b>Linux</b></summary>


<details open>
<summary><i>Generic Installation with pip (recommended)</i></summary><br/>

URH is available on [PyPi](https://pypi.org/project/urh/) so you can install it with
### Linux
#### Installation with pipx
URH is available on [PyPi](https://pypi.org/project/urh/) so you can install it, for example, with [pipx](https://pypa.github.io/pipx/):
```bash
# IMPORTANT: Make sure your pip is up to date
sudo python3 -m pip install --upgrade pip # Update your pip installation
sudo python3 -m pip install urh # Install URH
pipx install urh
```
This is the recommended way to install URH on Linux because it comes with __all native extensions__ precompiled.

In order to access your SDR as non-root user, install the according __udev rules__. You can find them [in the wiki](https://github.com/jopohl/urh/wiki/SDR-udev-rules).

</details>

<details>
<summary><i>Install via Package Manager</i></summary><br/>

#### Install via Package Manager
URH is included in the repositories of many linux distributions such as __Arch Linux__, __Gentoo__, __Fedora__, __openSUSE__ or __NixOS__. There is also a package for __FreeBSD__. If available, simply use your package manager to install URH.

__Note__: For native support, you must install the according ```-dev``` package(s) of your SDR(s) such as ```hackrf-dev``` __before__ installing URH.
</details>

<details>
<summary><i>Snap</i></summary><br/>

URH is available as a snap: https://snapcraft.io/urh

</details>

<details>
<summary><i>Docker Image</i></summary><br/>

The official URH docker image is available [here](https://hub.docker.com/r/jopohl/urh/). It has all native backends included and ready to operate.
</details>

</details>

#### Docker Images
The official URH docker image is available [here](https://hub.docker.com/r/jopohl/urh/). It has all native backends included and ready to operate.

<details>
<summary><b>macOS</b></summary>

<details open>
<summary><i>Using DMG</i></summary><br/>
### macOS
#### Using DMG

It is recommended to use __at least macOS 10.14__ when using the DMG available [here](https://github.com/jopohl/urh/releases).

</details>

<details>
<summary><i>With pip</i></summary><br/>

1. Install [Python 3 for Mac OS X](https://www.python.org/downloads/mac-osx/).
_If you experience issues with preinstalled Python, make sure you update to a recent version using the given link._
2. (Optional) Install desired native libs e.g. ```brew install librtlsdr``` for
corresponding native device support.
3. In a terminal, type: ```pip3 install urh```.
4. Type ```urh``` in a terminal to get it started.

</details>

</details>

<details>
<summary><b>Update your installation</b></summary><br/>

If you installed URH via pip you can keep it up to date with ``` python3 -m pip install --upgrade urh ```.

</details>

<details>
<summary><b>Running from source</b></summary>
#### With brew
URH is available as a [homebrew formula](https://formulae.brew.sh/formula/urh) so you can install it with
```commandline
brew install urh
```

<details>
<summary><i>Without installation</i></summary><br/>
### Running from source (OS-agnostic)
#### Without installation

To execute the Universal Radio Hacker without installation, just run:
```bash
```commandline
git clone https://github.com/jopohl/urh/
cd urh/src/urh
./main.py
```

Note, before first usage the C++ extensions will be built.


</details>

<details>
<summary><i>Installing from source</i></summary><br/>
#### Installing from source

To install URH from source you need to have ```python-setuptools``` installed. You can get them with ```python3 -m pip install setuptools```.
Once the setuptools are installed execute:
```bash
```commandline
git clone https://github.com/jopohl/urh/
cd urh
python setup.py install
```

And start the application by typing ```urh``` in a terminal.

</details>

</details>

## Articles
### Hacking stuff with URH
Expand Down
80 changes: 0 additions & 80 deletions data/make_manylinux2014_wheels_full.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

# for adapted jopohl/urh_manylinux
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64/:/usr/local/lib/:/usr/lib64/


touch /tmp/urh_releasing
for PYBIN in /opt/python/*$PYVER*/bin; do # for all if PYVER not set
Expand Down
29 changes: 17 additions & 12 deletions data/manylinux2014.Dockerfile → data/manylinux.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
FROM quay.io/pypa/manylinux2014_x86_64
FROM quay.io/pypa/manylinux_2_28_x86_64

RUN yum -y install wget blas libusb-devel fftw-devel cmake3 boost-devel https://github.com/analogdevicesinc/libiio/releases/download/v0.19/libiio-0.19.g5f5af2e-centos-7-x86_64.rpm
RUN export AIRSPY_VERSION="1.0.9" \
&& export BLADERF_VERSION="2018.08" \
&& export BLADERF_VERSION="2022.11" \
&& export LIMESUITE_VERSION="20.01.0" \
&& export HACKRF_VERSION="v2023.01.1" \
&& export SDRPLAY_VERSION="2.13" \
&& export RTLSDR_VERSION="0.6.0" \
&& export UHD_VERSION="3.15.0.0" \
&& yum -y install wget cmake3 hackrf-devel boost169-devel https://github.com/analogdevicesinc/libiio/releases/download/v0.19/libiio-0.19.g5f5af2e-centos-7-x86_64.rpm \
&& export UHD_VERSION="4.5.0.0" \
# HackRF
&& git clone --branch $HACKRF_VERSION --depth 1 https://github.com/greatscottgadgets/hackrf /tmp/hackrf-$HACKRF_VERSION \
&& cmake3 -Wno-dev -S /tmp/hackrf-$HACKRF_VERSION/host -B /tmp/build_hackrf \
&& make -j$(nproc) -C /tmp/build_hackrf \
&& make -C /tmp/build_hackrf install \
# UHD
&& wget https://github.com/EttusResearch/uhd/archive/v$UHD_VERSION.tar.gz -O /tmp/uhd.tar.gz \
&& tar xf /tmp/uhd.tar.gz -C /tmp \
&& python3.9 -m pip install mako \
&& cmake3 -DBOOST_INCLUDEDIR=/usr/include/boost169/ -DBOOST_LIBRARYDIR=/usr/lib64/boost169/ -DENABLE_EXAMPLES=OFF -DENABLE_UTILS=OFF -DENABLE_C_API=ON -DENABLE_TESTS=OFF -DENABLE_MAN_PAGES=OFF -S /tmp/uhd-$UHD_VERSION/host -B /tmp/build_uhd \
&& python3.10 -m pip install mako \
&& cmake3 -DBOOST_INCLUDEDIR=/usr/include/boost/ -DBOOST_LIBRARYDIR=/usr/lib64/boost/ -DENABLE_EXAMPLES=OFF -DENABLE_UTILS=OFF -DENABLE_C_API=ON -DENABLE_TESTS=OFF -DENABLE_MAN_PAGES=OFF -S /tmp/uhd-$UHD_VERSION/host -B /tmp/build_uhd \
&& make -j$(nproc) -C /tmp/build_uhd \
&& make -C /tmp/build_uhd install \
# AirSpy
Expand All @@ -21,21 +27,20 @@ RUN export AIRSPY_VERSION="1.0.9" \
&& make -j$(nproc) -C /tmp/build_airspy \
&& make -C /tmp/build_airspy install \
# BladeRF
&& wget https://github.com/Nuand/bladeRF/archive/$BLADERF_VERSION.tar.gz -O /tmp/bladeRF.tar.gz \
&& tar xf /tmp/bladeRF.tar.gz -C /tmp \
&& cmake3 -Wno-dev -S /tmp/bladeRF-$BLADERF_VERSION/host -B /tmp/build_blade \
&& git clone --branch $BLADERF_VERSION --recursive https://github.com/Nuand/bladeRF /tmp/bladeRF-$BLADERF_VERSION \
&& cmake -S /tmp/bladeRF-$BLADERF_VERSION/host -B /tmp/build_blade \
&& make -j$(nproc) -C /tmp/build_blade \
&& make -C /tmp/build_blade install \
&& wget https://github.com/myriadrf/LimeSuite/archive/v$LIMESUITE_VERSION.tar.gz -O /tmp/lime.tar.gz \
# Lime
&& wget https://github.com/myriadrf/LimeSuite/archive/v$LIMESUITE_VERSION.tar.gz -O /tmp/lime.tar.gz \
&& tar xf /tmp/lime.tar.gz -C /tmp \
&& cmake3 -S /tmp/LimeSuite-$LIMESUITE_VERSION -B /tmp/build_lime \
&& cmake -S /tmp/LimeSuite-$LIMESUITE_VERSION -B /tmp/build_lime \
&& make -j$(nproc) -C /tmp/build_lime \
&& make -C /tmp/build_lime install \
# RTLSDR
&& wget https://github.com/osmocom/rtl-sdr/archive/$RTLSDR_VERSION.tar.gz -O /tmp/rtlsdr.tar.gz \
&& tar xf /tmp/rtlsdr.tar.gz -C /tmp \
&& cmake3 -DDETACH_KERNEL_DRIVER=ON -S /tmp/rtl-sdr-$RTLSDR_VERSION -B /tmp/build_rtlsdr \
&& cmake -DDETACH_KERNEL_DRIVER=ON -S /tmp/rtl-sdr-$RTLSDR_VERSION -B /tmp/build_rtlsdr \
&& make -j$(nproc) -C /tmp/build_rtlsdr \
&& make -C /tmp/build_rtlsdr install \
# SDRPLAY
Expand Down
1 change: 1 addition & 0 deletions src/urh/util/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def set_shared_library_path():
current_path = os.environ.get("PATH", '')
if not current_path.startswith(shared_lib_dir):
os.environ["PATH"] = shared_lib_dir + os.pathsep + current_path
os.add_dll_directory(shared_lib_dir)
else:
# LD_LIBRARY_PATH will not be considered at runtime so we explicitly load the .so's we need
exts = [".so"] if sys.platform == "linux" else [".so", ".dylib"]
Expand Down

0 comments on commit ec73ce9

Please sign in to comment.