Skip to content

Commit

Permalink
0.14.0, add --version
Browse files Browse the repository at this point in the history
  • Loading branch information
meeuw committed May 15, 2021
1 parent 7aaa311 commit 20eecf8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Usage: aws-credential-process [OPTIONS]
Get output suitable for aws credential process
Options:
--version Show the version and exit.
--access-key-id TEXT
--secret-access-key TEXT
--mfa-oath-slot TEXT how the MFA slot is named, check using ykman
Expand Down
3 changes: 3 additions & 0 deletions aws_credential_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import pynentry
import toml

__version__ = "0.14.0"

# Restore logger, set by ykman.cli.__main__ import
logging.disable(logging.NOTSET)

Expand Down Expand Up @@ -466,6 +468,7 @@ def token_code():


@click.command()
@click.version_option(__version__)
@click.option("--access-key-id")
@click.option("--secret-access-key")
@click.option(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "aws-credential-process"
version = "0.13.0"
version = "0.14.0"
description = "AWS Credential Process"
authors = ["Dick Marinus <[email protected]>"]
readme = "README.md"
Expand Down
15 changes: 13 additions & 2 deletions test/test_aws_credential_process.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
"""
Tests for aws-credential-process
"""
import datetime
import unittest.mock
import pytest
import tempfile
import pathlib

import toml
import freezegun
import click.testing
import moto
Expand All @@ -13,7 +18,7 @@
def test_load_from_credentials(monkeypatch):
keyring_set_password = unittest.mock.MagicMock()
monkeypatch.setattr("keyring.set_password", keyring_set_password)
a = aws_credential_process.AWSCredSession.load_from_credentials(
aws_credential_process.AWSCredSession.load_from_credentials(
{
"Expiration": datetime.datetime(2019, 1, 1, 12, tzinfo=UTC),
"AccessKeyId": "1234",
Expand Down Expand Up @@ -170,3 +175,9 @@ def test_parse_config():
"mfa_serial_number": "arn:aws:iam::other:mfa/user",
},
}


def test_version():
path = pathlib.Path(__file__).resolve().parents[1] / 'pyproject.toml'
pyproject = toml.loads(open(str(path)).read())
assert aws_credential_process.__version__ == pyproject['tool']['poetry']['version']

0 comments on commit 20eecf8

Please sign in to comment.