Skip to content
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

Drop python 3.10 add 3.12 #6

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.12", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.12", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
7 changes: 5 additions & 2 deletions src/image_tools/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
]


def bake_args() -> Namespace:
def bake_args(args: List[str]) -> Namespace:
parser = ArgumentParser(
description="Build and publish product images. Requires docker and buildx (https://github.com/docker/buildx)."
)
Expand Down Expand Up @@ -64,7 +64,7 @@ def bake_args() -> Namespace:
help="Write target image tags to a text file. Useful for signing or other follow-up CI steps."
),

result = parser.parse_args()
result = parser.parse_args(args)

if result.shard_index >= result.shard_count:
raise ValueError("shard index [{}] cannot be greater or equal than shard count [{}]".format(
Expand Down Expand Up @@ -174,7 +174,10 @@ def check_architecture_input(architecture) -> List[str]:

if architecture not in supported_arch:
raise ValueError(
# autopep8: off
# see: https://github.com/hhatto/autopep8/issues/712
f"Architecture {architecture} not supported. Supported: {supported_arch}"
# autopep8: on
)

return architecture
Expand Down
2 changes: 1 addition & 1 deletion src/image_tools/bake.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def bake_command(args: Namespace, targets: List[str], bakefile) -> Command:

def main() -> int:
"""Generate a Docker bake file from conf.py and build the given args.product images."""
args = bake_args()
args = bake_args(sys.argv)

conf = load_configuration(args.configuration)

Expand Down
Empty file.
15 changes: 15 additions & 0 deletions src/image_tools/test/test_generate_bakefile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from typing import List

from image_tools.test import conf
import unittest

from image_tools.args import bake_args
from image_tools.bake import generate_bakefile


class TestGenerateBakefile(unittest.TestCase):
def test_generate_bakefile(self):
args: List[str] = ["-p", "airflow"]
bargs = bake_args(args)
bakefile = generate_bakefile(bargs, conf)
self.assertIsNotNone(bakefile)