Skip to content
Merged
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
89 changes: 89 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Build and Test

on:
# Trigger the workflow on pushes to main and on version tags in the format X.Y.Z.*
# and on pull requests to main
push:
branches: [main]
tags: ["[0-9]+.[0-9]+.[0-9]+*"]
pull_request:
branches: [ main ]
types: [ opened, synchronize, reopened ]

jobs:
build:
runs-on: ubuntu-latest

if: |
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install build tools
run: pip install build setuptools-scm

- name: Build wheel
run: python -m build --wheel

- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: pypylon-contrib-wheel
path: dist/*.whl

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[dev]"

- name: Run tests
run: |
pytest tests

lint:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12" ]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[dev]"

- name: Run pylint
run: |
pylint src --fail-under=10.0

- name: Run ruff
run: |
ruff check src --output-format=github

2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ env/

# Ignore editor/project-specific folders
.idea/
.vscode/

# Ignore system files
.DS_Store
Expand Down Expand Up @@ -43,6 +42,5 @@ dist/
*.key
*.crt
*.cfg
*.ini
.env.local
.env.*.local
25 changes: 25 additions & 0 deletions .vscode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# VS Code Configuration

Minimal VS Code configuration for the pypylon-samples project.

## Files

- **`settings.json`** - Automatically remove trailing whitespace and Ruff formatting
- **`extensions.json`** - Only Python and Ruff extensions
- **`launch.json`** - Start pytest and Jupyter Notebook

## Features

- **Trailing whitespace** is automatically removed on save
- **Final newline** is automatically inserted at end of file
- **Ruff formatting** on save for Python files

## Extensions

- **ms-python.python** - Python support
- **charliermarsh.ruff** - Code formatting

## Debug Configurations (F5)

- **Python: pytest** - Run all tests
- **Python: Jupyter Notebook** - Start Jupyter Notebook server
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"ms-python.python",
"charliermarsh.ruff"
]
}
27 changes: 27 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: pytest",
"type": "python",
"request": "launch",
"module": "pytest",
"args": [
"tests/",
"-v"
],
"console": "integratedTerminal"
},
{
"name": "Python: Jupyter Notebook",
"type": "python",
"request": "launch",
"module": "jupyter",
"args": [
"notebook",
"--no-browser"
],
"console": "integratedTerminal"
}
]
}
13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
// Automatically remove trailing whitespace on save
"files.trimTrailingWhitespace": true,
// Automatically insert final newline at end of file
"files.insertFinalNewline": true,
// Automatically format on save
"editor.formatOnSave": true,
// Python formatting with ruff
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true
}
}
549 changes: 0 additions & 549 deletions notebooks/USB_hardware_trigger_and_chunks.ipynb

This file was deleted.

Loading