From 716a4a5233d0bf8246183f7787fd7c2eb4e3a2f5 Mon Sep 17 00:00:00 2001 From: prajnasoni Date: Mon, 14 Jul 2025 17:13:00 -0400 Subject: [PATCH 1/2] adding tests for PR pushes --- .github/workflows/tests.yml | 0 pyproject.toml | 60 +++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/tests.yml create mode 100644 pyproject.toml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..aaf4c80 --- /dev/null +++ b/pyproject.toml @@ -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" \ No newline at end of file From be4bd134783cd8f067dd54ab9f07b96f807010dc Mon Sep 17 00:00:00 2001 From: prajnasoni Date: Mon, 14 Jul 2025 17:14:47 -0400 Subject: [PATCH 2/2] adding tests.yml --- .github/workflows/tests.yml | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e69de29..8730573 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 \ No newline at end of file