Skip to content

Commit b758ec0

Browse files
authored
Merge pull request #11 from semuconsulting/RELEASE-CANDIDATE-1.0.6
RC 1.0.6 - allow mixed formats in ubxcompare
2 parents c71014d + 0591a4a commit b758ec0

12 files changed

Lines changed: 161 additions & 97 deletions

File tree

.vscode/tasks.json

Lines changed: 119 additions & 73 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+
// pyubxutils 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/pyubxutils-*-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/pyubxutils-1.0.6-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,19 @@
219275
"problemMatcher": []
220276
},
221277
{
222-
"label": "Install Locally",
223-
"type": "process",
224-
"command": "${config:python.defaultInterpreterPath}",
278+
"label": "Run from Source",
279+
"type": "shell",
280+
"command": "python3",
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"
283+
"pygpsclient",
284+
//"--verbosity",
285+
//"3"
235286
],
236287
"options": {
237-
"cwd": "dist"
288+
"cwd": "${workspaceFolder}/src"
238289
},
239-
"dependsOrder": "sequence",
240-
"dependsOn": [
241-
"Build",
242-
"Sphinx HTML"
243-
],
244290
"problemMatcher": []
245-
}
291+
},
246292
]
247293
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ ubxsetrate -h
234234
class pyubxutils.ubxcompare.UBXCompare(infiles, form, diffsonly)
235235
```
236236

237-
A simple CLI utility for comparing the contents of two or more u-blox configuration files. Files can be in text (\*.txt) format (as used by u-center or ArduSimple) or binary (\*.ubx) format (as used by [PyGPSClient](https://github.com/semuconsulting/PyGPSClient) or [ubxsave](#ubxsave)).
237+
A simple CLI utility for comparing the contents of two or more u-blox configuration files. Files can be in text (\*.txt) format (as used by u-center or ArduSimple) or binary (\*.ubx) format (as used by [PyGPSClient](https://github.com/semuconsulting/PyGPSClient) or [ubxsave](#ubxsave)). If the format argument `--format` or `-F` is set to 2 (`FORMAT_ALL`), the file format will be derived from the file suffix i.e. `*.txt` for text or `*.ubx` for binary.
238238

239239
e.g.
240240

RELEASE_NOTES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# pyubxutils Release Notes
22

3+
### RELEASE 1.0.6
4+
5+
ENHANCMENTS:
6+
7+
1. Allow mixed file formats (ubx & txt) in ubxcompare - addresses feature request https://github.com/semuconsulting/pyubxutils/issues/10
8+
39
### RELEASE 1.0.5
410

511
FIXES:

docs/conf.py

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

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

1825
from pyubxutils import version as VERSION
1926

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
contain the root `toctree` directive.
55
66
Welcome to pyubxutils's documentation!
7-
==================================
7+
======================================
88

99
.. toctree::
1010
:maxdepth: 2
1111
:caption: Contents:
1212

13-
13+
modules.rst
1414

1515
Indices and tables
1616
==================

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ repository = "https://github.com/semuconsulting/pyubx2"
5050
changelog = "https://github.com/semuconsulting/pyubx2/blob/master/RELEASE_NOTES.md"
5151

5252
[dependency-groups]
53+
optional = []
5354
build = [
5455
"awscli",
5556
"build",

src/pyubxutils/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
:license: BSD 3-Clause
99
"""
1010

11-
__version__ = "1.0.5"
11+
__version__ = "1.0.6"

src/pyubxutils/ubxbase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def _read_data(
237237
# or waittime has been exceeded.
238238
while not stop.is_set():
239239
try:
240-
(_, parsed_data) = ubr.read()
240+
_, parsed_data = ubr.read()
241241
if parsed_data is not None:
242242
if (
243243
parsed_data.identity in (ACK, NAK)

0 commit comments

Comments
 (0)