Skip to content

fix(shared): move to static version bumping to prevent issues with customers custom builds #2386

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

Merged
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
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