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
18 changes: 7 additions & 11 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Determine test mode
id: mode
run: |
if [ "${{ github.event.pull_request.draft }}" ]; then
if [ "${{ github.event.pull_request.draft }}" == "true" ]; then
echo "mode=fast" >> $GITHUB_OUTPUT
else
echo "mode=full" >> $GITHUB_OUTPUT
Expand All @@ -43,24 +43,20 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install .
pip install .[dev]
pip install -e . --no-build-isolation
pip install -e ".[dev]"

- name: Run tests
# Currently this conditional branching doesn't actually do anything,
# since pyproject.toml adds these coverage arguments to the testing anyway
run: |
if [ "${{ steps.mode.outputs.mode }}" == "fast" ]; then
echo "⚡ Skipping notebook tests (marked with @pytest.mark.notebook) - these run separately"
pytest tests/ -n auto -v -m "not notebook" --cov=lyopronto --cov-report=term-missing
else
echo "⚡ Skipping notebook tests (marked with @pytest.mark.slow), not running coverage"
echo "Running fast tests (draft PR, no coverage)"
pytest tests/ -n auto -v -m "not notebook"
else
echo "Running full tests with coverage (ready for review)"
pytest tests/ -n auto -v -m "not notebook" --cov=lyopronto --cov-report=term-missing --cov-report=xml
fi

- name: Upload coverage (if run)
if: steps.mode.outputs.coverage == 'true'
if: steps.mode.outputs.mode == 'full'
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/slow-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,17 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install .
pip install .[dev]
pip install -e . --no-build-isolation
pip install -e ".[dev]"

- name: Run slow tests
run: |
if [ "${{ inputs.run_all }}" == "true" ]; then
echo "🔍 Running ALL tests (including slow optimization tests)"
echo "⏱️ This may take 30-40 minutes on CI"
echo "Running ALL tests (including slow optimization tests)"
echo "This may take 30-40 minutes on CI"
pytest tests/ -n auto -v --cov=lyopronto --cov-report=xml --cov-report=term-missing
else
echo "🐌 Running ONLY slow tests (marked with @pytest.mark.slow)"
echo "⏱️ This focuses on optimization tests that take minutes"
echo "Running ONLY slow tests (marked with @pytest.mark.slow)"
echo "This focuses on optimization tests that take minutes"
pytest tests/ -n auto -v -m "slow" --cov=lyopronto --cov-report=xml --cov-report=term-missing
fi

Expand All @@ -70,8 +68,8 @@ jobs:
if: always()
run: |
if [ "${{ inputs.run_all }}" == "true" ]; then
echo "Complete test suite finished"
echo "Complete test suite finished"
else
echo "🐌 Slow tests completed"
echo "Slow tests completed"
fi
echo "📊 Coverage uploaded to Codecov"
echo "Coverage uploaded to Codecov"
14 changes: 6 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Main Branch Tests

on:
push:
branches: [ main, dev-pyomo ]
branches: [ main ]

jobs:
test:
Expand All @@ -29,14 +29,12 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install .
pip install .[dev]
pip install -e . --no-build-isolation
pip install -e ".[dev]"

- name: Run ALL tests with pytest and coverage (including slow tests)
run: |
echo "🔍 Running complete test suite including slow tests"
echo "⏱️ This may take 30-40 minutes on CI (includes optimization tests)"
echo "Running complete test suite including slow tests"
echo "This may take 30-40 minutes on CI (includes optimization tests)"
pytest tests/ -n auto -v --cov=lyopronto --cov-report=xml --cov-report=term-missing

- name: Upload coverage to Codecov
Expand All @@ -51,5 +49,5 @@ jobs:
- name: Coverage Summary
if: always()
run: |
echo "Full coverage tests completed for main branch"
echo "📊 Coverage metrics updated in Codecov"
echo "Full coverage tests completed for main branch"
echo "Coverage metrics updated in Codecov"
21 changes: 19 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
# ----------- Files excluded for this project
#
# Python precompiled files
*.pyc
# Python bytecode
__pycache__/
*.py[cod]
*$py.class

# Distribution / packaging
build/
dist/
*.egg-info/
*.egg
MANIFEST

# Data files
*.csv
# But keep test reference data
!test_data/*.csv

# Coverage reports
.coverage
coverage.xml
htmlcov/

docs/build

Expand Down
8 changes: 3 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ authors = [
maintainers = [
{name = "Isaac S. Wheeler"},
]
requires-python = ">=3.8"
requires-python = ">=3.9"
dependencies = [
"numpy>=1.24.0",
"numpy>=2.0.0",
"scipy>=1.10.0",
"matplotlib>=3.7.0",
"ruamel.yaml>=0.18.0",
Expand All @@ -29,7 +29,6 @@ classifiers = [
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand All @@ -45,6 +44,7 @@ dev = [
"pytest-mock>=3",
"pytest-cov>=4.1.0",
"pytest-xdist>=3.3.0",
"pytest-timeout>=2.1.0",
"hypothesis>=6.82.0",
"ruff>=0.12.0",
"mypy>=1.4.0",
Expand Down Expand Up @@ -80,8 +80,6 @@ addopts = [
"--strict-markers",
"--tb=short",
"--maxfail=5",
"--cov=lyopronto",
"--cov-report=term-missing",
]
markers = [
"slow: Tests that take a long time to run",
Expand Down