Skip to content

Commit

Permalink
Merge pull request #160 from lsst-sqre:tickets/DM-45676
Browse files Browse the repository at this point in the history
DM-45676: Update repo infrastructure
  • Loading branch information
jonathansick authored Aug 14, 2024
2 parents a542c17 + 1bac26f commit 1930f04
Show file tree
Hide file tree
Showing 41 changed files with 1,129 additions and 1,225 deletions.
46 changes: 24 additions & 22 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: CI

env:
PYTHON_VERSION: "3.12"

"on":
merge_group: {}
pull_request: {}
Expand All @@ -21,41 +24,39 @@ jobs:
lint:

runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: ${{ env.PYTHON_VERSION }}

- name: Run pre-commit
uses: pre-commit/[email protected].0
uses: pre-commit/[email protected].1

test:
runs-on: ubuntu-latest

strategy:
matrix:
python:
- "3.11"
timeout-minutes: 15

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install nox
run: |
pip install --upgrade pip
pip install --upgrade nox
python-version: ${{ env.PYTHON_VERSION }}

- name: Run nox
run: "nox -s typing test"
uses: lsst-sqre/run-nox@v1
with:
cache-dependency: "requirements/*.txt"
cache-key-prefix: test
nox-sessions: "typing test"
python-version: ${{ env.PYTHON_VERSION }}
nox-package: "nox[uv] testcontainers[kafka]"

docs:
runs-on: ubuntu-latest
Expand All @@ -76,15 +77,16 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install nox
run: |
pip install --upgrade pip
pip install --upgrade nox
python-version: ${{ env.PYTHON_VERSION }}

- name: Run nox
run: "nox -s docs"
uses: lsst-sqre/run-nox@v1
with:
cache-dependency: "requirements/*.txt"
cache-key-prefix: docs
nox-sessions: "docs"
python-version: ${{ env.PYTHON_VERSION }}
nox-package: "nox[uv] testcontainers[kafka]"

# Only attempt documentation uploads for long-lived branches, tagged
# releases, and pull requests from ticket branches. This avoids version
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/dependencies.yaml

This file was deleted.

31 changes: 13 additions & 18 deletions .github/workflows/periodic-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

name: Periodic CI

env:
PYTHON_VERSION: "3.12"

"on":
schedule:
- cron: "0 12 * * 1"
Expand All @@ -15,30 +18,22 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10

strategy:
matrix:
python:
- "3.11"

steps:
- uses: actions/checkout@v4

# Use the oldest supported version of Python to update dependencies,
# not the matrixed Python version, since this accurately reflects
# how dependencies should later be updated.
- name: Run neophile
uses: lsst-sqre/run-neophile@v1
- name: Update dependencies
uses: lsst-sqre/run-nox@v1
with:
python-version: "3.11"
mode: update

- name: Install nox
run: |
pip install --upgrade pip
pip install --upgrade nox
nox-sessions: "update-deps"
python-version: ${{ env.PYTHON_VERSION }}

- name: Run nox
run: "nox -s typing test docs"
uses: lsst-sqre/run-nox@v1
with:
nox-sessions: "typing test docs"
python-version: ${{ env.PYTHON_VERSION }}
use-cache: false
nox-package: "nox[uv] testcontainers[kafka]"

- name: Report status
if: always()
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: check-yaml
Expand All @@ -11,12 +11,12 @@ repos:
args: [--autofix, --indent=2, '--top-keys=name,doc,type']

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.290
rev: v0.5.7
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/psf/black
rev: 23.11.0
rev: 24.8.0
hooks:
- id: black
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

<!-- scriv-insert-here -->

<a id='changelog-0.10.0'></a>
## 0.10.0 (2024-08-14)

### New features

- Ook now uses [faststream](https://faststream.airt.ai/latest/) for managing its Kafka consumer and producer. This is also how the Squarebot ecosystem operates. With this change, Ook no longer uses the Confluent Schema Registry. Schemas are instead developed as Pydantic models.

### Other changes

- Use `uv` for installing and compiling dependencies in `noxfile.py`.
- Update GitHub Actions workflows to use the [lsst-sqre/run-nox](https://github.com/lsst-sqre/run-nox) GitHub Action.
- Adopt `ruff-shared.toml` for shared Ruff configuration (from https://github.com/lsst/templates)
- Update Docker base to Python 3.12.5-slim-bookworm.
- Switch to [testcontainers](https://testcontainers.com) for running Kafka during test sessions. The Kafka brokers is automatically started by the `nox` sessions.

<a id='changelog-0.9.1'></a>
## 0.9.1 (2024-01-29)

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# - Runs a non-root user.
# - Sets up the entrypoint and port.

FROM python:3.11.5-slim-bullseye as base-image
FROM python:3.12.5-slim-bookworm as base-image

Check warning on line 17 in Dockerfile

View workflow job for this annotation

GitHub Actions / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

# Update system packages
COPY scripts/install-base-packages.sh .
Expand Down
47 changes: 0 additions & 47 deletions docker-compose.yaml

This file was deleted.

1 change: 1 addition & 0 deletions docs/documenteer.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ nitpick_ignore = [
["py:class", "starlette.routing.Route"],
["py:class", "starlette.routing.BaseRoute"],
["py:exc", "starlette.exceptions.HTTPException"],
["py:class", "pydantic_settings.sources.CliSettingsSource"],
]

[sphinx.intersphinx.projects]
Expand Down
3 changes: 0 additions & 3 deletions docs/user-guide/configuration-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,3 @@ Configuration reference

.. autopydantic_settings:: ook.config.KafkaConnectionSettings

.. autoclass:: kafkit.settings.KafkaSecurityProtocol

.. autoclass:: kafkit.settings.KafkaSaslMechanism
Loading

0 comments on commit 1930f04

Please sign in to comment.