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
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
- run: uv sync
- run: uv sync --locked
- run: uv run ruff check .
- run: uv run ruff format --check .
ty:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
- run: uv sync
- run: uv sync --locked
- run: uv run ty check src tests
27 changes: 27 additions & 0 deletions .github/workflows/lock-upgrade.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: lock-upgrade
# Monthly refresh of uv.lock, opened as a pull request so CI runs against the
# new resolution before it lands. Trigger by hand from the Actions tab to
# upgrade sooner.
on:
schedule:
- cron: "0 6 1 * *" # 06:00 UTC on the first of every month
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
upgrade:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
- run: uv lock --upgrade
- uses: peter-evans/create-pull-request@v7
with:
branch: chore/lock-upgrade
commit-message: "Upgrade uv.lock"
title: "Upgrade uv.lock"
body: |
Monthly `uv lock --upgrade`. Close and reopen this PR to trigger CI
if the checks did not start.
delete-branch: true
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- run: uv sync --resolution ${{ matrix.resolution }}
- run: uv run pytest tests --cov=funlib.persistence --cov-report=term-missing --cov-report=xml
- run: uv run pytest tests --cov --cov-report=term-missing --cov-report=xml
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,3 @@ dmypy.json

*.sw[pmno]
daisy_logs
uv.lock
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,25 @@
# funlib.persistence
Interfaces for data (arrays and graphs) and storage formats (databases and file formats)

# installation
Regular installation for usage:
`pip install funlib.persistence`
## Install

Developer setup (pytest, ruff, ty come from the `dev` dependency group,
which `uv sync` installs by default):
```bash
pip install funlib.persistence # or: uv add funlib.persistence
```

## Contributing

The commands below are the ones CI runs, so a green local run means a green PR.

```bash
git clone https://github.com/funkelab/funlib.persistence
cd funlib.persistence
uv sync
uv run pytest tests
uv sync # Python, dependencies, dev tools (from uv.lock)
uv run pytest tests # tests with coverage
uv run ruff check . && uv run ruff format --check . # lint and formatting
uv run ty check src tests # types
```

The graph-database tests need a PostgreSQL server (CI starts one as a service, `PGUSER=postgres`); they are skipped when none is reachable.

`uv.lock` pins the development environment; the `lock-upgrade` workflow refreshes it monthly and opens a pull request.
22 changes: 18 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,20 @@ dependencies = [
[tool.setuptools.dynamic]
version = { attr = "funlib.persistence.__version__" }

[project.urls]
Source = "https://github.com/funkelab/funlib.persistence"
Issues = "https://github.com/funkelab/funlib.persistence/issues"

[dependency-groups]
# Installed by `uv sync` (PEP 735); not part of the published package.
# ruff and ty are pinned with == until uv.lock is committed: both change
# their rule sets between releases.
# ruff and ty versions come from uv.lock; `uv lock --upgrade` moves them.
dev = [
"coverage>=7.7.1",
"pytest>=8.3.5",
"pytest-cov>=6",
"pytest-mock>=3.14.0",
"ruff==0.17.3",
"ty==0.0.96",
"ruff>=0.17.3",
"ty>=0.0.96",
"types-psycopg2", # psycopg2 ships no inline types; ty reads this stub package
]

Expand All @@ -66,3 +69,14 @@ ignore = ["E501"] # the formatter owns line length
"tutorials/**/*.py" = ["E402"] # jupytext cells import mid-file
"examples/**/*.py" = ["E402"]
"__init__.py" = ["F401"] # re-exports

[tool.coverage.run]
branch = true
source = ["funlib.persistence"]

[tool.coverage.report]
# Floor measured from the first branch-enabled run; raise it when measured
# coverage is two or more points ahead, never lower it without saying why.
fail_under = 75
show_missing = true
skip_covered = true
Loading
Loading