Skip to content

Improved versioning #504

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion .github/workflows/bump_libraries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ jobs:
package=${package%\[*}
changelog_message="Bump $package to ${{ steps.metadata.outputs.new-version }}"
./scripts/version-increment.sh "$changelog_message"
make version-sync
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Bump libraries and release"
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ jobs:
docker push $DOCKER_BUILD_REPOSITORY:amd64
#docker tag $DOCKER_BUILD_REPOSITORY:arm64-$SHORT_SHA $DOCKER_BUILD_REPOSITORY:arm64
#docker push $DOCKER_BUILD_REPOSITORY:arm64
- name: Extract version from __version__.py
id: extract-version
run: |
VERSION=$(python3 -c "with open('prepline_general/__version__.py') as f: exec(f.read()); print(__version__)")
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Push multiarch manifest
run: |
#docker manifest create ${DOCKER_REPOSITORY}:latest $DOCKER_BUILD_REPOSITORY:amd64 $DOCKER_BUILD_REPOSITORY:arm64
Expand All @@ -139,7 +144,6 @@ jobs:
#docker manifest create ${DOCKER_REPOSITORY}:$SHORT_SHA $DOCKER_BUILD_REPOSITORY:amd64 $DOCKER_BUILD_REPOSITORY:arm64
docker manifest create ${DOCKER_REPOSITORY}:$SHORT_SHA $DOCKER_BUILD_REPOSITORY:amd64
docker manifest push $DOCKER_REPOSITORY:$SHORT_SHA
VERSION=$(grep -m1 version preprocessing-pipeline-family.yaml | cut -d ' ' -f2)
#docker manifest create ${DOCKER_REPOSITORY}:$VERSION $DOCKER_BUILD_REPOSITORY:amd64 $DOCKER_BUILD_REPOSITORY:arm64
docker manifest create ${DOCKER_REPOSITORY}:$VERSION $DOCKER_BUILD_REPOSITORY:amd64
docker manifest push ${DOCKER_REPOSITORY}:$VERSION
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.85
* Set version in '__version__.py' file
* Remove version-sync.py script and preprocessing_family_pipeline.yaml file

## 0.0.84
* Patch h11 CVE
* bump httpcore version due to h11 dependency
Expand Down
19 changes: 0 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,22 +129,3 @@ tidy:
check-scripts:
# Fail if any of these files have warnings
scripts/shellcheck.sh

## check-version: run check to ensure version in CHANGELOG.md matches references in files
.PHONY: check-version
check-version:
# Fail if syncing version would produce changes
scripts/version-sync.sh -c \
-s CHANGELOG.md \
-f preprocessing-pipeline-family.yaml release \
-f ${PACKAGE_NAME}/api/app.py release \
-f ${PACKAGE_NAME}/api/general.py release

## version-sync: update references to version with most recent version from CHANGELOG.md
.PHONY: version-sync
version-sync:
scripts/version-sync.sh \
-s CHANGELOG.md \
-f preprocessing-pipeline-family.yaml release \
-f ${PACKAGE_NAME}/api/app.py release \
-f ${PACKAGE_NAME}/api/general.py release
1 change: 1 addition & 0 deletions prepline_general/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.0.85" # pragma: no cover
5 changes: 3 additions & 2 deletions prepline_general/api/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from starlette.datastructures import Headers
from starlette.types import Send

from prepline_general.__version__ import __version__ as API_VERSION
from prepline_general.api.models.form_params import GeneralFormParams
from prepline_general.api.filetypes import get_validated_mimetype
from unstructured.documents.elements import Element
Expand Down Expand Up @@ -602,7 +603,7 @@ def return_content_type(filename: str):


@router.get("/general/v0/general", include_in_schema=False)
@router.get("/general/v0.0.84/general", include_in_schema=False)
@router.get(f"/general/{API_VERSION}/general", include_in_schema=False)
async def handle_invalid_get_request():
raise HTTPException(
status_code=status.HTTP_405_METHOD_NOT_ALLOWED, detail="Only POST requests are supported."
Expand All @@ -617,7 +618,7 @@ async def handle_invalid_get_request():
description="Description",
operation_id="partition_parameters",
)
@router.post("/general/v0.0.84/general", include_in_schema=False)
@router.post(f"/general/{API_VERSION}/general", include_in_schema=False)
def general_partition(
request: Request,
# cannot use annotated type here because of a bug described here:
Expand Down
2 changes: 0 additions & 2 deletions preprocessing-pipeline-family.yaml

This file was deleted.

154 changes: 0 additions & 154 deletions scripts/version-sync.sh

This file was deleted.

Loading