Skip to content

Commit 99aea3e

Browse files
committed
Merge branch 'main' into faststream-reloaded
# Conflicts: # docker-compose.yaml # poetry.lock # pyproject.toml # src/bootstrap/config.py # src/common/bootstrap.py # src/common/faststream.py # src/http_app/__init__.py
2 parents b12bba3 + 438d8e9 commit 99aea3e

File tree

99 files changed

+5127
-3930
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+5127
-3930
lines changed

.github/workflows/ci-pipeline.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ jobs:
3636
# Install the cosign tool except on PR
3737
# https://github.com/sigstore/cosign-installer
3838
- name: Install cosign
39-
uses: sigstore/cosign-installer@v3.6.0
39+
uses: sigstore/cosign-installer@v3.7.0
4040

4141
- name: Setup Docker buildx
42-
uses: docker/setup-buildx-action@v3.6.1
42+
uses: docker/setup-buildx-action@v3.8.0
4343

4444
# Login against a Docker registry except on PR
4545
# https://github.com/docker/login-action
@@ -54,7 +54,7 @@ jobs:
5454
# https://github.com/docker/build-push-action
5555
- name: Build test image
5656
id: build-test
57-
uses: docker/build-push-action@v6.8.0
57+
uses: docker/build-push-action@v6.13.0
5858
with:
5959
context: .
6060
load: true
@@ -71,7 +71,7 @@ jobs:
7171
# https://github.com/docker/metadata-action
7272
- name: Extract Docker metadata
7373
id: meta
74-
uses: docker/metadata-action@v5.5.1
74+
uses: docker/metadata-action@v5.6.1
7575
with:
7676
# list of Docker images to use as base name for tags
7777
images: |
@@ -86,7 +86,7 @@ jobs:
8686
# https://github.com/docker/build-push-action
8787
- name: Build and push production image
8888
id: build-and-push
89-
uses: docker/build-push-action@v6.8.0
89+
uses: docker/build-push-action@v6.13.0
9090
with:
9191
context: .
9292
target: http_app

.github/workflows/github-pages.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,19 @@ jobs:
2727
- name: Checkout
2828
uses: actions/checkout@v4
2929

30-
- name: Set up Python 3.12
30+
- name: Set up Python 3.13
3131
uses: actions/setup-python@v5
3232
with:
33-
python-version: "3.12"
33+
python-version: "3.13"
34+
35+
- name: Install uv
36+
uses: astral-sh/setup-uv@v5
37+
with:
38+
# Install a specific version of uv.
39+
version: "0.5.13"
3440

3541
- name: Install dependencies
36-
run: |
37-
python -m pip install --upgrade pip
38-
python -m pip install poetry
39-
poetry config virtualenvs.create false
40-
make dev-dependencies
42+
run: make dev-dependencies
4143

4244
- name: Build static pages
4345
run: make docs-build

.github/workflows/python-code-style.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v4
20-
- name: Set up Python 3.12
20+
- name: Set up Python 3.13
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: "3.12"
23+
python-version: "3.13"
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v5
26+
with:
27+
# Install a specific version of uv.
28+
version: "0.5.13"
2429
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
python -m pip install poetry
28-
poetry config virtualenvs.create false
29-
make dev-dependencies
30+
run: make dev-dependencies
3031
- name: Check code style
31-
run: |
32-
make format
32+
run: make format

.github/workflows/python-lint.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v4
20-
- name: Set up Python 3.12
20+
- name: Set up Python 3.13
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: "3.12"
23+
python-version: "3.13"
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v5
26+
with:
27+
# Install a specific version of uv.
28+
version: "0.5.13"
2429
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
python -m pip install poetry
28-
poetry config virtualenvs.create false
29-
make dev-dependencies
30+
run: make dev-dependencies
3031
- name: Lint with ruff
3132
run: make lint

.github/workflows/python-quality.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v4
20-
- name: Set up Python 3.12
20+
- name: Set up Python 3.13
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: "3.12"
23+
python-version: "3.13"
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v5
26+
with:
27+
# Install a specific version of uv.
28+
version: "0.5.13"
2429
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
python -m pip install poetry
28-
poetry config virtualenvs.create false
29-
make dev-dependencies
30+
run: make dev-dependencies
3031
- name: Test & publish code coverage
3132
uses: paambaati/[email protected]
3233
env:

.github/workflows/python-tests.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
test:
1616
strategy:
1717
matrix:
18-
version: ["3.9", "3.10", "3.11", "3.12"]
18+
version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1919
os: [ubuntu-latest]
2020
runs-on: ${{ matrix.os }}
2121
steps:
@@ -24,12 +24,13 @@ jobs:
2424
uses: actions/setup-python@v5
2525
with:
2626
python-version: "${{ matrix.version }}"
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v5
29+
with:
30+
# Install a specific version of uv.
31+
version: "0.5.13"
2732
- name: Install dependencies
28-
run: |
29-
python -m pip install --upgrade pip
30-
python -m pip install poetry
31-
poetry config virtualenvs.create false
32-
make dev-dependencies
33+
run: make dev-dependencies
3334
- name: Test with pytest
3435
run: |
3536
make ci-test

.github/workflows/python-typing.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v4
20-
- name: Set up Python 3.12
20+
- name: Set up Python 3.13
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: "3.12"
23+
python-version: "3.13"
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v5
26+
with:
27+
# Install a specific version of uv.
28+
version: "0.5.13"
2429
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
python -m pip install poetry
28-
poetry config virtualenvs.create false
29-
make dev-dependencies
30+
run: make dev-dependencies
3031
- name: Check typing
3132
run: make typing

.gitlab-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include:
2+
- local: .gitlab_ci/base.yml

.gitlab_ci/_templates.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
variables:
2+
DOCKER_IMAGE_TAG: $CI_COMMIT_SHA
3+
DOCKER_IMAGE_NAME: $CI_PROJECT_NAME
4+
DOCKER_IMAGE_FULL_TAG: $CI_REGISTRY_IMAGE/$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG
5+
DOCKER_VERSION: 27.4
6+
7+
.docker-gitlab-login: &docker-gitlab-login
8+
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
9+
10+
# Build Docker image for test
11+
# TODO: Sign image using Cosign
12+
.build-and-push-gitlab:
13+
image: docker:$DOCKER_VERSION
14+
services:
15+
- docker:$DOCKER_VERSION-dind
16+
variables:
17+
DOCKER_BUILDKIT: 1
18+
DOCKER_PLATFORM: ""
19+
DOCKER_TARGET: ""
20+
DOCKER_CACHE_FULL_TAG: $CI_REGISTRY_IMAGE/$DOCKER_IMAGE_NAME:cache
21+
before_script:
22+
- apk add --no-cache bash git
23+
script:
24+
- docker buildx create --use
25+
- docker buildx inspect --bootstrap
26+
- *docker-gitlab-login
27+
- echo "Building $DOCKER_IMAGE_FULL_TAG - Cache from $DOCKER_CACHE_FULL_TAG"
28+
- if [[ -n "$DOCKER_TARGET" ]]; then export TARGET_ARG="--target $DOCKER_TARGET"; fi;
29+
- if [[ -n "$DOCKER_PLATFORM" ]]; then export PLATFORM_ARG="--platform $DOCKER_PLATFORM"; fi;
30+
- if [[ -n "$DOCKER_PLATFORM" ]]; then export PLATFORM_SUFFIX="-$(echo $DOCKER_PLATFORM | sed 's/\///')"; fi;
31+
# remove \ from platform variable
32+
- export SUFFIX=$(echo $DOCKER_PLATFORM | sed 's/\///')
33+
- docker buildx build --push
34+
$TARGET_ARG
35+
--tag $DOCKER_IMAGE_FULL_TAG$PLATFORM_SUFFIX
36+
$PLATFORM_ARG
37+
--cache-from type=registry,ref=$DOCKER_CACHE_FULL_TAG
38+
--cache-to type=registry,ref=$DOCKER_CACHE_FULL_TAG
39+
.
40+
41+
# Architectures are hardcoded for multiarch, need to make this better
42+
.multiarch-manifest-gitlab:
43+
image: docker:$DOCKER_VERSION
44+
services:
45+
- docker:$DOCKER_VERSION-dind
46+
script:
47+
- *docker-gitlab-login
48+
- echo "Building $DOCKER_IMAGE_FULL_TAG multiarch manifest"
49+
- docker buildx imagetools create
50+
--tag $DOCKER_IMAGE_FULL_TAG
51+
$DOCKER_IMAGE_FULL_TAG-linuxamd64
52+
$DOCKER_IMAGE_FULL_TAG-linuxarm64
53+
54+
.promote-image:
55+
image: docker:$DOCKER_VERSION
56+
variables:
57+
PROMOTED_ENVIRONMENT: "dev"
58+
DOCKER_BUILDKIT: 1
59+
services:
60+
- docker:$DOCKER_VERSION-dind
61+
script:
62+
- *docker-gitlab-login
63+
# Remove the UTC offset, not supported by `date` in docker image (busybox)
64+
- export CLEAN_DATETIME=$(echo "$CI_JOB_STARTED_AT" | sed 's/+00:00//' | sed 's/Z//')
65+
# Transform in unix timestamp
66+
- export UNIX_TIMESTAMP=$(date -d "$CLEAN_DATETIME" -D "%Y-%m-%dT%H:%M:%S" +%s)
67+
- echo "Unix timestamp - $UNIX_TIMESTAMP"
68+
- echo "Tagging $CI_REGISTRY_IMAGE/$DOCKER_IMAGE_NAME:$PROMOTED_ENVIRONMENT-$UNIX_TIMESTAMP from $DOCKER_IMAGE_FULL_TAG"
69+
- docker buildx imagetools create
70+
--annotation index:org.opencontainers.image.version=$CI_COMMIT_SHORT_SHA
71+
--annotation index:org.opencontainers.image.revision=$CI_COMMIT_SHA
72+
--annotation index:org.opencontainers.image.source=$CI_PROJECT_URL
73+
--annotation index:org.opencontainers.image.created=$CI_JOB_STARTED_AT
74+
--tag $CI_REGISTRY_IMAGE/$DOCKER_IMAGE_NAME:$PROMOTED_ENVIRONMENT-$UNIX_TIMESTAMP
75+
$DOCKER_IMAGE_FULL_TAG
76+
77+
.python-typing:
78+
image: $DOCKER_IMAGE_FULL_TAG
79+
script:
80+
- make typing
81+
82+
.python-lint:
83+
image: $DOCKER_IMAGE_FULL_TAG
84+
script:
85+
- make lint
86+
87+
.python-format:
88+
image: $DOCKER_IMAGE_FULL_TAG
89+
script:
90+
- make format
91+
92+
.python-tests:
93+
image: $DOCKER_IMAGE_FULL_TAG
94+
script:
95+
- make test
96+

.gitlab_ci/base.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
variables:
2+
# Use docker.io for Docker Hub if empty
3+
REGISTRY: registry.gitlab.com
4+
# IMAGE_NAME is defined as <account>/<repo> in GitLab CI/CD
5+
IMAGE_NAME: $CI_REGISTRY_IMAGE
6+
TEST_TAG: $REGISTRY/$CI_PROJECT_PATH:test
7+
8+
stages:
9+
- build
10+
- test
11+
- deploy
12+
13+
include:
14+
- local: /.gitlab_ci/_templates.yml
15+
- local: /.gitlab_ci/build.yml
16+
- local: /.gitlab_ci/test.yml
17+
- local: /.gitlab_ci/deploy.yml

0 commit comments

Comments
 (0)