Skip to content

Commit 89420af

Browse files
authored
Merge pull request #2 from ianhi/local-import
use local module
2 parents aee33bc + 94fffd9 commit 89420af

File tree

8 files changed

+27
-14
lines changed

8 files changed

+27
-14
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,4 @@ static
150150
# failed downloads
151151
compressed/*?raw=true
152152

153-
_version.py
153+
_version.py

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
exclude: '(JSON|boards)'
12
repos:
23
- repo: https://github.com/pre-commit/pre-commit-hooks
34
rev: v4.0.1

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ A small library to determine which serial ports are arduino style boards.
44

55
```bash
66
pip install -e .
7-
```
7+
```

find_arduino/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
from ._version import __version__
33
except:
44
__version__ = "unknown"
5-
from .detection import find_arduino
5+
from .detection import check_ports
66

77
__all__ = [
88
"__version__",
9-
"find_arduino",
9+
"check_ports",
1010
]

find_arduino/detection.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
1-
from boards import boards_dict
2-
from serial.tools import list_ports
31
import re
42

3+
from serial.tools import list_ports
4+
5+
from .boards import boards_dict
6+
7+
58
def check_ports():
69
not_arduinos = []
710
arduinos = []
811
for connection in list_ports.comports():
9-
port,hwid,desc = connection
12+
port, hwid, desc = connection
1013
vid_pid = re.search(r"(?<=VID\:PID\=)[0-9|A-Z|a-z]{4}\:[0-9|A-Z|a-z]{4}", desc)
1114
vid_pid = None if vid_pid is None else vid_pid.group()
1215
if vid_pid is None:
1316
not_arduinos.append(connection)
1417
else:
1518
try:
1619
board = boards_dict[vid_pid]
17-
arduinos.append((board,connection))
20+
arduinos.append((board, connection))
1821
except KeyError:
1922
not_arduinos.append(connection)
2023
return arduinos, not_arduinos
2124

25+
2226
if __name__ == "__main__":
2327
arduinos, not_arduinos = check_ports()
2428
for ard in arduinos:

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ write_to = "find_arduino/_version.py"
77

88
[tool.isort]
99
profile = "black"
10-

setup.cfg

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
[metadata]
2-
name = find-arduino
2+
name = find_arduino
3+
long_description = file: README.md
4+
long_description_content_type = text/markdown
35
url = https://github.com/ianhi/detect-arduino
46
author = Ian Hunt-Isaak}}
57
author_email = ianhuntisaak@gmail.com
68
license = BSD-3 Clause
79
classifiers =
8-
Development Status :: 2 - Pre-Alpha
910
'BSD license': 'License :: OSI Approved :: BSD License',
11+
Development Status :: 2 - Pre-Alpha
1012
Natural Language :: English
1113
Programming Language :: Python :: 3
14+
Programming Language :: Python :: 3 :: Only
1215
Programming Language :: Python :: 3.7
1316
Programming Language :: Python :: 3.8
1417
Programming Language :: Python :: 3.9
@@ -17,8 +20,14 @@ project_urls =
1720

1821
[options]
1922
packages = find:
23+
install_requires =
24+
pyserial
2025
python_requires = >=3.7
2126
setup_requires =
2227
setuptools_scm
23-
install_requires =
24-
pyserial
28+
29+
[flake8]
30+
exclude = docs,_version.py,.eggs,examples
31+
max-line-length = 88
32+
docstring-convention = numpy
33+
ignore = D100, D213, D401, D413, D107, W503

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from setuptools import setup
22

3-
setup()
3+
setup()

0 commit comments

Comments
 (0)