Skip to content

Commit fa2a8db

Browse files
authored
Merge pull request #21 from rambo/deps_update
Update deps and remove loop param from create_connection
2 parents 34fd43a + 7dba826 commit fa2a8db

23 files changed

+809
-785
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 2.4.0
2+
current_version = 2.5.0
33
commit = False
44
tag = False
55

.pre-commit-config.yaml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
33
default_language_version:
4-
python: python3.7
4+
python: python3
55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v2.4.0
7+
rev: v4.5.0
88
hooks:
99
- id: no-commit-to-branch
1010
- id: check-executables-have-shebangs
@@ -22,41 +22,52 @@ repos:
2222
args:
2323
- --autofix
2424
- repo: https://github.com/psf/black
25-
rev: 20.8b1
25+
rev: 24.1.1
2626
hooks:
2727
- id: black
28-
language_version: python3.7
28+
language_version: python3
2929
- repo: https://github.com/pre-commit/mirrors-mypy
30-
rev: v0.800
30+
rev: v1.8.0
3131
hooks:
3232
- id: mypy
3333
language: system
34-
args: [--strict] #, --ignore-missing-imports]
35-
- repo: https://github.com/pre-commit/mirrors-pylint
36-
rev: v2.4.4
34+
args: ["--strict"]
35+
- repo: https://github.com/pycqa/pylint
36+
rev: v3.0.3
3737
hooks:
3838
- id: pylint
3939
language: system
4040
- repo: https://github.com/Lucas-C/pre-commit-hooks
41-
rev: v1.1.7
41+
rev: v1.5.4
4242
hooks:
4343
- id: forbid-crlf
4444
- id: remove-crlf
4545
- id: forbid-tabs
4646
- id: remove-tabs
4747
- repo: https://github.com/PyCQA/bandit
48-
rev: 1.6.2
48+
rev: 1.7.7
4949
hooks:
5050
- id: bandit
5151
args: ["--skip=B101"]
52-
- repo: git://github.com/Lucas-C/pre-commit-hooks-markup
53-
rev: v1.0.0
52+
- repo: https://github.com/Lucas-C/pre-commit-hooks-markup
53+
rev: v1.0.1
5454
hooks:
5555
- id: rst-linter
5656
- repo: https://github.com/Yelp/detect-secrets
57-
rev: v1.0.3
57+
rev: v1.4.0
5858
hooks:
5959
- id: detect-secrets
6060
language: system
6161
exclude: "poetry.lock"
6262
# args: ['--baseline', '.secrets.baseline']
63+
- repo: https://github.com/shellcheck-py/shellcheck-py
64+
rev: v0.9.0.6
65+
hooks:
66+
- id: shellcheck
67+
args: ["--external-sources"]
68+
- repo: https://github.com/python-poetry/poetry
69+
rev: '1.7.1'
70+
hooks:
71+
- id: poetry-check
72+
- id: poetry-lock
73+
args: ["--no-update"]

examples/hp6632b_serial.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
from scpi.devices import hp6632b
88
from scpi.wrapper import AIOWrapper
99

10+
# pylint: disable=R0801
11+
1012
if __name__ == "__main__":
1113
if len(sys.argv) < 2:
1214
print(f"run with python -i {__file__} /dev/ttyUSB0")

examples/multimeter_tcp.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env python3
2+
"""Example/test script for using the Generic multimeter via TCP"""
3+
import atexit
4+
import os
5+
import sys
6+
7+
from scpi.transports import TCPTransport
8+
from scpi.devices.generic import MultiMeter
9+
from scpi.wrapper import AIOWrapper
10+
11+
# pylint: disable=R0801
12+
13+
if __name__ == "__main__":
14+
if len(sys.argv) < 3:
15+
print(f"run with python -i {__file__} IP PORT")
16+
sys.exit(1)
17+
# Then put to interactive mode
18+
os.environ["PYTHONINSPECT"] = "1"
19+
xport = TCPTransport(ipaddr=sys.argv[1], port=int(sys.argv[2]))
20+
aiodev = MultiMeter(xport)
21+
dev = AIOWrapper(aiodev)
22+
23+
atexit.register(dev.quit)
24+
25+
print(dev.identify())

examples/prologix_usb.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
from scpi.devices.hp6632b import HP6632B
1111
from scpi.devices.generic import MultiMeter
1212

13+
# pylint: disable=R0801
14+
1315
if __name__ == "__main__":
1416
if len(sys.argv) < 2:
1517
print(f"run with python -i {__file__} /dev/ttyUSB0")

examples/tdklambda_tcp.py

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python3
12
"""
23
Created on febrary 21 2020.
34

poetry.lock

Lines changed: 715 additions & 752 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "scpi"
3-
version = "2.4.0"
3+
version = "2.5.0"
44
description = "Basic idea here is to make transport-independent command sender/parser and a device baseclass that implements the common SCPI commands"
55
authors = ["Eero af Heurlin <eero.afheurlin@iki.fi>"]
66
homepage = "https://github.com/rambo/python-scpi/"
@@ -37,28 +37,28 @@ addopts="--cov=scpi --cov-branch"
3737
max-line-length = 120
3838

3939
[tool.pylint.messages_control]
40-
disable=["fixme", "W1202", "C0330"]
40+
disable=["fixme", "W1202", "C0209"]
4141

4242
[tool.coverage.run]
4343
omit = ["tests/*"]
4444
branch = true
4545

4646
[tool.poetry.dependencies]
47-
python = "^3.6"
47+
python = "^3.9"
4848
pyserial = "^3.4"
4949

5050
[tool.poetry.dev-dependencies]
51-
pytest = "^6.2"
52-
coverage = {version = "^5.4", extras = ["toml"]}
53-
pytest-cov = "^2.11"
54-
pylint = "^2.5"
55-
black = "=20.8b1"
56-
bandit = "^1.6"
57-
mypy = "^0.800"
58-
pre-commit = "^1.20"
59-
pytest-asyncio = "^0.14"
51+
pytest = "^8.0"
52+
coverage = "^7.4"
53+
pytest-cov = "^4.1"
54+
pylint = "^3.0"
55+
black = "^24.1"
56+
bandit = "^1.7"
57+
mypy = "^1.8"
58+
pre-commit = "^3.6"
59+
pytest-asyncio = ">=0.21,<1.0" # caret behaviour on 0.x is to lock to 0.x.*
6060
bump2version = "^1.0"
61-
detect-secrets = "^1.0"
61+
detect-secrets = "^1.4"
6262

6363
[build-system]
6464
requires = ["poetry-core>=1.0.0"]

src/scpi/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""SCPI module, the scpi class implements the base command set, devices may extend it.
22
transports are separate from devices (so you can use for example hp6632b with either serial port or GPIB)"""
3-
__version__ = "2.4.0" # NOTE Use `bump2version --config-file patch` to bump versions correctly
3+
4+
__version__ = "2.5.0" # NOTE Use `bump2version --config-file patch` to bump versions correctly
45
from .scpi import SCPIProtocol, SCPIDevice
56
from .errors import CommandError
67

src/scpi/devices/TDKLambdaZPlus.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""TDK Lambda power supplies"""
2+
23
# pylint: disable=C0103
34
from typing import Optional, Union, Any
45
from dataclasses import dataclass, field
@@ -256,7 +257,7 @@ def tcp(ipaddr: str, port: int) -> TDKLambdaZplus:
256257

257258

258259
def serial(serial_url: str, baudrate: int = 9600) -> TDKLambdaZplus:
259-
""" Quick helper to connect via serial """
260+
"""Quick helper to connect via serial"""
260261
port = pyserial.serial_for_url(
261262
serial_url,
262263
baudrate=baudrate,

0 commit comments

Comments
 (0)