diff --git a/CHANGELOG.md b/CHANGELOG.md index f38119f..43bfe79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## [1.0.2] - 2022-07-15 + +### Fixed + +- Fix the boto3 session when the profile is not set. + ## [1.0.1] - 2022-02-17 ### Fixed diff --git a/aws_codeartifact_poetry/aws/session.py b/aws_codeartifact_poetry/aws/session.py index 7c7a2a4..54d1b5c 100644 --- a/aws_codeartifact_poetry/aws/session.py +++ b/aws_codeartifact_poetry/aws/session.py @@ -36,4 +36,4 @@ def get_session(region="us-east-1", profile=None, role=None, context=None): aws_session_token=credentials['SessionToken'] ) - return boto3 + return boto3.Session(region_name=region) diff --git a/pyproject.toml b/pyproject.toml index 3b931c8..fc02966 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "aws-codeartifact-poetry" -version = "1.0.1" +version = "1.0.2" description = "AWS CodeArtifact Poetry CLI" license = "Proprietary" authors = [ "Lucas Vieira " ] diff --git a/tests/aws/test_session.py b/tests/aws/test_session.py index 255f7b7..b1c9130 100644 --- a/tests/aws/test_session.py +++ b/tests/aws/test_session.py @@ -14,8 +14,7 @@ def test_session_default(mock_sts): """Should return the default boto3 object.""" result = session.get_session() - assert boto3 == result - assert type(result) is not boto3.Session + assert type(result) is boto3.Session @patch("aws_codeartifact_poetry.aws.session.boto3") @@ -30,8 +29,7 @@ def test_session_with_role_without_context(mock_sts): """Should return the default boto3 object.""" result = session.get_session(role=IAM_ROLE) - assert boto3 == result - assert type(result) is not boto3.Session + assert type(result) is boto3.Session def test_session_with_role_and_context(mock_sts):