Skip to content
Closed
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
43 changes: 43 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

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

steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest ruff pyright
# Install project dependencies if requirements.txt exists
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# Install project dependencies if pyproject.toml exists
if [ -f pyproject.toml ]; then pip install -e .; fi

- name: Run ruff check
run: ruff check .

- name: Run ruff format check
run: ruff format --check .

- name: Run pyright
run: pyright

- name: Run tests with pytest
run: pytest -v
60 changes: 60 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "benchmark-saturation"
version = "0.1.0"
description = "Benchmark Saturation research project"
readme = "README.md"
requires-python = ">=3.9"
dependencies = [
"matplotlib",
"numpy",
]

[project.optional-dependencies]
dev = [
"pytest",
"ruff",
"pyright",
]

[tool.ruff]
line-length = 88
target-version = "py39"

[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
ignore = [
"E501", # line too long, handled by black
"B008", # do not perform function calls in argument defaults
"C901", # too complex
]

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-string-normalization = false

[tool.pyright]
include = ["scripts", "tests"]
exclude = ["**/__pycache__", "build", "dist"]
reportMissingImports = true
reportMissingTypeStubs = false
pythonVersion = "3.9"

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = "-v --tb=short"
Loading