Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
// pygnssutils VSCode workflow.
//
// 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
// "C:/Users/user/pygpsclient/Scripts/python.exe" on windows
"python.testing.pytestEnabled": true,
"python.terminal.activateEnvironment": true,
"editor.formatOnSave": true,
"modulename": "${workspaceFolderBasename}",
"distname": "${workspaceFolderBasename}",
"modulename": "pygnssutils",
"distname": "pygnssutils",
"venv": "${userHome}/pygpsclient",
"python.testing.pytestArgs": [
"tests"
Expand All @@ -22,6 +24,9 @@
"python.analysis.addHoverSummaries": false,
"python-envs.defaultEnvManager": "ms-python.python:venv",
"python-envs.pythonProjects": [],
"python.venvPath": "${userHome}/pygpsclient/bin/python3",
"python.systemPath": "/usr/local/bin/python3.14",
"python.defaultInterpreterPath": "${userHome}/pygpsclient/bin/python3",
//"python.defaultInterpreterPath": "C:/Users/steve/pygpsclient/Scripts/python.exe",
"python.testing.unittestEnabled": false
}
191 changes: 117 additions & 74 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,79 @@
{
// These test, build and deploy tasks are targeted at a venv
// pygnssutils VSCode workflow.
//
// These build, install and test 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
// "${userHome}/pygpsclient/bin/python3" on Linux/MacOS
// "C:/Users/user/pygpsclient/Scripts/python.exe" on Windows
//
// The "Test" task will initialise the venv and execute all
// necessary build and installation precursors.
//
"version": "2.0.0",
"tasks": [
{
"label": "Delete Venv",
"type": "shell",
"command": "rm",
"args": [
"-rf",
"${config:venv}",
],
"problemMatcher": []
},
{
"label": "Create Venv",
"type": "process",
"command": "${config:python.defaultInterpreterPath}",
"type": "shell",
"command": "${config:python.systemPath}",
"args": [
"-m",
"venv",
"${config:venv}",
//"--system-site-packages"
],
"problemMatcher": []
"problemMatcher": [],
"dependsOrder": "sequence",
"dependsOn": [
"Delete Venv",
],
},
{
"label": "Run Local Version",
"type": "process",
"command": "${config:python.defaultInterpreterPath}",
"label": "Activate Venv",
"type": "shell",
"command": "source",
"args": [
"-m",
"pygpsclient",
"--ntripcasteruser",
"semuadmin",
"--ntripcasterpassword",
"testpassword",
"--verbosity",
"3"
"~/pygpsclient/bin/activate",
],
"options": {
"cwd": "src"
},
"problemMatcher": []
"problemMatcher": [],
},
{
"label": "Install Deploy Dependencies",
"type": "process",
"type": "shell",
"command": "${config:python.defaultInterpreterPath}",
"args": [
"-m",
"pip",
"install",
"--upgrade",
"--group",
"deploy"
],
"problemMatcher": []
"problemMatcher": [],
},
{
"label": "Install Optional Dependencies",
"type": "shell",
"command": "${config:python.defaultInterpreterPath}",
"args": [
"-m",
"pip",
"install",
"--upgrade",
"--group",
"optional"
],
"problemMatcher": [],
},
{
"label": "Clean",
Expand All @@ -64,13 +88,14 @@
"${config:modulename}.egg-info",
],
"windows": {
"command": "rm",
"command": "Remove-Item",
"args": [
"-R",
"-Path",
"'src/${config:modulename}.egg-info','build','dist','htmlcov','docs/_build'",
"-Recurse",
"-Force",
"-ErrorAction",
"SilentlyContinue" // doesn't work! - stops on exit code 1 anyway
"SilentlyContinue", // doesn't work! - stops on exit code 1 anyway
"-Path",
"'build','dist','htmlcov','docs/_build','src/${config:modulename}.egg-info'",
]
},
"options": {
Expand All @@ -80,7 +105,7 @@
},
{
"label": "Sort Imports",
"type": "process",
"type": "shell",
"command": "${config:python.defaultInterpreterPath}",
"args": [
"-m",
Expand All @@ -93,7 +118,7 @@
},
{
"label": "Format",
"type": "process",
"type": "shell",
"command": "${config:python.defaultInterpreterPath}",
"args": [
"-m",
Expand All @@ -116,60 +141,91 @@
{
"label": "Security",
"type": "process",
"command": "${config:python.defaultInterpreterPath}",
"command": "bandit",
"args": [
"-m",
"bandit",
"-c",
"pyproject.toml",
"-r",
"."
"src/pygpsclient"
],
"problemMatcher": []
},
{
"label": "Test",
"type": "process",
"label": "Build",
"type": "shell",
"command": "${config:python.defaultInterpreterPath}",
"args": [
"-m",
"pytest"
"build",
".",
"--wheel",
"--sdist",
],
"problemMatcher": [],
"dependsOrder": "sequence",
"dependsOn": [
//"Create Venv",
"Install Deploy Dependencies",
"Install Optional Dependencies",
"Clean",
"Sort Imports",
"Format",
],
"group": {
"kind": "test",
"kind": "build",
"isDefault": true
}
},
{
"label": "Build",
"type": "process",
"label": "Install", // into Virtual Environment
"type": "shell",
"command": "${config:python.defaultInterpreterPath}",
"args": [
"-m",
"build",
".",
"--wheel",
"--sdist",
"pip",
"install",
"--force-reinstall",
// wildcard only works on Posix platforms
"${workspaceFolder}/dist/pygnssutils-*-py3-none-any.whl",
],
"windows": {
"command": "${config:python.defaultInterpreterPath}",
"args": [
"-m",
"pip",
"install",
"--force-reinstall",
"${workspaceFolder}/dist/pygnssutils-1.1.21-py3-none-any.whl",
]
},
"problemMatcher": [],
},
{
"label": "Test",
"type": "shell",
"command": "${config:python.defaultInterpreterPath}",
"args": [
"-m",
"pytest"
],
"problemMatcher": [],
"dependsOrder": "sequence",
"dependsOn": [
"Clean",
"Security",
"Sort Imports",
"Format",
//"Activate Venv",
"Build",
"Install", // have to install before running pylint
"Pylint",
"Test",
"Security",
"Sphinx HTML",
],
"group": {
"kind": "build",
"kind": "test",
"isDefault": true
}
},
{
"label": "Sphinx",
"type": "process",
"type": "shell",
"command": "sphinx-apidoc",
"args": [
"--ext-autodoc",
Expand All @@ -184,7 +240,7 @@
},
{
"label": "Sphinx HTML",
"type": "process",
"type": "shell",
"command": "/usr/bin/make",
"windows": {
"command": "${workspaceFolder}/docs/make.bat"
Expand All @@ -202,8 +258,8 @@
"problemMatcher": []
},
{
"label": "Sphinx Deploy to S3", // needs AWS credentials
"type": "process",
"label": "Sphinx Deploy", // needs AWS S3 credentials
"type": "shell",
"command": "aws",
"args": [
"s3",
Expand All @@ -219,29 +275,16 @@
"problemMatcher": []
},
{
"label": "Install Locally",
"type": "process",
"label": "Run Installed Version",
"type": "shell",
"command": "${config:python.defaultInterpreterPath}",
"args": [
"-m",
"pip",
"install",
"--upgrade",
"--force-reinstall",
"--find-links=${workspaceFolder}/dist",
"${workspaceFolderBasename}",
// "--target",
// "${config:venv}/Lib/site-packages"
],
"options": {
"cwd": "dist"
},
"dependsOrder": "sequence",
"dependsOn": [
"Build",
"Sphinx HTML"
"pygpsclient",
//"--verbosity",
//"3"
],
"problemMatcher": []
}
},
]
}
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,8 @@ gnssntripclient --server rtk2go.com --port 2101 --https 0 --mountpoint MYBASE --

Command line arguments can be stored in a configuration file and invoked using the `-C` or `--config` argument. The location of the configuration file can be set in environment variable `GNSSNTRIPCLIENT_CONF`.

If the NTRIP caster connection is using a self-sign TLS (HTTPS) certificate, the path to the relevant TLS certificate can be set via environment variable `PYGNSSUTILS_CRTPATH`. The default path is `$HOME\pygnssutils.crt`.

For help and full list of optional arguments, type:

```shell
Expand Down Expand Up @@ -475,12 +477,14 @@ A helper class based on the native Python [`ThreadingTCPServer`](https://docs.py
- `ClientHandler` - unencrypted HTTP connection.
- `ClientHandlerTLS` - encrypted HTTPS (TLS) connection.

**NB:** HTTPS requires a valid x509 TLS certificate/key pair (in pem format) to be located at a path designated by environment variable `PYGNSSUTILS_PEMPATH`. The default path is `$HOME\pygnssutils.pem`. The following openssl command can be used to create a suitable pem file for test and demonstration purposes:
**NB:** HTTPS requires a valid x509 TLS private key / certificate pair (in pem format) to be located at a path designated by environment variable `PYGNSSUTILS_PEMPATH`. The default path is `$HOME\pygnssutils.pem`. The following openssl command can be used to create a suitable pem file for test and demonstration purposes:

```shell
openssl req -x509 -newkey rsa:4096 -keyout pygnssutils.pem -out pygnssutils.pem -sha256 -days 3650 -nodes
```

The TLS Client will only require the certificate from this file, which can be set via environment variable `PYGNSSUTILS_CRTPATH`. The default path is `$HOME\pygnssutils.crt`.

Refer to the [Sphinx API documentation](https://www.semuconsulting.com/pygnssutils/pygnssutils.html#module-pygnssutils.socket_server) for further details.

---
Expand Down
9 changes: 9 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# pygnssutils

### RELEASE 1.1.21

CHANGES:

1. Add CLI arguments for `tlspempath` and `tlscrtpath` to gnssserver and gnssntripclient; will default to paths set in environment variables `PYGNSSUTILS_PEMPATH` and `PYGNSSUTILS_CRTPATH`. Used for TLS encrypted socket server and NTRIP connections which use self-signed TLS certificates.
1. Add CLI argument `ntriprtcmstr` to `gnssserver` and `socket_server`, containing RTCM message type(rate) sourcetable entry for NTRIP caster mode (*was originally 'hard-wired' for ZED-f9P, but pygnssutils now supports a wider range of base station receivers*).
1. Enhance type hints and docstrings.
1. Update VSCode actions & workflow.

### RELEASE 1.1.20

FIXES:
Expand Down
8 changes: 7 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
import os
import sys

sys.path.insert(0, os.path.abspath("../src"))
# get path to site-packages (source) folder within venv
pypath = (
f"{os.path.expanduser("~")}/pygpsclient/lib/python"
f"{sys.version_info.major}.{sys.version_info.minor}/site-packages"
)
print(f"\n\033[1mUsing absolute path:\033[0m \033[95m{pypath}\033[0m\n")
sys.path.insert(0, os.path.abspath(pypath))

from pygnssutils import version as VERSION

Expand Down
Loading