-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
97 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,69 +8,59 @@ jobs: | |
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
cache: 'pip' | ||
- uses: pre-commit/[email protected] | ||
with: | ||
extra_args: --hook-stage manual --all-files | ||
- uses: pre-commit/[email protected] | ||
|
||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
# Temporarily limit versions | ||
# https://github.com/python-poetry/poetry/issues/8139 | ||
python-version: ['3.10', '3.11', '3.12'] # '3.8', '3.9', | ||
python-version: ['3.10', '3.11', '3.12'] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
# https://github.com/actions/setup-python/issues/369 | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
|
||
- run: echo ${{ matrix.python-version }} >> .python-version | ||
|
||
- name: Install poetry | ||
run: pip install poetry | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('poetry.lock') }} | ||
- name: Install rye | ||
uses: eifinger/setup-rye@v4 | ||
|
||
- name: Install dependencies | ||
# https://github.com/nektos/act/issues/1639 | ||
run: poetry install --no-ansi | ||
run: rye sync | ||
|
||
- name: Test linux | ||
if: runner.os == 'Linux' | ||
uses: nick-fields/retry@v2 | ||
uses: nick-fields/retry@v3 | ||
with: | ||
timeout_minutes: 10 | ||
max_attempts: 3 | ||
command: | | ||
sudo apt-get install -y xvfb xserver-xephyr scrot gnome-screenshot | ||
mkdir -p screenshots | ||
xvfb-run -a poetry run pytest -v | ||
xvfb-run -a rye test -v | ||
- name: Test windows | ||
if: runner.os == 'Windows' | ||
uses: nick-fields/retry@v2 | ||
uses: nick-fields/retry@v3 | ||
with: | ||
timeout_minutes: 10 | ||
max_attempts: 3 | ||
command: | | ||
mkdir -p screenshots | ||
poetry run pytest -v | ||
rye test -v | ||
- name: Test mac [1] | ||
if: runner.os == 'macOS' | ||
uses: nick-fields/retry@v2 | ||
uses: nick-fields/retry@v3 | ||
with: | ||
timeout_minutes: 10 | ||
max_attempts: 3 | ||
|
@@ -81,15 +71,15 @@ jobs: | |
- name: Test mac [2] | ||
if: runner.os == 'macOS' | ||
uses: nick-fields/retry@v2 | ||
uses: nick-fields/retry@v3 | ||
with: | ||
timeout_minutes: 10 | ||
max_attempts: 3 | ||
command: | | ||
mkdir -p screenshots | ||
Xvfb :1 & | ||
export DISPLAY=":1" | ||
poetry run pytest -v | ||
rye test -v | ||
- name: Upload screenshots | ||
uses: actions/upload-artifact@v3 | ||
|
@@ -98,8 +88,8 @@ jobs: | |
name: screenshots | ||
path: screenshots/*.png | ||
|
||
- name: Setup tmate session | ||
# Enables ssh session during manually triggered ci runs | ||
uses: mxschmitt/action-tmate@v3 | ||
if: ${{ failure() && github.event_name == 'workflow_dispatch' }} | ||
# - name: Setup tmate session | ||
# # Enables ssh session during manually triggered ci runs | ||
# uses: mxschmitt/action-tmate@v3 | ||
# if: ${{ failure() && github.event_name == 'workflow_dispatch' }} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,5 +128,4 @@ dmypy.json | |
# Pyre type checker | ||
.pyre/ | ||
|
||
# Poetry | ||
poetry.lock | ||
*.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,15 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.6.1 | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.5.5 | ||
hooks: | ||
- id: mypy | ||
stages: [pre-merge-commit, pre-push, manual] | ||
exclude: ^tests/ | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: v0.1.3 | ||
hooks: | ||
# Run the Ruff formatter | ||
- id: ruff-format | ||
# Run the Ruff linter | ||
# Run the linter. | ||
- id: ruff | ||
args: | ||
- --fix | ||
- --exit-non-zero-on-fix | ||
# Rules E & F applied by default | ||
# https://github.com/charliermarsh/ruff/blob/main/README.md#supported-rules | ||
- --extend-select=A,B,I,N,W | ||
- --extend-select=A,B,I,N,W | ||
# Run the formatter. | ||
- id: ruff-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,56 @@ | ||
[tool.poetry] | ||
[project] | ||
name = "can-explorer" | ||
version = "0.2.1" | ||
description = "Visualize CAN bus payloads in real time" | ||
license = "GPL-3.0-or-later" | ||
authors = ["TJ <[email protected]>"] | ||
# maintainers = ["TJ <[email protected]>"] | ||
authors = [ | ||
{ name = "TJ", email = "[email protected]" } | ||
] | ||
dependencies = [ | ||
"pyserial>=3.5", | ||
"python-can>=4.4.2", | ||
"dearpygui>=1.11.1", | ||
"dearpygui-ext>=0.9.5", | ||
] | ||
readme = "README.md" | ||
repository = "https://github.com/Tbruno25/can-explorer" | ||
requires-python = ">= 3.10" | ||
keywords = ["can", "bus", "canbus", "can_bus", "dbc"] | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.10, <4.0" | ||
pyserial = "^3.5" | ||
python-can = "^4.1.0" | ||
dearpygui = "^1.9.0" | ||
dearpygui-ext = "^0.9.5" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
pytest = "^7.2.2" | ||
mypy = "^1.2.0" | ||
pillow = "^10.3.0" | ||
pyautogui = "^0.9.54" | ||
opencv-python = "^4.8.0.74" | ||
pyvirtualdisplay = [ | ||
{version = "^3.0", platform = "linux"}, | ||
{version = "^3.0", platform = "darwin"}, | ||
classifiers = [ | ||
"Operating System :: OS Independent", | ||
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
] | ||
msvc-runtime = {version = "^14.34.31931", platform = "windows"} | ||
|
||
[project.urls] | ||
repository = "https://github.com/tbruno25/can-explorer" | ||
|
||
[project.scripts] | ||
can-explorer = "can_explorer.__main__:__main__" | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[tool.mypy] | ||
ignore_missing_imports = true | ||
[tool.rye] | ||
managed = true | ||
dev-dependencies = [ | ||
"pytest>=8.3.2", | ||
"pytest-dpg>=0.1.5", | ||
"msvc-runtime ; platform_system == 'Windows'", | ||
"pillow>=10.4.0", | ||
"opencv-python>=4.10.0.84", | ||
] | ||
|
||
[tool.ruff.per-file-ignores] | ||
"__init__.py" = ["F401"] | ||
[tool.hatch.metadata] | ||
allow-direct-references = true | ||
|
||
[tool.poetry.scripts] | ||
can-explorer = "can_explorer.__main__:__main__" | ||
[tool.hatch.build.targets.wheel] | ||
packages = ["src/can_explorer"] | ||
|
||
[tool.ruff.lint] | ||
extend-select = ["A", "B", "I", "N", "W"] | ||
|
||
[tool.ruff.lint.per-file-ignores] | ||
"__init__.py" = ["F401"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters