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
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
- package-ecosystem: "uv" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
Expand Down
25 changes: 20 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,29 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --group coverage --group tests --group init_bo4e
- name: Set up test database
run: |
python -m pip install --upgrade pip
pip install tox
cd src
uv run python -m borm.db.postgresql_db.create_env_file
docker compose -f borm/db/postgresql_db/docker-compose.yaml up -d
- name: Pull and generate BO4E models
run: |
mkdir -p bo4e_schemas
cd bo4e_schemas
uv run bost -t v202401.0.1 -o ./
uv run bo4e-generator -i ./ -o ../src/borm/models -ot sql_model
- name: Run Tests and Record Coverage
run: |
tox -e coverage
cd tests
uv run python -m borm
uv run coverage run -m pytest
uv run coverage html --omit tests/*,src/borm/models/*
uv run coverage report --fail-under 80 --omit tests/*,src/borm/models/*
- name: Tear down test database
run: docker compose -f src/borm/db/postgresql_db/docker-compose.yaml down -v
11 changes: 4 additions & 7 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ jobs:
tool: ["black", "isort"]
steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[formatting]
run: uv sync --group formatting
- name: ${{ matrix.tool }} Code Formatter
run: |
${{ matrix.tool }} . --check
run: uv run ${{ matrix.tool }} . --check
24 changes: 18 additions & 6 deletions .github/workflows/integrationtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,26 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: uv sync --group tests --group init_bo4e
- name: Set up test database
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run the Unit Tests via Tox
cd src
uv run python -m borm.db.postgresql_db.create_env_file
docker compose -f borm/db/postgresql_db/docker-compose.yaml up -d
- name: Pull and generate BO4E models
run: |
tox -e integrationtests
mkdir -p bo4e_schemas
cd bo4e_schemas
uv run bost -t v202401.0.1 -o ./
uv run bo4e-generator -i ./ -o ../src/borm/models -ot sql_model
- name: Run the Integration Tests
run: |
uv run python -m borm
uv run pytest
- name: Tear down test database
run: docker compose -f src/borm/db/postgresql_db/docker-compose.yaml down -v
15 changes: 6 additions & 9 deletions .github/workflows/packaging_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run Packaging Test
run: |
tox -e test_packaging
- name: Build package
run: uv build
- name: Check package
run: uv publish --dry-run
110 changes: 94 additions & 16 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,113 @@
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install tox

# integrationtests
- name: Install Dependencies (integrationtests)
run: uv sync --group tests --group init_bo4e
- name: Set up test database
run: |
cd src
uv run python -m borm.db.postgresql_db.create_env_file
docker compose -f borm/db/postgresql_db/docker-compose.yaml up -d
- name: Pull and generate BO4E models (integrationtests)
run: |
mkdir -p bo4e_schemas
cd bo4e_schemas
uv run bost -t v202401.0.1 -o ./
uv run bo4e-generator -i ./ -o ../src/borm/models -ot sql_model
- name: Run the Integration Tests
run: |
uv run python -m borm
uv run pytest
- name: Tear down test database (integrationtests)
run: docker compose -f src/borm/db/postgresql_db/docker-compose.yaml down -v

# unittests
- name: Set up test database (unittests)
run: |
cd src
uv run python -m borm.db.postgresql_db.create_env_file
docker compose -f borm/db/postgresql_db/docker-compose.yaml up -d
- name: Tear down test database (unittests)
run: docker compose -f src/borm/db/postgresql_db/docker-compose.yaml down -v

# linting
- name: Install Dependencies (linting)
run: uv sync --group linting --group init_bo4e
- name: Pull and generate BO4E models (linting)
run: |
mkdir -p bo4e_schemas
cd bo4e_schemas
uv run bost -t v202401.0.1 -o ./
uv run bo4e-generator -i ./ -o ../src/borm/models -ot sql_model
- name: Run pylint
run: |
uv run pylint src/borm --disable R0801 --ignore-paths 'src/borm/models'
uv run pylint src/borm/models --rcfile=./.pylintrc_autogen_code
uv run pylint tests --rcfile=tests/.pylintrc

# coverage
- name: Install Dependencies (coverage)
run: uv sync --group coverage --group tests --group init_bo4e
- name: Set up test database (coverage)
run: |
cd src
uv run python -m borm.db.postgresql_db.create_env_file
docker compose -f borm/db/postgresql_db/docker-compose.yaml up -d
- name: Pull and generate BO4E models (coverage)
run: |
mkdir -p bo4e_schemas
cd bo4e_schemas
uv run bost -t v202401.0.1 -o ./
uv run bo4e-generator -i ./ -o ../src/borm/models -ot sql_model
- name: Run Tests and Record Coverage
run: |
cd tests
uv run python -m borm
uv run coverage run -m pytest
uv run coverage html --omit tests/*,src/borm/models/*
uv run coverage report --fail-under 80 --omit tests/*,src/borm/models/*
- name: Tear down test database (coverage)
run: docker compose -f src/borm/db/postgresql_db/docker-compose.yaml down -v

# type_check
- name: Install Dependencies (type_check)
run: uv sync --group type_check --group init_bo4e
- name: Pull and generate BO4E models (type_check)
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run tox
mkdir -p bo4e_schemas
cd bo4e_schemas
uv run bost -t v202401.0.1 -o ./
uv run bo4e-generator -i ./ -o ../src/borm/models -ot sql_model
- name: Run mypy
run: |
tox
uv run mypy --show-error-codes tests
uv run mypy --show-error-codes src/borm

# spell_check
- name: Install Dependencies (spell_check)
run: uv sync --group spell_check
- name: Run codespell
run: |
uv run codespell --ignore-words=domain-specific-terms.txt src/
uv run codespell --ignore-words=domain-specific-terms.txt README.md

# build-n-publish:
# name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
# runs-on: ubuntu-latest
# needs: tests
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python
# uses: actions/setup-python@v7
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install .[test_packaging]
# - name: Install uv
# uses: astral-sh/setup-uv@v9.0.0
# - name: Build a binary wheel and a source tarball
# run: |
# python -m build
# uv build
# - name: Publish distribution 📦 to PyPI
# if: startsWith(github.ref, 'refs/tags/v')
# uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
39 changes: 32 additions & 7 deletions .github/workflows/pythonlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,39 @@ jobs:
linter-env: ["linting", "type_check", "spell_check"]
steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
- name: Install Dependencies (linting)
if: matrix.linter-env == 'linting'
run: uv sync --group linting --group init_bo4e
- name: Install Dependencies (type_check)
if: matrix.linter-env == 'type_check'
run: uv sync --group type_check --group init_bo4e
- name: Install Dependencies (spell_check)
if: matrix.linter-env == 'spell_check'
run: uv sync --group spell_check
- name: Generate BO4E models
if: matrix.linter-env == 'linting' || matrix.linter-env == 'type_check'
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run ${{ matrix.linter-env }} via Tox
mkdir -p bo4e_schemas
cd bo4e_schemas
uv run bost -t v202401.0.1 -o ./
uv run bo4e-generator -i ./ -o ../src/borm/models -ot sql_model
- name: Run pylint
if: matrix.linter-env == 'linting'
run: |
tox -e ${{ matrix.linter-env }}
uv run pylint src/borm --disable R0801 --ignore-paths 'src/borm/models'
uv run pylint src/borm/models --rcfile=./.pylintrc_autogen_code
uv run pylint tests --rcfile=tests/.pylintrc
- name: Run mypy
if: matrix.linter-env == 'type_check'
run: |
uv run mypy --show-error-codes tests
uv run mypy --show-error-codes src/borm
- name: Run codespell
if: matrix.linter-env == 'spell_check'
run: |
uv run codespell --ignore-words=domain-specific-terms.txt src/
uv run codespell --ignore-words=domain-specific-terms.txt README.md
16 changes: 9 additions & 7 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: uv sync --group tests
- name: Run the Unit Tests
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run the Unit Tests via Tox
run: |
tox -e unittests
cd src
uv run python -m borm.db.postgresql_db.create_env_file
docker compose -f borm/db/postgresql_db/docker-compose.yaml up -d
cd borm/db/postgresql_db
docker compose -f docker-compose.yaml down -v
Comment on lines +21 to +25

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed accurate, but this is pre-existing behavior, not something this migration changed — the old tox.ini's [testenv:unittests] also only ran tox -e setup_testpostgresql + tox -e remove_testpostgresql, never pytest (there's no separate unit-test suite in this repo, only tests/integrationtests, which is what integrationtests.yml actually exercises). I translated the tox behavior 1:1 rather than silently changing what this check does, since pytest (3.11, ubuntu-latest) is a required status check on main and I didn't want to risk changing its semantics without a separate discussion. Worth a follow-up issue if the maintainers want this job renamed or made to actually assert something.

8 changes: 6 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 24.1.1
rev: 25.1.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
Expand All @@ -22,3 +22,7 @@ repos:
- id: isort
name: isort (pyi)
types: [pyi]
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.11.32
hooks:
- id: uv-lock
Loading
Loading