Skip to content

Commit

Permalink
fix(shared): move to static version bumping to prevent issues with cu…
Browse files Browse the repository at this point in the history
…stomers custom builds (#2386)
  • Loading branch information
heitorlessa authored Jun 6, 2023
1 parent 8b71185 commit 8f0b808
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 176 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ jobs:

# We use a pinned version of Poetry to be certain it won't modify source code before we create a hash
- name: Install poetry
run: pipx install git+https://github.com/python-poetry/poetry@68b88e5390720a3dd84f02940ec5200bfce39ac6 # v1.5.0
run: |
pipx install git+https://github.com/python-poetry/poetry@68b88e5390720a3dd84f02940ec5200bfce39ac6 # v1.5.0
pipx inject poetry git+https://github.com/monim67/poetry-bumpversion@ef49c63acef7fe8680789ddb31f376cc898f0012 # v0.3.0
- name: Bump package version
id: versioning
Expand Down Expand Up @@ -291,7 +293,7 @@ jobs:
- name: Create Git Tag
run: |
git add pyproject.toml
git add pyproject.toml aws_lambda_powertools/shared/version.py
git commit -m "chore: version bump"
git tag -a v"${RELEASE_VERSION}" -m "release_version: v${RELEASE_VERSION}"
git push origin v"${RELEASE_VERSION}"
Expand Down Expand Up @@ -332,7 +334,7 @@ jobs:
id: create-pr
uses: ./.github/actions/create-pr
with:
files: "pyproject.toml"
files: "pyproject.toml aws_lambda_powertools/shared/version.py"
temp_branch_prefix: "ci-bump"
pull_request_title: "chore(ci): bump version to ${{ needs.seal.outputs.RELEASE_VERSION }}"
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ target:

dev:
pip install --upgrade pip pre-commit poetry
@$(MAKE) dev-version-plugin
poetry install --extras "all"
pre-commit install

dev-gitpod:
pip install --upgrade pip poetry
@$(MAKE) dev-version-plugin
poetry install --extras "all"
pre-commit install

Expand Down Expand Up @@ -106,3 +108,7 @@ changelog:

mypy:
poetry run mypy --pretty aws_lambda_powertools examples


dev-version-plugin:
poetry self add git+https://github.com/monim67/poetry-bumpversion@ef49c63acef7fe8680789ddb31f376cc898f0012
17 changes: 2 additions & 15 deletions aws_lambda_powertools/shared/version.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
"""
This file serves to create a constant that informs
the current version of the Powertools package and exposes it in the main module
"""Exposes version constant to avoid circular dependencies."""

Since Python 3.8 there the built-in importlib.metadata
When support for Python3.7 is dropped, we can remove the optional importlib_metadata dependency
See: https://docs.python.org/3/library/importlib.metadata.html
"""
import sys

if sys.version_info >= (3, 8):
from importlib.metadata import version
else:
from importlib_metadata import version

VERSION = version("aws-lambda-powertools")
VERSION = "2.16.1"
Loading

0 comments on commit 8f0b808

Please sign in to comment.