diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5381fab..6a24ee5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ 3.8, 3.9, "3.10" ] + python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ] steps: - uses: actions/checkout@v2 @@ -19,7 +19,7 @@ jobs: - name: Install Poetry uses: abatilo/actions-poetry@v2 with: - poetry-version: 1.4 + poetry-version: 2.4 - name: Install dependencies run: | poetry install @@ -32,6 +32,7 @@ jobs: publish: runs-on: ubuntu-latest + needs: test steps: - uses: actions/checkout@v2 - name: Build and publish to pypi diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 194d67b..bedda52 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ 3.8, 3.9, "3.10" ] + python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ] steps: - uses: actions/checkout@v2 @@ -22,7 +22,7 @@ jobs: - name: Install Poetry uses: abatilo/actions-poetry@v2 with: - poetry-version: 1.4 + poetry-version: 2.4 - name: Install dependencies run: | poetry install diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ffdcadc..2c2a5fa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: name: "Sort module imports" args: ["--profile", "black", "--filter-files"] - repo: https://github.com/pycqa/flake8 - rev: 3.9.2 + rev: 6.1.0 hooks: - id: flake8 additional_dependencies: diff --git a/poetry.lock b/poetry.lock index f614c73..cc7631a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.4.0 and should not be changed by hand. [[package]] name = "astor" @@ -785,19 +785,19 @@ test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-co [[package]] name = "pluggy" -version = "1.3.0" +version = "1.6.0" description = "plugin and hook calling mechanisms for python" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" groups = ["dev"] files = [ - {file = "pluggy-1.3.0-py3-none-any.whl", hash = "sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7"}, - {file = "pluggy-1.3.0.tar.gz", hash = "sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12"}, + {file = "pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746"}, + {file = "pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3"}, ] [package.extras] dev = ["pre-commit", "tox"] -testing = ["pytest", "pytest-benchmark"] +testing = ["coverage", "pytest", "pytest-benchmark"] [[package]] name = "pre-commit" @@ -850,16 +850,19 @@ toml = ["tomli (>=1.2.3) ; python_version < \"3.11\""] [[package]] name = "pyfakefs" -version = "4.7.0" -description = "pyfakefs implements a fake file system that mocks the Python file system modules." +version = "6.2.0" +description = "Implements a fake file system that mocks the Python file system modules." optional = false -python-versions = ">=3.7" +python-versions = ">=3.10" groups = ["dev"] files = [ - {file = "pyfakefs-4.7.0-py3-none-any.whl", hash = "sha256:29203a7482b25406dd3ea41c8740be2697c6058b0f6577485c3ae9cd4c5e96cd"}, - {file = "pyfakefs-4.7.0.tar.gz", hash = "sha256:f22d30d93d2989bf2d2c67b606a14cbab2df0be912c09dcdb590ea4931073ade"}, + {file = "pyfakefs-6.2.0-py3-none-any.whl", hash = "sha256:0968a49db692694ffed420e54a9f1cbae4636637b880e8ab09c8ccc0f11bd7ae"}, + {file = "pyfakefs-6.2.0.tar.gz", hash = "sha256:e59a36db447bf509ce9c97ab3d1510c08cc51895c5311325a560a5e5b5dc1940"}, ] +[package.extras] +doc = ["furo (>=2025.12.19)", "myst-parser (>=5.0.0)", "sphinx (>=7.0.0)"] + [[package]] name = "pyflakes" version = "2.3.1" @@ -878,7 +881,7 @@ version = "2.19.2" description = "Pygments is a syntax highlighting package written in Python." optional = false python-versions = ">=3.8" -groups = ["main"] +groups = ["main", "dev"] files = [ {file = "pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b"}, {file = "pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887"}, @@ -889,26 +892,27 @@ windows-terminal = ["colorama (>=0.4.6)"] [[package]] name = "pytest" -version = "7.4.2" +version = "9.0.3" description = "pytest: simple powerful testing with Python" optional = false -python-versions = ">=3.7" +python-versions = ">=3.10" groups = ["dev"] files = [ - {file = "pytest-7.4.2-py3-none-any.whl", hash = "sha256:1d881c6124e08ff0a1bb75ba3ec0bfd8b5354a01c194ddd5a0a870a48d99b002"}, - {file = "pytest-7.4.2.tar.gz", hash = "sha256:a766259cfab564a2ad52cb1aae1b881a75c3eb7e34ca3779697c23ed47c47069"}, + {file = "pytest-9.0.3-py3-none-any.whl", hash = "sha256:2c5efc453d45394fdd706ade797c0a81091eccd1d6e4bccfcd476e2b8e0ab5d9"}, + {file = "pytest-9.0.3.tar.gz", hash = "sha256:b86ada508af81d19edeb213c681b1d48246c1a91d304c6c81a427674c17eb91c"}, ] [package.dependencies] -colorama = {version = "*", markers = "sys_platform == \"win32\""} -exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -iniconfig = "*" -packaging = "*" -pluggy = ">=0.12,<2.0" -tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} +colorama = {version = ">=0.4", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1", markers = "python_version < \"3.11\""} +iniconfig = ">=1.0.1" +packaging = ">=22" +pluggy = ">=1.5,<2" +pygments = ">=2.7.2" +tomli = {version = ">=1", markers = "python_version < \"3.11\""} [package.extras] -testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] +dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "requests", "setuptools", "xmlschema"] [[package]] name = "pytest-cov" @@ -1055,10 +1059,10 @@ files = [ ] [package.dependencies] -botocore = ">=1.12.36,<2.0a.0" +botocore = ">=1.12.36,<2.0a0" [package.extras] -crt = ["botocore[crt] (>=1.20.29,<2.0a.0)"] +crt = ["botocore[crt] (>=1.20.29,<2.0a0)"] [[package]] name = "setuptools" @@ -1221,4 +1225,4 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess [metadata] lock-version = "2.1" python-versions = "^3.10" -content-hash = "49d455dbcb6b89b286af95667f60e1bee471b89ad2c8e6c3faee1bd6010ff188" +content-hash = "d19b012b20b0aeaa0748d2193a15e9997d38c422ec929ff29f73ea88eb6b248c" diff --git a/pyproject.toml b/pyproject.toml index 7dd034c..a5fd9f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,6 +6,13 @@ authors = ["David Steiner "] license = "MIT" readme = "README.md" homepage = "https://github.com/Validus-Risk-Management/partifact" +classifiers = [ + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", +] [tool.poetry.scripts] partifact = "partifact.main:app" @@ -37,8 +44,8 @@ isort = "^5.12.0" mypy = "^0.910" pep8-naming = "^0.12.1" pre-commit = "^2.14.0" -pyfakefs = "^4.5.0" -pytest = "^7.2.0" +pyfakefs = "^6.2.0" +pytest = "^9.0.3" pytest-mock = "^3.6.1" pytest-cov = "^4.0.0" diff --git a/tests/conftest.py b/tests/conftest.py index 5949846..571d5f5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -8,7 +8,7 @@ URL_TEMPLATE = "https://{code_artifact_domain}-{aws_account}.d.codeartifact.{aws_region}.amazonaws.com/pypi/{code_artifact_repository}" -@pytest.fixture() +@pytest.fixture def write_conf(fs): """Fixture to write a configuration entry.""" @@ -23,7 +23,7 @@ def _write(repository: str, **kwargs): return _write -@pytest.fixture() +@pytest.fixture def add_conf(write_conf): """Fixture to add a test configuration entry.""" @@ -97,7 +97,9 @@ def __init__(self, aws): self.aws = aws def assume_role( - self, RoleArn=None, RoleSessionName=None # noqa : boto3 argument naminge + self, + RoleArn=None, # noqa: N803 + RoleSessionName=None, # noqa: N803 ): """Mimicking boto3.client('sts').""" self.aws.register_role(RoleArn) @@ -116,13 +118,15 @@ def __init__(self, aws): self.aws = aws def get_authorization_token( - self, domain=None, domainOwner=None # noqa : boto3 argument naminge + self, + domain=None, + domainOwner=None, # noqa: N803 ): """Mimicking boto3.client('codeartifact').""" return self.aws._get_authorization_token(domain, domainOwner) -@pytest.fixture() +@pytest.fixture def aws(mocker): """Swaps boto3 with a dummy implementation.""" dummy_aws = DummyAWS() @@ -131,7 +135,7 @@ def aws(mocker): return dummy_aws -@pytest.fixture() +@pytest.fixture def subprocess_mock(mocker): """Patches subprocess.run so that it does not execute anything.""" mock = mocker.patch("subprocess.run") diff --git a/tests/test_login.py b/tests/test_login.py index ee5c485..f7fa76b 100644 --- a/tests/test_login.py +++ b/tests/test_login.py @@ -9,7 +9,7 @@ runner = CliRunner() -@pytest.fixture() +@pytest.fixture def load_config_mock(mocker) -> Mock: """Patches the load method of Configuration.""" test_config = Configuration( @@ -24,7 +24,7 @@ def load_config_mock(mocker) -> Mock: return load_mock -@pytest.fixture() +@pytest.fixture def token_mock(mocker): """Patches token generation.""" test_token = "TEST_TOKEN"