Skip to content

Commit d66ab71

Browse files
authored
Merge pull request #130 from semuconsulting/RELEASE-CANDIDATE-1.1.21
RC 1.1.21
2 parents 6f19ea2 + 21b235a commit d66ab71

18 files changed

+363
-175
lines changed

.vscode/settings.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
2+
// pygnssutils VSCode workflow.
3+
//
24
// These test, build and deploy tasks are targeted at a venv
35
// called 'pygpsclient' located in the user's home directory.
46
// Set your workspace default VSCode Python interpreter to
57
// this venv, i.e.
68
// "${userHome}/pygpsclient/bin/python3" on linux/macos
7-
// "${userHome}/pygpsclient/Scripts/python" on windows
9+
// "C:/Users/user/pygpsclient/Scripts/python.exe" on windows
810
"python.testing.pytestEnabled": true,
911
"python.terminal.activateEnvironment": true,
1012
"editor.formatOnSave": true,
11-
"modulename": "${workspaceFolderBasename}",
12-
"distname": "${workspaceFolderBasename}",
13+
"modulename": "pygnssutils",
14+
"distname": "pygnssutils",
1315
"venv": "${userHome}/pygpsclient",
1416
"python.testing.pytestArgs": [
1517
"tests"
@@ -22,6 +24,9 @@
2224
"python.analysis.addHoverSummaries": false,
2325
"python-envs.defaultEnvManager": "ms-python.python:venv",
2426
"python-envs.pythonProjects": [],
27+
"python.venvPath": "${userHome}/pygpsclient/bin/python3",
28+
"python.systemPath": "/usr/local/bin/python3.14",
2529
"python.defaultInterpreterPath": "${userHome}/pygpsclient/bin/python3",
30+
//"python.defaultInterpreterPath": "C:/Users/steve/pygpsclient/Scripts/python.exe",
2631
"python.testing.unittestEnabled": false
2732
}

.vscode/tasks.json

Lines changed: 117 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,79 @@
11
{
2-
// These test, build and deploy tasks are targeted at a venv
2+
// pygnssutils VSCode workflow.
3+
//
4+
// These build, install and test tasks are targeted at a venv
35
// called 'pygpsclient' located in the user's home directory.
46
// Set your workspace default VSCode Python interpreter to
57
// this venv, i.e.
6-
// "${userHome}/pygpsclient/bin/python3" on linux/macos
7-
// "${userHome}/pygpsclient/Scripts/python" on windows
8+
// "${userHome}/pygpsclient/bin/python3" on Linux/MacOS
9+
// "C:/Users/user/pygpsclient/Scripts/python.exe" on Windows
10+
//
11+
// The "Test" task will initialise the venv and execute all
12+
// necessary build and installation precursors.
13+
//
814
"version": "2.0.0",
915
"tasks": [
16+
{
17+
"label": "Delete Venv",
18+
"type": "shell",
19+
"command": "rm",
20+
"args": [
21+
"-rf",
22+
"${config:venv}",
23+
],
24+
"problemMatcher": []
25+
},
1026
{
1127
"label": "Create Venv",
12-
"type": "process",
13-
"command": "${config:python.defaultInterpreterPath}",
28+
"type": "shell",
29+
"command": "${config:python.systemPath}",
1430
"args": [
1531
"-m",
1632
"venv",
1733
"${config:venv}",
18-
//"--system-site-packages"
1934
],
20-
"problemMatcher": []
35+
"problemMatcher": [],
36+
"dependsOrder": "sequence",
37+
"dependsOn": [
38+
"Delete Venv",
39+
],
2140
},
2241
{
23-
"label": "Run Local Version",
24-
"type": "process",
25-
"command": "${config:python.defaultInterpreterPath}",
42+
"label": "Activate Venv",
43+
"type": "shell",
44+
"command": "source",
2645
"args": [
27-
"-m",
28-
"pygpsclient",
29-
"--ntripcasteruser",
30-
"semuadmin",
31-
"--ntripcasterpassword",
32-
"testpassword",
33-
"--verbosity",
34-
"3"
46+
"~/pygpsclient/bin/activate",
3547
],
36-
"options": {
37-
"cwd": "src"
38-
},
39-
"problemMatcher": []
48+
"problemMatcher": [],
4049
},
4150
{
4251
"label": "Install Deploy Dependencies",
43-
"type": "process",
52+
"type": "shell",
4453
"command": "${config:python.defaultInterpreterPath}",
4554
"args": [
4655
"-m",
4756
"pip",
4857
"install",
58+
"--upgrade",
4959
"--group",
5060
"deploy"
5161
],
52-
"problemMatcher": []
62+
"problemMatcher": [],
63+
},
64+
{
65+
"label": "Install Optional Dependencies",
66+
"type": "shell",
67+
"command": "${config:python.defaultInterpreterPath}",
68+
"args": [
69+
"-m",
70+
"pip",
71+
"install",
72+
"--upgrade",
73+
"--group",
74+
"optional"
75+
],
76+
"problemMatcher": [],
5377
},
5478
{
5579
"label": "Clean",
@@ -64,13 +88,14 @@
6488
"${config:modulename}.egg-info",
6589
],
6690
"windows": {
67-
"command": "rm",
91+
"command": "Remove-Item",
6892
"args": [
69-
"-R",
70-
"-Path",
71-
"'src/${config:modulename}.egg-info','build','dist','htmlcov','docs/_build'",
93+
"-Recurse",
94+
"-Force",
7295
"-ErrorAction",
73-
"SilentlyContinue" // doesn't work! - stops on exit code 1 anyway
96+
"SilentlyContinue", // doesn't work! - stops on exit code 1 anyway
97+
"-Path",
98+
"'build','dist','htmlcov','docs/_build','src/${config:modulename}.egg-info'",
7499
]
75100
},
76101
"options": {
@@ -80,7 +105,7 @@
80105
},
81106
{
82107
"label": "Sort Imports",
83-
"type": "process",
108+
"type": "shell",
84109
"command": "${config:python.defaultInterpreterPath}",
85110
"args": [
86111
"-m",
@@ -93,7 +118,7 @@
93118
},
94119
{
95120
"label": "Format",
96-
"type": "process",
121+
"type": "shell",
97122
"command": "${config:python.defaultInterpreterPath}",
98123
"args": [
99124
"-m",
@@ -116,60 +141,91 @@
116141
{
117142
"label": "Security",
118143
"type": "process",
119-
"command": "${config:python.defaultInterpreterPath}",
144+
"command": "bandit",
120145
"args": [
121-
"-m",
122-
"bandit",
123146
"-c",
124147
"pyproject.toml",
125148
"-r",
126-
"."
149+
"src/pygpsclient"
127150
],
128151
"problemMatcher": []
129152
},
130153
{
131-
"label": "Test",
132-
"type": "process",
154+
"label": "Build",
155+
"type": "shell",
133156
"command": "${config:python.defaultInterpreterPath}",
134157
"args": [
135158
"-m",
136-
"pytest"
159+
"build",
160+
".",
161+
"--wheel",
162+
"--sdist",
137163
],
138164
"problemMatcher": [],
165+
"dependsOrder": "sequence",
166+
"dependsOn": [
167+
//"Create Venv",
168+
"Install Deploy Dependencies",
169+
"Install Optional Dependencies",
170+
"Clean",
171+
"Sort Imports",
172+
"Format",
173+
],
139174
"group": {
140-
"kind": "test",
175+
"kind": "build",
141176
"isDefault": true
142177
}
143178
},
144179
{
145-
"label": "Build",
146-
"type": "process",
180+
"label": "Install", // into Virtual Environment
181+
"type": "shell",
147182
"command": "${config:python.defaultInterpreterPath}",
148183
"args": [
149184
"-m",
150-
"build",
151-
".",
152-
"--wheel",
153-
"--sdist",
185+
"pip",
186+
"install",
187+
"--force-reinstall",
188+
// wildcard only works on Posix platforms
189+
"${workspaceFolder}/dist/pygnssutils-*-py3-none-any.whl",
190+
],
191+
"windows": {
192+
"command": "${config:python.defaultInterpreterPath}",
193+
"args": [
194+
"-m",
195+
"pip",
196+
"install",
197+
"--force-reinstall",
198+
"${workspaceFolder}/dist/pygnssutils-1.1.21-py3-none-any.whl",
199+
]
200+
},
201+
"problemMatcher": [],
202+
},
203+
{
204+
"label": "Test",
205+
"type": "shell",
206+
"command": "${config:python.defaultInterpreterPath}",
207+
"args": [
208+
"-m",
209+
"pytest"
154210
],
155211
"problemMatcher": [],
156212
"dependsOrder": "sequence",
157213
"dependsOn": [
158-
"Clean",
159-
"Security",
160-
"Sort Imports",
161-
"Format",
214+
//"Activate Venv",
215+
"Build",
216+
"Install", // have to install before running pylint
162217
"Pylint",
163-
"Test",
218+
"Security",
219+
"Sphinx HTML",
164220
],
165221
"group": {
166-
"kind": "build",
222+
"kind": "test",
167223
"isDefault": true
168224
}
169225
},
170226
{
171227
"label": "Sphinx",
172-
"type": "process",
228+
"type": "shell",
173229
"command": "sphinx-apidoc",
174230
"args": [
175231
"--ext-autodoc",
@@ -184,7 +240,7 @@
184240
},
185241
{
186242
"label": "Sphinx HTML",
187-
"type": "process",
243+
"type": "shell",
188244
"command": "/usr/bin/make",
189245
"windows": {
190246
"command": "${workspaceFolder}/docs/make.bat"
@@ -202,8 +258,8 @@
202258
"problemMatcher": []
203259
},
204260
{
205-
"label": "Sphinx Deploy to S3", // needs AWS credentials
206-
"type": "process",
261+
"label": "Sphinx Deploy", // needs AWS S3 credentials
262+
"type": "shell",
207263
"command": "aws",
208264
"args": [
209265
"s3",
@@ -219,29 +275,16 @@
219275
"problemMatcher": []
220276
},
221277
{
222-
"label": "Install Locally",
223-
"type": "process",
278+
"label": "Run Installed Version",
279+
"type": "shell",
224280
"command": "${config:python.defaultInterpreterPath}",
225281
"args": [
226282
"-m",
227-
"pip",
228-
"install",
229-
"--upgrade",
230-
"--force-reinstall",
231-
"--find-links=${workspaceFolder}/dist",
232-
"${workspaceFolderBasename}",
233-
// "--target",
234-
// "${config:venv}/Lib/site-packages"
235-
],
236-
"options": {
237-
"cwd": "dist"
238-
},
239-
"dependsOrder": "sequence",
240-
"dependsOn": [
241-
"Build",
242-
"Sphinx HTML"
283+
"pygpsclient",
284+
//"--verbosity",
285+
//"3"
243286
],
244287
"problemMatcher": []
245-
}
288+
},
246289
]
247290
}

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,8 @@ gnssntripclient --server rtk2go.com --port 2101 --https 0 --mountpoint MYBASE --
415415

416416
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`.
417417

418+
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`.
419+
418420
For help and full list of optional arguments, type:
419421

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

478-
**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:
480+
**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:
479481

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

486+
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`.
487+
484488
Refer to the [Sphinx API documentation](https://www.semuconsulting.com/pygnssutils/pygnssutils.html#module-pygnssutils.socket_server) for further details.
485489

486490
---

RELEASE_NOTES.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# pygnssutils
22

3+
### RELEASE 1.1.21
4+
5+
CHANGES:
6+
7+
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.
8+
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*).
9+
1. Enhance type hints and docstrings.
10+
1. Update VSCode actions & workflow.
11+
312
### RELEASE 1.1.20
413

514
FIXES:

docs/conf.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@
1313
import os
1414
import sys
1515

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

1824
from pygnssutils import version as VERSION
1925

0 commit comments

Comments
 (0)