Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
96898fb
Moving into a more modern tooling with uv
nanounanue Oct 16, 2025
1372c63
Remove RQ and redis dependencies
nanounanue Oct 16, 2025
223036d
loguru and icecream for logging and print-debug
nanounanue Oct 16, 2025
a3e77d8
Including pytest into pyproject.toml
nanounanue Oct 16, 2025
444e224
Upgrading packages. Moved to textual/typer/rich. WIP: dashboard
nanounanue Oct 20, 2025
534779a
Removed manage.py -> justfile
nanounanue Nov 9, 2025
5d83a18
SQLAlchemy 2.0 compatibility and database configuration improvements
nanounanue Dec 20, 2025
aa58d98
Modernize DirtyDuck tutorial infrastructure
nanounanue Dec 20, 2025
57551b0
WIP: Migrate from testing.postgresql to pytest-postgresql
nanounanue Dec 30, 2025
402bf54
Merge pytest-postgresql migration from tooling-migration
nanounanue Dec 30, 2025
c63d49c
WIP: Moving to pytest-postgresql
nanounanue Dec 30, 2025
d0f6398
WIP: migrate test infrastructure to pytest-postgresql and fix SQLAlc…
nanounanue Dec 30, 2025
0f01812
WIP: SQLAlchemy 2.0 and psycopg3 compatibility: major source code fixes
nanounanue Jan 1, 2026
676122c
WIP: Additional SQLAlchemy 2.0 and psycopg3 compatibility fixes
nanounanue Jan 5, 2026
e112a3c
fix(tests): resolve SQLAlchemy 2.0 test compatibility issues
nanounanue Jan 5, 2026
9a036b1
Merge dirtyduck-modernization: tutorial infrastructure updates
nanounanue Jan 7, 2026
3124358
fix(tests): replace csvkit/csvsql with pandas for test data loading
nanounanue Jan 7, 2026
c8958fb
fix(catwalk): NaN handling and Interval casting for psycopg3 compatib…
nanounanue Jan 7, 2026
ed69115
ci: update GitHub workflows for uv and Python 3.12
nanounanue Jan 7, 2026
662d7a4
refactor(postmodeling): remove deprecated module and adjusttext depen…
nanounanue Jan 7, 2026
31bdb8b
fix(ci): add ruff to dev dependencies and postgres to CI
nanounanue Jan 7, 2026
fa204d4
fix(deps): merge duplicate dev sections in pyproject.toml
nanounanue Jan 7, 2026
ba3e7c1
fix(lint): resolve undefined-name errors for CI
nanounanue Jan 7, 2026
eaf151b
ci: remove Docker PostgreSQL service
nanounanue Jan 7, 2026
4c3b5ec
fix(tests): update test_experiments to match sample_config changes
nanounanue Jan 8, 2026
a3abb07
fix(tests): clean up factory session in db_engine fixture teardown
nanounanue Jan 8, 2026
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
12 changes: 12 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[bumpversion]
current_version = 5.5.3
commit = True
tag = True

[bumpversion:file:pyproject.toml]
search = version = "{current_version}"
replace = version = "{new_version}"

[bumpversion:file:src/triage/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ develop
.pytest_cache
tox.ini
.travis.yml
tutorial.sh
.pyup.yml
.python-version
.python-version.current
Expand Down
27 changes: 27 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Triage Database Configuration
# Copy this file to .env and fill in your values

# PostgreSQL Connection (Option 1: Standard PostgreSQL variables)
# Official PostgreSQL environment variables
PGHOST=localhost
PGPORT=5432
PGUSER=postgres
PGPASSWORD=your_password_here
PGDATABASE=triage

# PostgreSQL Connection (Option 2: DATABASE_URL)
# Full connection string format
# DATABASE_URL=postgresql://user:password@host:port/database

# Notes:
# - Triage checks for database configuration in this order:
# 1. --dbfile CLI argument
# 2. database.yaml in current directory
# 3. DATABASE_URL environment variable
# 4. PGHOST, PGUSER, PGDATABASE, PGPASSWORD, PGPORT (PostgreSQL standard)
# 5. .env file (loaded automatically)
#
# - You can use direnv to automatically load these variables:
# echo "dotenv" > .envrc && direnv allow
#
# - For production, consider using a secrets manager instead of .env files
22 changes: 12 additions & 10 deletions .github/workflows/build-mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- master
paths:
- 'docs/**'

jobs:
docs:
name: Build Docs and Serve to Github Pages
Expand All @@ -16,17 +16,19 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v4

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: 3.9

version: "latest"

- name: Set up Python 3.12
run: uv python install 3.12

- name: Install dependencies
run: |
pip install --upgrade pip && pip install -r requirement/dev.txt
pip install git+https://github.com/dssg/triage.git@master
uv sync --extra docs
git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com'

- name: Publish docs
run: mkdocs gh-deploy -f "$(pwd)/docs/mkdocs.yml"
run: uv run mkdocs gh-deploy -f "$(pwd)/docs/mkdocs.yml"
26 changes: 11 additions & 15 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,36 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: 3.9
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
version: "latest"
- name: Set up Python
run: uv python install 3.12
- name: Build a binary wheel and a source tarball
run: python -m build
run: uv build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: Publish python distribution to PyPI
if: startsWith(github.ref, 'refs/tags/')
needs:
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/triage
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

41 changes: 25 additions & 16 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,42 @@ name: Python package

on:
push:
tags:
- '*'

branches:
- master
- 'tooling-migration'
pull_request:
branches:
- master

jobs:
build:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10']
python-version: ['3.12']

# Note: pytest-postgresql creates its own temporary PostgreSQL instances
# using system PostgreSQL binaries, so no Docker service is needed

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: ${{ matrix.python-version }}
version: "latest"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran
sudo apt-get install -y libblas-dev liblapack-dev libatlas-base-dev gfortran postgresql postgresql-contrib
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install -r requirement/include/build.txt
pip install -r requirement/include/test-management.txt
- name: Test with tox
uv sync --extra dev
- name: Run linter
run: |
uv run ruff check src/
- name: Run tests
run: |
tox
uv run pytest src/tests/ -v --tb=short --timeout=300 -x
timeout-minutes: 30
27 changes: 26 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ venv/
my_db_config.yaml
database.yaml
database*.yaml
.env
.envrc
triage_tui.log
dirtyduck/triage/**

*~
Expand All @@ -28,4 +31,26 @@ dirtyduck/triage/**
src/triage/component/postmodeling/postmodeling_tmp.ipynb
src/triage/component/postmodeling/model_class_testing.py
src/triage/component/postmodeling/model_class_testing.ipynb
src/triage/component/postmodeling/model_groups_testing.ipynb
src/triage/component/postmodeling/model_groups_testing.ipynb

# Personal/local files
.secrets
TODO.org
TRIAGE_ICON.md
channels-lock.scm
manifest.scm

# Session handoff files (local-only)
docs/triage-session-summary.org
docs/triage-session-summary.md
working-outline.md
CLAUDE.md
AGENTS.md
GEMINI.md
GIT_REMOTE
.project
handoff-trace.log
README.org
COMPACT.md
COMPACT-archive-*.md
.claude
12 changes: 0 additions & 12 deletions .pyup.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ before_install:
- sudo apt-get update
- sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran
install:
- pip install -r requirement/include/build.txt -r requirement/include/test-management.txt
- python -m pip install --upgrade pip
- curl -LsSf https://astral.sh/uv/install.sh | sh
- export PATH="$HOME/.local/bin:$PATH"
- uv pip install --system 'tox>=4.14,<5' codecov
env:
matrix:
- BOTO_CONFIG=/tmp/nowhere
Expand Down
67 changes: 29 additions & 38 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,21 @@ Triage could always use more documentation, whether as part of the
official Triage docs, in docstrings, or even on the web in blog posts,
articles, and such.

The [documentation site](https://dssg.github.io/triage) runs on [mkdocs](https://www.mkdocs.org) and is controlled by the [docs/sources](docs/sources) directory. We recommend building the docs locally to preview any documentation pages. The python dependencies for this are handled by [requirement/dev.txt](requirement/dev.txt):
The [documentation site](https://dssg.github.io/triage) runs on [mkdocs](https://www.mkdocs.org) and is controlled by the [docs/sources](docs/sources) directory. We recommend building the docs locally to preview any documentation pages. Install the documentation dependencies with [uv](https://docs.astral.sh/uv/) using the `docs` extra:

```
pip install -r requirement/dev.txt
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync --extra docs
```

Once this is done, you can modify any of the pages under the documentation root directory, and change general doc site configuration in [docs/mkdocs.yml](docs/mkdocs.yml). While modifying a documentation page, you can preview your changes by running the mkdocs dev server:
```
manage docs
just docs
```

Or directly:
```
cd docs && uv run mkdocs serve
```

### Submit Feedback
Expand Down Expand Up @@ -76,10 +82,10 @@ Triage always has a backlog of issues. Want to help out? Here's how to set up tr
5. When you're done making changes, check that your changes pass flake8
and the tests, including testing other Python versions with tox:

$ pip install -r requirement/test.txt
$ flake8 triage tests
$ python setup.py test or py.test
$ tox
$ uv sync --extra test
$ uv run flake8 triage src/tests
$ uv run pytest
$ uv run tox -e py3

6. Commit your changes and push your branch to GitHub. If you've made multiple commits, squash them into one. Each pull request should be one commit (unless there are multiple logical places to split up the code, for instance a big reformatting commit followed by a smaller commit that actually changes behavior). To make the pull request easier to create, the last commit on the branch should be formatted like the following.

Expand Down Expand Up @@ -114,44 +120,29 @@ This section describes the initial setup of a Triage development environment tha

$ git clone git@github.com:your_name_here/triage.git

3. Set up your local environment.

You can control your development environment any way you'd like (virtualenv, pyenv, _etc._).

To quickly bootstrap an environment, invoke the executable `develop` script &ndash; found in the triage repo root &ndash; from your system shell:
3. Install development tools (optional but recommended):

$ ./develop
$ curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ~/.local/bin

The script will launch a "wizard," which will suggest set-up steps and optionally execute these, for example:
The `just` command runner provides convenient shortcuts for common development tasks. If you prefer not to install it, you can run the commands directly (see the justfile for the full commands).

(install) begin
4. Set up your local environment.

(pyenv) installed ✓

(python-3.6.2) installed ✓

(virtualenv) installed ✓

(activation) installed ✓

(libs) install?
1) yes, install {pip install -r requirement/main.txt -r requirement/test.txt -r requirement/dev.txt}
2) no, ignore
#? 1
You can control your development environment any way you'd like (virtualenv, pyenv, _etc._).

Alternatively, you might manage your environment via `virtualenvwrapper`:
To quickly bootstrap an environment, install uv with the official script and sync the project with the development extras:

$ mkvirtualenv triage
$ cd triage/
$ python setup.py develop
$ curl -LsSf https://astral.sh/uv/install.sh | sh
$ uv sync --extra dev

Or simply via the `venv` module:
This creates a local `.venv` that uv will reuse. You can either activate it manually (`source .venv/bin/activate`) or invoke tools through uv (for example, `uv run pytest`).

$ cd triage/
$ python -m venv --prompt triage venv
$ python setup.py develop
If you prefer to manage virtual environments manually, create one however you like and install the project in editable mode with the development extras:

Regardless of your Python environment, we do recommend installing `triage` in development mode, via `python setup.py develop` or `pip install -e .` (The `develop` script handles this for you.)
$ python -m venv .venv
$ source .venv/bin/activate
$ pip install --upgrade pip
$ uv pip install --system --editable .[dev]


Small Changes
Expand All @@ -166,10 +157,10 @@ Triage has an extensive test suite that is run with every commit by travis-ci. A
- [Wikipedia Page](https://en.wikipedia.org/wiki/Test-driven_development)
- [Test Driven Development: what it is, and what it is not](https://medium.freecodecamp.org/test-driven-development-what-it-is-and-what-it-is-not-41fa6bca02a2)

In addition to any requirements needed by the main library (which should be installed when you ran `python setup.py develop` to gain access to Triage itself), you can ensure all testing requirements are installed with:
In addition to the project dependencies installed via `uv sync --extra dev`, you can refresh testing requirements explicitly with:

```
pip install -r requirement/test.txt
uv sync --extra test
```

This is mentioned in the main setup section, but you may have to rerun it over time as test requirements change.
Expand Down
Loading
Loading