Skip to content

Commit 69e4fd8

Browse files
committed
Improved versioning
1 parent fbd487c commit 69e4fd8

5 files changed

Lines changed: 9 additions & 7 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ jobs:
131131
docker push $DOCKER_BUILD_REPOSITORY:amd64
132132
#docker tag $DOCKER_BUILD_REPOSITORY:arm64-$SHORT_SHA $DOCKER_BUILD_REPOSITORY:arm64
133133
#docker push $DOCKER_BUILD_REPOSITORY:arm64
134+
- name: Extract version from __version__.py
135+
id: extract-version
136+
run: |
137+
VERSION=$(grep -oP "(?<=^__version__ = ')[^']+" prepline_general/__version__.py)
138+
echo "VERSION=$VERSION" >> $GITHUB_ENV
134139
- name: Push multiarch manifest
135140
run: |
136141
#docker manifest create ${DOCKER_REPOSITORY}:latest $DOCKER_BUILD_REPOSITORY:amd64 $DOCKER_BUILD_REPOSITORY:arm64
@@ -139,7 +144,6 @@ jobs:
139144
#docker manifest create ${DOCKER_REPOSITORY}:$SHORT_SHA $DOCKER_BUILD_REPOSITORY:amd64 $DOCKER_BUILD_REPOSITORY:arm64
140145
docker manifest create ${DOCKER_REPOSITORY}:$SHORT_SHA $DOCKER_BUILD_REPOSITORY:amd64
141146
docker manifest push $DOCKER_REPOSITORY:$SHORT_SHA
142-
VERSION=$(grep -m1 version preprocessing-pipeline-family.yaml | cut -d ' ' -f2)
143147
#docker manifest create ${DOCKER_REPOSITORY}:$VERSION $DOCKER_BUILD_REPOSITORY:amd64 $DOCKER_BUILD_REPOSITORY:arm64
144148
docker manifest create ${DOCKER_REPOSITORY}:$VERSION $DOCKER_BUILD_REPOSITORY:amd64
145149
docker manifest push ${DOCKER_REPOSITORY}:$VERSION

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ check-version:
136136
# Fail if syncing version would produce changes
137137
scripts/version-sync.sh -c \
138138
-s CHANGELOG.md \
139-
-f preprocessing-pipeline-family.yaml release \
140139
-f ${PACKAGE_NAME}/api/app.py release \
141140
-f ${PACKAGE_NAME}/api/general.py release
142141

@@ -145,6 +144,5 @@ check-version:
145144
version-sync:
146145
scripts/version-sync.sh \
147146
-s CHANGELOG.md \
148-
-f preprocessing-pipeline-family.yaml release \
149147
-f ${PACKAGE_NAME}/api/app.py release \
150148
-f ${PACKAGE_NAME}/api/general.py release

prepline_general/__version__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.0.85" # pragma: no cover

prepline_general/api/general.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from starlette.datastructures import Headers
3434
from starlette.types import Send
3535

36+
from prepline_general.__version__ import __version__ as API_VERSION
3637
from prepline_general.api.models.form_params import GeneralFormParams
3738
from prepline_general.api.filetypes import get_validated_mimetype
3839
from unstructured.documents.elements import Element
@@ -602,7 +603,7 @@ def return_content_type(filename: str):
602603

603604

604605
@router.get("/general/v0/general", include_in_schema=False)
605-
@router.get("/general/v0.0.84/general", include_in_schema=False)
606+
@router.get(f"/general/{API_VERSION}/general", include_in_schema=False)
606607
async def handle_invalid_get_request():
607608
raise HTTPException(
608609
status_code=status.HTTP_405_METHOD_NOT_ALLOWED, detail="Only POST requests are supported."
@@ -617,7 +618,7 @@ async def handle_invalid_get_request():
617618
description="Description",
618619
operation_id="partition_parameters",
619620
)
620-
@router.post("/general/v0.0.84/general", include_in_schema=False)
621+
@router.post(f"/general/{API_VERSION}/general", include_in_schema=False)
621622
def general_partition(
622623
request: Request,
623624
# cannot use annotated type here because of a bug described here:

preprocessing-pipeline-family.yaml

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)