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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff
72 changes: 39 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,51 +8,61 @@ on:

jobs:
test:
name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
name: Test ${{ matrix.environment }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.12', '3.13']
os: [ubuntu-latest]
environment: ["py311", "py312", "default"]
include:
- os: macos-latest
environment: default

steps:
- uses: actions/checkout@v7

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

- name: Install dependencies
# Install directly because the repository's Actions policy blocks setup-pixi.
- name: Install Pixi
shell: bash
env:
PIXI_NO_PATH_UPDATE: "1"
run: |
python -m pip install --upgrade pip
pip install -e .
curl --fail --silent --show-error --location https://pixi.sh/install.sh --output "$RUNNER_TEMP/install-pixi.sh"
bash "$RUNNER_TEMP/install-pixi.sh"
echo "$HOME/.pixi/bin" >> "$GITHUB_PATH"

- name: Install test environment
run: pixi install --locked -e ${{ matrix.environment }}

- name: Run tests with coverage
run: |
pytest tests/ --cov=utils --cov=. --cov-report=term-missing
run: pixi run -e ${{ matrix.environment }} pytest tests --cov=next_pass --cov-report=term-missing

lint:
name: Code Quality
name: Ruff
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v7

- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: '3.10'

- name: Install dependencies
- name: Install Pixi
shell: bash
env:
PIXI_NO_PATH_UPDATE: "1"
run: |
python -m pip install --upgrade pip
pip install -e .
curl --fail --silent --show-error --location https://pixi.sh/install.sh --output "$RUNNER_TEMP/install-pixi.sh"
bash "$RUNNER_TEMP/install-pixi.sh"
echo "$HOME/.pixi/bin" >> "$GITHUB_PATH"

- name: Run pre-commit checks
run: |
pre-commit run --all-files
- name: Install lint environment
run: pixi install --locked -e lint

- name: ruff check
run: pixi run -e lint ruff check --output-format=github

- name: ruff format
if: ${{ !cancelled() }}
run: pixi run -e lint ruff format --diff

security:
name: Security Scan
Expand All @@ -64,14 +74,10 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pip-audit safety
python-version: '3.12'

- name: Check for known vulnerabilities
run: |
pip-audit --requirement requirements.txt || true
safety check --file requirements.txt || true
python -m pip install --upgrade pip pip-audit
pip install .
pip-audit || true
22 changes: 12 additions & 10 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ jobs:
steps:
- uses: actions/checkout@v7

- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: '3.10'

- name: Install dependencies
- name: Install Pixi
shell: bash
env:
PIXI_NO_PATH_UPDATE: "1"
run: |
python -m pip install --upgrade pip
pip install -e .
curl --fail --silent --show-error --location https://pixi.sh/install.sh --output "$RUNNER_TEMP/install-pixi.sh"
bash "$RUNNER_TEMP/install-pixi.sh"
echo "$HOME/.pixi/bin" >> "$GITHUB_PATH"

- name: Install default environment
run: pixi install --locked -e default

- name: Run integration tests
env:
Expand All @@ -31,12 +33,12 @@ jobs:
EARTHDATA_PASSWORD: ${{ secrets.EARTHDATA_PASSWORD }}
run: |
# Run tests that hit real APIs (mark with @pytest.mark.integration)
pytest tests/ -m integration || true
pixi run pytest tests -m integration || true

- name: Check external service availability
run: |
# Test that external services are reachable
python -c "
pixi run python -c "
import requests
services = [
'https://search.asf.alaska.edu',
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/overpass-map.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Overpass Map

on:
schedule:
- cron: '17 4 * * *'
workflow_dispatch:
push:
branches: [main]
paths:
- 'src/next_pass/viewer_assets/**'
- 'src/next_pass/schedule.py'
- '.github/workflows/overpass-map.yml'

permissions:
contents: write

concurrency:
group: overpass-map
cancel-in-progress: true

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v7

- name: Install Pixi
shell: bash
env:
PIXI_NO_PATH_UPDATE: "1"
run: |
curl --fail --silent --show-error --location https://pixi.sh/install.sh --output "$RUNNER_TEMP/install-pixi.sh"
bash "$RUNNER_TEMP/install-pixi.sh"
echo "$HOME/.pixi/bin" >> "$GITHUB_PATH"

- name: Install default environment
run: pixi install --locked -e default

- name: Build weekly overpass schedule
run: pixi run next-pass-schedule --days 7 --output site/data/upcoming_passes.parquet

- name: Assemble site
run: |
cp src/next_pass/viewer_assets/index.html site/index.html
touch site/.nojekyll

- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
publish_branch: gh-pages
force_orphan: true
commit_message: 'Update overpass schedule (${{ github.event_name }})'
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,20 @@ cython_debug/

# Claude documentation
claude_md/
# pixi environments
.pixi/*
!.pixi/config.toml

# pixi
.pixi/*
!.pixi/config.toml

# next_pass runtime outputs
scratch/
site/
nextpass_outputs_*/
upcoming_passes.parquet
upcoming_passes.meta.json

# Claude
claude/
32 changes: 8 additions & 24 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,18 @@
# Pre-commit hooks for code quality and formatting
# Install: pip install pre-commit && pre-commit install
# Run manually: pre-commit run --all-files
# Install: pixi run pre-commit install
# Run manually: pixi run pre-commit run --all-files

repos:
# Black code formatter
- repo: https://github.com/psf/black
rev: 24.4.2
# Ruff (replaces black, isort, and flake8)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.14
hooks:
- id: black

# isort import sorting
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]

# flake8 linting
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
args:
- "--max-line-length=88"
- "--extend-ignore=E203,W503,E501"
- "--per-file-ignores=__init__.py:F401"
- id: ruff-check
- id: ruff-format

# Standard pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
Loading
Loading