Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt .
- name: Lint with ruff
run: |
ruff check .
- name: Tests
run: pytest --cov-report term-missing --cov-report=xml test
- name: Upload coverage to Codecov
Expand Down
2 changes: 1 addition & 1 deletion documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
import pathlib
import re

Expand All @@ -20,6 +19,7 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.append(os.path.abspath('.'))


def find_version(path: pathlib.Path):
"""
Search the file for a version string.
Expand Down
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,15 @@ dynamic = ["version"]

[tool.setuptools.dynamic]
version = { attr = "serial_asyncio_fast.__version__" }

[tool.ruff]
line-length = 120
[tool.ruff.lint]
extend-select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
]
extend-ignore = [
"E265", # no space after block comment
"E241", # multiple spaces after comma
]
1 change: 1 addition & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pytest-cov
pytest-asyncio
ruff
2 changes: 2 additions & 0 deletions serial_asyncio_fast/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@
# Prevent tasks from being garbage collected.
_BACKGROUND_TASKS: Set[asyncio.Task] = set()


def _create_background_task(coro: Coroutine) -> None:
"""Create a background task that will not be garbage collected."""
task = asyncio.create_task(coro)
_BACKGROUND_TASKS.add(task)
task.add_done_callback(_BACKGROUND_TASKS.discard)


class SerialTransport(asyncio.Transport):
"""An asyncio transport model of a serial communication channel.

Expand Down
4 changes: 0 additions & 4 deletions setup.cfg

This file was deleted.

1 change: 0 additions & 1 deletion test/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@