From 7907301143a5eee52b093432949c1eafb5d09827 Mon Sep 17 00:00:00 2001 From: SEMU Admin <28569967+semuadmin@users.noreply.github.com> Date: Wed, 15 Oct 2025 15:40:53 +0100 Subject: [PATCH] make cryptography optional --- .github/workflows/checkpr.yml | 4 +++- .github/workflows/main.yml | 4 +++- .vscode/settings.json | 11 ++++++++--- .vscode/tasks.json | 31 +++++++------------------------ README.md | 12 +++++++++--- RELEASE_NOTES.md | 8 ++++++++ pyproject.toml | 14 ++++++++------ src/pyspartn/_version.py | 2 +- 8 files changed, 47 insertions(+), 39 deletions(-) diff --git a/.github/workflows/checkpr.yml b/.github/workflows/checkpr.yml index 368149f..8b181f2 100644 --- a/.github/workflows/checkpr.yml +++ b/.github/workflows/checkpr.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.9, "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14.0-rc.2"] steps: - uses: actions/checkout@v4 @@ -18,6 +18,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install deploy dependencies run: pip install --group deploy + - name: Install optional cryptography dependencies + run: pip install --group crypto - name: Install code dependencies run: pip install . - name: Lint with pylint diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a98c493..1af9722 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.9, "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14.0-rc.2"] steps: - uses: actions/checkout@v4 @@ -20,6 +20,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install deploy dependencies run: pip install --group deploy + - name: Install optional cryptography dependencies + run: pip install --group crypto - name: Install code dependencies run: pip install . - name: Lint with pylint diff --git a/.vscode/settings.json b/.vscode/settings.json index 1c40c1e..ae37172 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,11 +1,16 @@ { - "python.testing.unittestEnabled": false, + // These test, build and deploy tasks are targeted at a venv + // called 'pygpsclient' located in the user's home directory. + // Set your workspace default VSCode Python interpreter to + // this venv, i.e. + // "${userHome}/pygpsclient/bin/python3" on linux/macos + // "${userHome}/pygpsclient/Scripts/python" on windows "python.testing.pytestEnabled": true, "python.terminal.activateEnvironment": true, "editor.formatOnSave": true, "modulename": "${workspaceFolderBasename}", "distname": "${workspaceFolderBasename}", - "venv": "${env:HOME}/pygpsclient", + "venv": "${userHome}/pygpsclient", "python.testing.pytestArgs": [ "tests" ], @@ -17,5 +22,5 @@ "python.analysis.addHoverSummaries": false, "python-envs.defaultEnvManager": "ms-python.python:venv", "python-envs.pythonProjects": [], - "python.defaultInterpreterPath": "/Users/steve/pygpsclient/bin/python3", + "python.defaultInterpreterPath": "${userHome}/pygpsclient/bin/python3" } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 9a8a203..51f1aea 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,18 +1,10 @@ { - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - // - // This VSCode development workflow is intended to work on - // MacOS, Linux and Windows (with Powershell>=5.1). - // - // Use the Install Deploy Dependencies tasks to install the necessary - // build and test packages into the system environment. - // - // Use the Create Venv task to create a virtual environment in the - // designated directory. Select this environment using Select - // Interpreter to auto-activate it via New Terminal. - // - // Remember to include any global Python bin (Scripts on Windows) in PATH. + // These test, build and deploy tasks are targeted at a venv + // called 'pygpsclient' located in the user's home directory. + // Set your workspace default VSCode Python interpreter to + // this venv, i.e. + // "${userHome}/pygpsclient/bin/python3" on linux/macos + // "${userHome}/pygpsclient/Scripts/python" on windows "version": "2.0.0", "tasks": [ { @@ -250,15 +242,6 @@ "Sphinx HTML" ], "problemMatcher": [] - }, - { - "label": "Benchmark", - "type": "process", - "command": "${config:python.defaultInterpreterPath}", - "args": [ - "${workspaceFolder}/examples/benchmark.py", - ], - "problemMatcher": [] - }, + } ] } \ No newline at end of file diff --git a/README.md b/README.md index 01579d7..a207174 100644 --- a/README.md +++ b/README.md @@ -55,9 +55,9 @@ Contributions welcome - please refer to [CONTRIBUTING.MD](https://github.com/sem [![PyPI version](https://img.shields.io/pypi/v/pyspartn)](https://pypi.org/project/pyspartn/) [![PyPI downloads](https://github.com/semuconsulting/pygpsclient/blob/master/images/clickpy_top10.svg?raw=true)](https://clickpy.clickhouse.com/dashboard/pyspartn) -`pyspartn` is compatible with Python >= 3.9. It utilises the Python `cryptography` package to decrypt SPARTN message payloads*¹ ²*. +`pyspartn` is compatible with Python >= 3.10. -In the following, `python3` & `pip` refer to the Python 3 executables. You may need to substitute `python` for `python3`, depending on your particular environment (*on Windows it's generally `python`*). **It is strongly recommended that** the Python 3 binaries (\Scripts or /bin) and site_packages directories are included in your PATH (*most standard Python 3 installation packages will do this automatically if you select the 'Add to PATH' option during installation*). +In the following, `python3` & `pip` refer to the Python 3 executables. You may need to substitute `python` for `python3`, depending on your particular environment (*on Windows it's generally `python`*). The recommended way to install the latest version of `pyspartn` is with [pip](http://pypi.python.org/pypi/pip/): @@ -73,7 +73,13 @@ source env/bin/activate # (or env\Scripts\activate on Windows) python3 -m pip install --upgrade pyspartn ``` -*¹* From `pyspartn` version 1.0.7 onwards, SPARTN decryption functionality is optional. To install without decryption support, use the `--no-deps` argument e.g. ```python3 -m pip install --upgrade pyspartn --no-deps```. The boolean attribute `pyspartn.HASCRYPTO` can be used to test if decryption support is available at runtime. +`pyspartn` can utilise the Python `cryptography` package to decrypt encrypted SPARTN message payloads*¹ ²*, but as of version 1.0.8 this is *not* installed by default. To enable SPARTN decryption support, install the `cryptography` package separately: + +```shell +python3 -m pip install --upgrade cryptography +``` + +*¹* The boolean attribute `pyspartn.HASCRYPTO` can be used to test if decryption support is available at runtime. *²* On some 32-bit Linux platforms (e.g. Raspberry Pi OS 32), it may be necessary to [install Rust compiler support](https://www.rust-lang.org/tools/install) in order to install the `cryptography` package which `pyspartn` depends on to decrypt SPARTN message payloads. See [cryptography install README](https://github.com/semuconsulting/pyspartn/blob/main/cryptography_installation/README.md). diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index f6262a0..ea85cb2 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,5 +1,13 @@ # pyspartn Release Notes +### RELEASE 1.0.8 + +1. As of October 2025, u-blox have discontinued all their encrypted SPARTN services (PointPerfect L-Band and MQTT). For this reason, the `cryptography` package used for SPARTN message decryption is now an *optional* dependency for `pyspartn`. To enable decryption support, install `cryptography` separately e.g. + +```shell +python3 -m pip install --upgrade cryptography +``` + ### RELEASE 1.0.7 1. Make SPARTN decryption (and associated `cryptography` library dependencies) an optional feature, to avoid a hard dependency on the `cryptography` library (which can be problematic on some platforms). To install without SPARTN decryption support, use `python3 -m pip install pyspartn --no-deps`. diff --git a/pyproject.toml b/pyproject.toml index f4abe48..6322797 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ description = "SPARTN protocol parser" license = "BSD-3-Clause" license-files = ["LICENSE"] readme = "README.md" -requires-python = ">=3.9" +requires-python = ">=3.10" classifiers = [ "Operating System :: OS Independent", "Development Status :: 5 - Production/Stable", @@ -23,7 +23,6 @@ classifiers = [ "Intended Audience :: Science/Research", "Intended Audience :: End Users/Desktop", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -34,7 +33,7 @@ classifiers = [ "Topic :: Scientific/Engineering :: GIS", ] -dependencies = ["cryptography>=45.0.0"] +dependencies = [] [project.urls] homepage = "https://github.com/semuconsulting/pyspartn" @@ -63,16 +62,19 @@ test = [ "Sphinx", "sphinx-rtd-theme", ] +crypto = [ + "cryptography>=45.0.0" +] deploy = [{ include-group = "build" }, { include-group = "test" }] [tool.setuptools.dynamic] version = { attr = "pyspartn._version.__version__" } [tool.black] -target-version = ['py39'] +target-version = ['py310'] [tool.isort] -py_version = 39 +py_version = 310 profile = "black" [tool.bandit] @@ -83,7 +85,7 @@ skips = [] jobs = 0 reports = "y" recursive = "y" -py-version = "3.9" +py-version = "3.10" fail-under = "9.8" fail-on = "E,F" clear-cache-post-run = "y" diff --git a/src/pyspartn/_version.py b/src/pyspartn/_version.py index ccc44fe..ec82e08 100644 --- a/src/pyspartn/_version.py +++ b/src/pyspartn/_version.py @@ -8,4 +8,4 @@ :license: BSD 3-Clause """ -__version__ = "1.0.7" +__version__ = "1.0.8"