git clone git@github.com:iangow/db2pq.git
cd db2pq
uv sync --extra devOptional SAS support:
uv sync --extra dev --extra sasOptional docs tooling:
uv sync --extra dev --extra docsIf you prefer uv pip, this is equivalent:
uv pip install -e ".[dev]"- Create a branch for your change.
- Make code and documentation updates together.
- Commit with a clear message.
- Open a pull request (or merge directly if you are maintaining solo).
Run tests with:
uv run python -m pytestDatabase-backed integration tests are intended to run locally. They are marked
with local_pg automatically when they rely on the PostgreSQL test fixtures in
tests/conftest.py.
Run only the local PostgreSQL integration tests with:
uv run python -m pytest -m local_pgRun everything except the local PostgreSQL integration tests with:
uv run python -m pytest -m "not local_pg"These tests expect a locally accessible PostgreSQL instance and will skip
cleanly if the configured database is unavailable or a required source table is
missing. The default source database is iangow, and tests may depend on known
tables such as crsp.msf_v2.
If you are an automated coding agent or AI assistant working in this repository:
- Treat tests marked
local_pgas local integration tests, not CI requirements. - Do not assume a PostgreSQL test database exists unless the local environment indicates one is available.
- Prefer
uv run python -m pytest -m "not local_pg"for quick validation when database access is unknown. - Use
uv run python -m pytest -m local_pgonly when a local PostgreSQL database is expected to be available. - If a
local_pgtest skips because the database or a required table is missing, that is expected behavior and should not be treated as a code failure. - Some local integration tests depend on known source tables with expected
schemas and types, including
crsp.msf_v2. - When adding new local integration tests, prefer the existing fixtures in
tests/conftest.pyand gate table-specific tests withrequire_source_table(...).
You can override connection settings with:
export DB2PQ_TEST_SRC_PGUSER=...
export DB2PQ_TEST_SRC_PGHOST=...
export DB2PQ_TEST_SRC_PGPORT=...
export DB2PQ_TEST_SRC_DB=...
export DB2PQ_TEST_DST_PGUSER=...
export DB2PQ_TEST_DST_PGHOST=...
export DB2PQ_TEST_DST_PGPORT=...
export DB2PQ_TEST_DST_DB=...Build the documentation site with:
./scripts/build-docs.shFor local docs iteration, prefer:
uv run --extra docs quartodoc build --config docs/_quarto.yml --watch
uv run --extra docs quarto preview docsThese uv commands resolve db2pq from the local editable checkout, so docs
development uses in-repo changes rather than the latest PyPI release.
This project uses semantic versioning:
- Patch (
0.1.x) for bug fixes and documentation-only changes. - Minor (
0.x.0) for backwards-compatible feature additions. - Major (
x.0.0) for breaking changes.
Update the version in pyproject.toml before tagging a new release.
- Keep
README.mdaccurate for installation and quickstart. - Record user-visible changes in
CHANGELOG.md. - Follow
RELEASING.mdfor tag and release creation.