Skip to content

Commit 3af49a4

Browse files
authored
Merge pull request #1 from ActivitySim/feature/generalized-benchmarks
Introduce abench and publish version 0.1.0 to PyPI
2 parents 6f54c60 + e4f3dcd commit 3af49a4

43 files changed

Lines changed: 4577 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Tests
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
workflow_call:
7+
permissions:
8+
contents: read
9+
concurrency:
10+
group: tests-${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
jobs:
13+
unit:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
python: ['3.10', '3.11', '3.12']
19+
timeout-minutes: 20
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python }}
25+
cache: pip
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: '22'
29+
- run: python -m pip install '.[test]' -r tests/requirements.txt
30+
- run: ruff check . && ruff format --check .
31+
- run: python -m pytest -m 'not docker' -q
32+
- run: python -m build
33+
- name: Verify installed wheel and packaged resources
34+
run: |
35+
python -m venv /tmp/abench-wheel
36+
/tmp/abench-wheel/bin/pip install dist/*.whl
37+
cd /tmp
38+
/tmp/abench-wheel/bin/abench --help
39+
/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()"
40+
docker:
41+
runs-on: ubuntu-latest
42+
timeout-minutes: 30
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: actions/setup-python@v5
46+
with:
47+
python-version: '3.11'
48+
cache: pip
49+
- run: python -m pip install . pytest
50+
- name: Build exact sources and exercise serial and multiprocess runs
51+
env:
52+
ABENCH_DOCKER_TESTS: '1'
53+
run: |
54+
mkdir -p experiments
55+
python -m pytest tests/test_docker.py -v --basetemp=experiments/ci
56+
- name: Retain reports and diagnostics
57+
if: always()
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: docker-experiments
61+
path: |
62+
experiments/ci/**/*.html
63+
experiments/ci/**/*.json
64+
experiments/ci/**/*.jsonl
65+
experiments/ci/**/*.txt
66+
experiments/ci/**/*.log
67+
experiments/ci/**/*.csv
68+
experiments/ci/**/*.yaml
69+
if-no-files-found: ignore

‎.github/workflows/publish.yml‎

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Publish to PyPI
2+
on:
3+
release:
4+
types: [published]
5+
permissions:
6+
contents: read
7+
concurrency:
8+
group: pypi-${{ github.event.release.tag_name }}
9+
cancel-in-progress: false
10+
jobs:
11+
tests:
12+
uses: ./.github/workflows/ci.yml
13+
build:
14+
needs: tests
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.11'
21+
- uses: astral-sh/setup-uv@v6
22+
- run: python -m pip install build twine
23+
# Build the wheel from the sdist, so both published formats are exercised.
24+
- run: python -m build
25+
- run: python -m twine check --strict dist/*
26+
- run: python -m pip install dist/*.whl
27+
- name: Match release tag to package version
28+
env:
29+
RELEASE_TAG: ${{ github.event.release.tag_name }}
30+
run: |
31+
python - <<'PY'
32+
import os
33+
from importlib.metadata import version
34+
expected = 'v' + version('abench')
35+
if os.environ['RELEASE_TAG'] != expected:
36+
raise SystemExit(f'Release tag must be {expected}')
37+
PY
38+
- name: Smoke test isolated uvx installation
39+
run: |
40+
uvx --from "$PWD"/dist/abench-*.whl abench --version
41+
uvx --from "$PWD"/dist/abench-*.whl abench --help
42+
- uses: actions/upload-artifact@v4
43+
with:
44+
name: python-distributions
45+
path: dist/*
46+
if-no-files-found: error
47+
publish:
48+
needs: build
49+
runs-on: ubuntu-latest
50+
environment:
51+
name: pypi
52+
url: https://pypi.org/p/abench
53+
permissions:
54+
id-token: write
55+
steps:
56+
- uses: actions/download-artifact@v4
57+
with:
58+
name: python-distributions
59+
path: dist/
60+
- name: Publish distributions using Trusted Publishing
61+
uses: pypa/gh-action-pypi-publish@release/v1

‎.gitignore‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ cython_debug/
186186
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
187187
# and can be added to the global gitignore or merged into this file. For a more nuclear
188188
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
189-
# .idea/
189+
.idea/
190190

191191
# Abstra
192192
# Abstra is an AI-powered process automation framework.
@@ -216,3 +216,6 @@ __marimo__/
216216

217217
# Streamlit
218218
.streamlit/secrets.toml
219+
220+
# Local benchmark results and caches
221+
experiments/

‎.pre-commit-config.yaml‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: ruff-check
5+
name: Ruff check
6+
entry: ruff check
7+
language: system
8+
types: [python]
9+
- id: ruff-format
10+
name: Ruff format
11+
entry: ruff format --check
12+
language: system
13+
types: [python]

‎LICENSE‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
BSD 3-Clause License
22

33
Copyright (c) 2026, ActivitySim
4+
Copyright (c) 2024, ActivitySim
45

56
Redistribution and use in source and binary forms, with or without
67
modification, are permitted provided that the following conditions are met:

‎MANIFEST.in‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include LICENSE README.md RELEASING.md .pre-commit-config.yaml
2+
recursive-include tests *.py *.yaml *.csv *.txt
3+
recursive-include .github *.yml
4+
recursive-include examples *.yaml

0 commit comments

Comments
 (0)