From 01c4eb72b5e7cfe62bb104e44e001ec43a1b0109 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Mon, 21 Oct 2024 22:18:15 -0400 Subject: [PATCH 1/6] remove the pypi version of core that gets installed as a sidecar so that it does not conflict with main --- .github/workflows/publish-internal.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-internal.yml b/.github/workflows/publish-internal.yml index 6df86dce..5dc82b75 100644 --- a/.github/workflows/publish-internal.yml +++ b/.github/workflows/publish-internal.yml @@ -72,6 +72,7 @@ jobs: versions_published: ${{ steps.published.outputs.versions }} - run: | hatch version ${{ steps.next.outputs.internal_release_version }}+$(git rev-parse HEAD) + sed -i "/dbt-core[>=~]=/d" "pyproject.toml" hatch build --clean hatch run build:check-all working-directory: ./${{ inputs.package }} From 6662858994773bdf967c0411c30735afdcc11be0 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Mon, 21 Oct 2024 22:49:54 -0400 Subject: [PATCH 2/6] remove the prerelease component of the version since we don't use that for internal pypi --- .github/workflows/publish-internal.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-internal.yml b/.github/workflows/publish-internal.yml index 5dc82b75..c6959cf9 100644 --- a/.github/workflows/publish-internal.yml +++ b/.github/workflows/publish-internal.yml @@ -53,7 +53,9 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - id: package - run: echo "version=$(hatch version)" >> $GITHUB_OUTPUT + run: | + hatch version release # strip the pre-release off since we don't use that internally + echo "version=$(hatch version)" >> $GITHUB_OUTPUT working-directory: ./${{ inputs.package }} - id: published run: | From 13c06ff65896ce54a73a39aba7aebaf0f6708cd0 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Tue, 22 Oct 2024 11:54:32 -0400 Subject: [PATCH 3/6] fix file reference for pyproject.toml, break script into smaller steps --- .github/workflows/publish-internal.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-internal.yml b/.github/workflows/publish-internal.yml index c6959cf9..812b9735 100644 --- a/.github/workflows/publish-internal.yml +++ b/.github/workflows/publish-internal.yml @@ -54,7 +54,8 @@ jobs: aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - id: package run: | - hatch version release # strip the pre-release off since we don't use that internally + # strip the pre-release off to find all iterations of this patch + hatch version release echo "version=$(hatch version)" >> $GITHUB_OUTPUT working-directory: ./${{ inputs.package }} - id: published @@ -72,11 +73,11 @@ jobs: with: version_number: ${{ steps.package.outputs.version }} versions_published: ${{ steps.published.outputs.versions }} - - run: | - hatch version ${{ steps.next.outputs.internal_release_version }}+$(git rev-parse HEAD) - sed -i "/dbt-core[>=~]=/d" "pyproject.toml" - hatch build --clean - hatch run build:check-all + - name: "Update version to internal PyPI format" + run: hatch version ${{ steps.next.outputs.internal_release_version }}+$(git rev-parse HEAD) + working-directory: ./${{ inputs.package }} + - name: "Remove dbt-core from build requirements" + run: sed -i "/dbt-core[>=~]=/d" "./pyproject.toml" working-directory: ./${{ inputs.package }} - run: | export HATCH_INDEX_USER=${{ secrets.AWS_USER }} @@ -93,5 +94,7 @@ jobs: --output text \ --query repositoryEndpoint) + hatch build --clean + hatch run build:check-all hatch publish working-directory: ./${{ inputs.package }} From 6c7f1dd8a78f6901ca8372e4c9ef54689f88f38a Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Tue, 22 Oct 2024 19:47:18 -0400 Subject: [PATCH 4/6] fix sed expression --- .github/workflows/publish-internal.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-internal.yml b/.github/workflows/publish-internal.yml index 812b9735..5701336b 100644 --- a/.github/workflows/publish-internal.yml +++ b/.github/workflows/publish-internal.yml @@ -77,7 +77,7 @@ jobs: run: hatch version ${{ steps.next.outputs.internal_release_version }}+$(git rev-parse HEAD) working-directory: ./${{ inputs.package }} - name: "Remove dbt-core from build requirements" - run: sed -i "/dbt-core[>=~]=/d" "./pyproject.toml" + run: sed -i "" -e "/dbt-core[<>~=]/d" ./pyproject.toml working-directory: ./${{ inputs.package }} - run: | export HATCH_INDEX_USER=${{ secrets.AWS_USER }} From d44ffff4830391503ccb303edcdb3c14b9a1452b Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Tue, 22 Oct 2024 19:54:13 -0400 Subject: [PATCH 5/6] fix sed expression --- .github/workflows/publish-internal.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-internal.yml b/.github/workflows/publish-internal.yml index 5701336b..5f5c6582 100644 --- a/.github/workflows/publish-internal.yml +++ b/.github/workflows/publish-internal.yml @@ -77,7 +77,7 @@ jobs: run: hatch version ${{ steps.next.outputs.internal_release_version }}+$(git rev-parse HEAD) working-directory: ./${{ inputs.package }} - name: "Remove dbt-core from build requirements" - run: sed -i "" -e "/dbt-core[<>~=]/d" ./pyproject.toml + run: sed -i "/dbt-core[<>~=]/d" ./pyproject.toml working-directory: ./${{ inputs.package }} - run: | export HATCH_INDEX_USER=${{ secrets.AWS_USER }} From 5476e143e30fe6210154907f2ae4a2f5ac832cce Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Tue, 22 Oct 2024 21:35:13 -0400 Subject: [PATCH 6/6] fix version to be semver instead of hatch standard --- .github/workflows/publish-internal.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-internal.yml b/.github/workflows/publish-internal.yml index 5f5c6582..c7170ba8 100644 --- a/.github/workflows/publish-internal.yml +++ b/.github/workflows/publish-internal.yml @@ -74,7 +74,9 @@ jobs: version_number: ${{ steps.package.outputs.version }} versions_published: ${{ steps.published.outputs.versions }} - name: "Update version to internal PyPI format" - run: hatch version ${{ steps.next.outputs.internal_release_version }}+$(git rev-parse HEAD) + run: | + VERSION=${{ steps.next.outputs.internal_release_version }}+$(git rev-parse HEAD) + tee <<< "version = \"$VERSION\"" ./src/dbt/adapters/athena/__version__.py working-directory: ./${{ inputs.package }} - name: "Remove dbt-core from build requirements" run: sed -i "/dbt-core[<>~=]/d" ./pyproject.toml