Skip to content

Update requirements-dev.txt #49

Update requirements-dev.txt

Update requirements-dev.txt #49

Workflow file for this run

name: Test
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
name: test-python-${{ matrix.python-version }}
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@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Install package
run: |
pip install -e .
- name: Run tests
run: |
pytest tests/ -v --tb=short
- name: Test import functionality
run: |
python -c "import gdplib; print('GDPlib import successful')"
coverage:
name: coverage-report
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Install package
run: |
pip install -e .
- name: Run tests with coverage
run: |
pytest tests/ --cov=gdplib --cov-report=xml --cov-report=term-missing
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN || '' }}
verbose: true
# Enable coverage comparison for PRs (delta reporting)
override_branch: ${{ github.event.pull_request.base.ref }}
override_commit: ${{ github.event.pull_request.base.sha }}
override_pr: ${{ github.event.pull_request.number }}
override_build: ${{ github.run_number }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
test-installation:
name: test-pip-installation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Test fresh pip installation
run: |
python -m pip install --upgrade pip
pip install .
python -c "import gdplib; print('Fresh installation successful')"
- name: Verify requirements
run: |
pip install pytest
python -c "
import pkg_resources
required = ['pyomo', 'pandas', 'matplotlib', 'scipy', 'pint', 'openpyxl']
for pkg in required:
try:
pkg_resources.get_distribution(pkg)
print(f'✓ {pkg} installed')
except pkg_resources.DistributionNotFound:
print(f'✗ {pkg} missing')
exit(1)
"