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
69 changes: 69 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Tests
on:
push:
pull_request:
workflow_dispatch:
workflow_call:
permissions:
contents: read
concurrency:
group: tests-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ['3.10', '3.11', '3.12']
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: pip
- uses: actions/setup-node@v4
with:
node-version: '22'
- run: python -m pip install '.[test]' -r tests/requirements.txt
- run: ruff check . && ruff format --check .
- run: python -m pytest -m 'not docker' -q
- run: python -m build
- name: Verify installed wheel and packaged resources
run: |
python -m venv /tmp/abench-wheel
/tmp/abench-wheel/bin/pip install dist/*.whl
cd /tmp
/tmp/abench-wheel/bin/abench --help
/tmp/abench-wheel/bin/python -c "from pathlib import Path; import abench; p=Path(abench.__file__).parent; assert (p/'Dockerfile').is_file(); assert (p/'profiles/mtc.yaml').is_file(); assert (p/'runtime/build_sources.py').is_file()"
docker:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
- run: python -m pip install . pytest
- name: Build exact sources and exercise serial and multiprocess runs
env:
ABENCH_DOCKER_TESTS: '1'
run: |
mkdir -p experiments
python -m pytest tests/test_docker.py -v --basetemp=experiments/ci
- name: Retain reports and diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: docker-experiments
path: |
experiments/ci/**/*.html
experiments/ci/**/*.json
experiments/ci/**/*.jsonl
experiments/ci/**/*.txt
experiments/ci/**/*.log
experiments/ci/**/*.csv
experiments/ci/**/*.yaml
if-no-files-found: ignore
61 changes: 61 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Publish to PyPI
on:
release:
types: [published]
permissions:
contents: read
concurrency:
group: pypi-${{ github.event.release.tag_name }}
cancel-in-progress: false
jobs:
tests:
uses: ./.github/workflows/ci.yml
build:
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: astral-sh/setup-uv@v6
- run: python -m pip install build twine
# Build the wheel from the sdist, so both published formats are exercised.
- run: python -m build
- run: python -m twine check --strict dist/*
- run: python -m pip install dist/*.whl
- name: Match release tag to package version
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
python - <<'PY'
import os
from importlib.metadata import version
expected = 'v' + version('abench')
if os.environ['RELEASE_TAG'] != expected:
raise SystemExit(f'Release tag must be {expected}')
PY
- name: Smoke test isolated uvx installation
run: |
uvx --from "$PWD"/dist/abench-*.whl abench --version
uvx --from "$PWD"/dist/abench-*.whl abench --help
- uses: actions/upload-artifact@v4
with:
name: python-distributions
path: dist/*
if-no-files-found: error
publish:
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/abench
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: python-distributions
path: dist/
- name: Publish distributions using Trusted Publishing
uses: pypa/gh-action-pypi-publish@release/v1
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
# .idea/
.idea/

# Abstra
# Abstra is an AI-powered process automation framework.
Expand Down Expand Up @@ -216,3 +216,6 @@ __marimo__/

# Streamlit
.streamlit/secrets.toml

# Local benchmark results and caches
experiments/
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
repos:
- repo: local
hooks:
- id: ruff-check
name: Ruff check
entry: ruff check
language: system
types: [python]
- id: ruff-format
name: Ruff format
entry: ruff format --check
language: system
types: [python]
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
BSD 3-Clause License

Copyright (c) 2026, ActivitySim
Copyright (c) 2024, ActivitySim

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include LICENSE README.md RELEASING.md .pre-commit-config.yaml
recursive-include tests *.py *.yaml *.csv *.txt
recursive-include .github *.yml
recursive-include examples *.yaml
Loading
Loading