Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-45676: Update repo infrastructure #160

Merged
merged 24 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b9bfc05
Use SQuaRE's run-nox workflow
jonathansick Aug 8, 2024
0ec1644
Drop dependencies GitHub Actions workflow
jonathansick Aug 8, 2024
3fabd16
Update nox to use uv for installation
jonathansick Aug 8, 2024
79424cb
Update dependencies
jonathansick Aug 8, 2024
8407a96
Document uv and GHA updates in changelog
jonathansick Aug 8, 2024
03c9da1
Adopt ruff-shared.toml
jonathansick Aug 9, 2024
0229fb7
Update for new ruff linting
jonathansick Aug 9, 2024
b6787de
Start upgrade to Pydantic 2
jonathansick Aug 9, 2024
8a4e277
Switch over to faststream
jonathansick Aug 9, 2024
b50e356
Update to Python 3.12.3-slim-bookworm
jonathansick Aug 12, 2024
e44e828
Adopt testcontainers for kafka testing
jonathansick Aug 12, 2024
ac52c83
Run Testcontainers Kafka via nox
jonathansick Aug 13, 2024
4b19350
Update to Python 3.12.5
jonathansick Aug 13, 2024
dc779bc
Update GitHub Actions to install testcontainers
jonathansick Aug 13, 2024
66c6a85
Disable sphinx warnings-as-errors for now
jonathansick Aug 13, 2024
e1fcc4a
Clean up doc build warnings
jonathansick Aug 13, 2024
07ce51f
Update changelog for faststream/testcontainers
jonathansick Aug 13, 2024
9a2eb13
Drop docker-compose configuration
jonathansick Aug 13, 2024
d934b3e
Drop configurations for the schema registry
jonathansick Aug 13, 2024
941ba82
Log additional data about Kafka on startup
jonathansick Aug 13, 2024
bb1c2b5
Manually connect the broker
jonathansick Aug 14, 2024
8641d70
Import kafka_router from handlers module
jonathansick Aug 14, 2024
5d6116f
Ensure consumer context dependency is initialized
jonathansick Aug 14, 2024
1bac26f
Prepare for 0.10.0 release
jonathansick Aug 14, 2024
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
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
Loading