Skip to content

Commit

Permalink
Drop python 3.7 and black (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
hamdanal authored Jan 1, 2024
1 parent cc5f278 commit 654a3b3
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.7", "3.11"]
python-version: ["3.8", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
10 changes: 2 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ repos:
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
Expand All @@ -21,11 +18,8 @@ repos:
rev: v0.1.9
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.12.1
hooks:
- id: black
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
Expand Down
7 changes: 3 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"python.formatting.provider": "none",
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
"source.organizeImports": "explicit",
},
},
}
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# lsports

A simple Python 3.7+ module to list serial ports on Windows, Linux, and macOS.
A simple Python module to list serial ports on Windows, Linux, and macOS.

This is a modified version of `serial.tools.list_ports` from
[pySerial](https://github.com/pyserial/pyserial) ([license](licenses/pyserial_LICENSE)).

The goal of this project is to integrate some fixes and improvements to the original *list_ports*
functionality with a faster release cycle.
[pySerial](https://github.com/pyserial/pyserial) with the goal of integrating some fixes and
improvements to the original *list_ports* functionality with a faster release cycle.

## Installation

Expand All @@ -27,7 +25,6 @@ for port in comports():
For a full list of available attributes, see the `PortInfo` class. Only `comports` and `PortInfo`
are considered public API.


## Notable changes from `serial.tools.list_ports`

* The information class name is `PortInfo` instead of `ListPortInfo`.
Expand Down
4 changes: 2 additions & 2 deletions lsports/_macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
iokit.IOServiceGetMatchingServices.restype = kern_return_t

iokit.IORegistryEntryCreateCFProperty.argtypes = (
ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_uint32 # fmt: skip
)
ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_uint32
) # fmt: skip
iokit.IORegistryEntryCreateCFProperty.restype = ctypes.c_void_p

iokit.IORegistryEntryGetPath.argtypes = (ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p)
Expand Down
14 changes: 5 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -25,7 +24,7 @@ classifiers = [
]
keywords = ["serial", "lsports", "list-ports", "USB", "COM"]
dependencies = []
requires-python = ">=3.7"
requires-python = ">=3.8"
urls.Home = "https://github.com/hamdanal/lsports"

[tool.hatch]
Expand All @@ -34,7 +33,7 @@ build.packages = ["lsports"]
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py37,py38,py39,py310,py311,py312
envlist = py38,py39,py310,py311,py312
skip_missing_interpreters = true
[testenv]
deps =
Expand All @@ -43,18 +42,15 @@ commands =
pytest {posargs}
"""

[tool.black]
line_length = 100

[tool.ruff]
line-length = 100
select = ["E", "F", "B", "UP", "RUF100", "TID"]
extend-select = ["E", "F", "C", "B", "UP", "RUF100", "TID", "T10"]
unfixable = ["B"]
ignore = ["E501"]
extend-ignore = ["E501", "C901"]
isort.required-imports = ["from __future__ import annotations"]
flake8-tidy-imports.ban-relative-imports = "all"

[tool.ruff.per-file-ignores]
[tool.ruff.extend-per-file-ignores]
"lsports/_windows.py" = ["E221", "E402"]

[tool.mypy]
Expand Down

0 comments on commit 654a3b3

Please sign in to comment.