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

required version of boto3 is now ^1.34.50, remove dev dependencies from main group #2499

Merged
merged 15 commits into from
Aug 14, 2024
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
4 changes: 2 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ autolabeler: # cspell:ignore autolabeler
- label: bug
branch: [/^(bug|bugfix|fix|hotfix)\/.*/]
- label: changelog:skip
branch: [/^(dependabot)\/.*/]
branch: [/^(dependabot)\/.*/, /^pre-commit-ci-update-config/, /^renovate\/.*lockfile/]
- label: cloudformation
files:
- '**/templates/*.json'
- '**/templates/*.template'
- '**/templates/*.yaml'
- '**/templates/*.yml'
- label: dependencies
branch: [/^(depend|dependabot)\/.*/]
branch: [/^(dep|depend|dependabot|deps|renovate)\/.*/]
- label: documentation
branch: [/^(docs)\/.*/]
- label: feature
Expand Down
8 changes: 7 additions & 1 deletion .github/scripts/cicd/build_pyinstaller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@ fi

RUNWAY_VERSION=$(poetry version --short)

if [[ -z "${GITHUB_ACTION}" ]]; then
if [[ -n "${GITHUB_ACTION}" ]]; then
rm -rf ./.venv; # NOTE (kyle): this needs to be removed on GitHub
fi

poetry build

if [[ -n "${GITHUB_ACTION}" ]]; then
# NOTE (kyle): GitHub needs build tools reinstalled after `poetry build`
poetry install --only main,build --sync;
fi

poetry run pip install "$(find dist -type f -name 'runway-*.tar.gz' -print | tail -n 1)"
find dist/* -exec rm -rfv "{}" +
mkdir -p "artifacts/${RUNWAY_VERSION}/${LOCAL_OS_NAME}"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ jobs:
lint-python:
name: Lint Python
strategy:
fail-fast: false
matrix:
python-version: [3.9, '3.10', '3.11']
os: [ubuntu-latest, windows-latest]
Expand Down Expand Up @@ -183,6 +184,7 @@ jobs:
test-python:
name: Test Python
strategy:
fail-fast: false
matrix:
python-version: [3.9, '3.10', '3.11']
os: [ubuntu-latest, windows-latest]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull_request_target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
uses: finleyfamily/action-enforce-branch-name@v1.0.0
with:
allowed_prefixes: >-
bugfix,chore,dependabot,docs,feat,feature,fix,hotfix,
maint,maintain,maintenance,release,renovate,snyk
bugfix,chore,dep,depend,dependabot,deps,docs,feat,feature,fix,hotfix,
maint,maintain,maintenance,pre-commit,release,renovate,snyk
label-pr:
name: Label PR
if: ${{ github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'synchronize' }}
Expand Down
1,380 changes: 724 additions & 656 deletions poetry.lock

Large diffs are not rendered by default.

51 changes: 25 additions & 26 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ repository = "https://github.com/onicagroup/runway"
[tool.poetry.dependencies]
python = ">=3.9, <3.13"
awacs = "*"
boto3 = "^1.16"
boto3 = "^1.34.50"
cfn-lint = "*"
cfn_flip = "^1.2" # only used in runway._cli.commands._gen_sample.utils
click = "^8.0"
Expand All @@ -43,44 +43,29 @@ formic2 = "*" # only used in runway.cfngin.hooks.aws_lambda
gitpython = "*"
igittigitt = ">=2.0.5"
jinja2 = ">=2.7" # used in runway.cfngin.blueprints.raw
moto = "3.0.5"
packaging = "*" # component of setuptools needed for version compare
pipenv = "2022.1.8"
pyOpenSSL = "*" # For embedded hook & associated script usage
pydantic = "^1.4"
pyhcl = "^0.4" # does not support HCL2, possibly move to extras_require in the future
pyinstaller = "^6.2.0"
python-hcl2 = ">=3.0.0"
pyyaml = ">5.4"
requests = "*"
send2trash = "*"
testfixtures = "^7.0.3"
tomli = ">=1.2.2"
troposphere = ">=2.4, <5"
typing_extensions = "*" # only really needed for < 3.8 but can still be used in >= 3.8
urllib3 = "*" # allow us to follow botocore's hard pinning without needing to update our own
wheel = "^0.42.0"
yamllint = "*"

[tool.poetry.group.build.dependencies]
pyinstaller = "^6.2.0"

[tool.poetry.group.dev.dependencies]
coverage = {extras = ["toml"], version = ">=6.3"}
doc8 = ">=0.10" # for linting with vscode rst extension
mock = ">=4.0"
moto = {extras = ["ec2", "ecs", "iam", "s3", "ssm"], version = ">=3.0"}
pipenv = "^2022.1.8" # only used in tests
pre-commit = "^3.7.1"
pytest = ">=7.0"
pytest-cov = ">=3.0" # pytest plugin
pytest-mock = ">=3.7" # pytest plugin
pytest-order = ">=1" # pytest plugin
pytest-subprocess = ">=1.4" # pytest plugin
pytest-sugar = ">=0.9" # pytest plugin
pytest-xdist = ">=2.5" # pytest plugin
pre-commit = "^3.8.0"
semver = "^2.13" # only used in .github/scripts/urlshortener
testfixtures = "^7.0.3" # TODO remove use of this dependency - was inherited
tomli-w = ">=1.0"

[tool.poetry.group.docs.dependencies]
doc8 = ">=0.10" # for linting with vscode rst extension
jsx-lexer = "^1.0"
sphinx = "^4.3"
sphinx-github-changelog = "^1.1"
Expand All @@ -90,11 +75,25 @@ sphinxcontrib-apidoc = "^0.3"
sphinxcontrib-programoutput = "^0.17"

[tool.poetry.group.lint.dependencies]
black = "^24.4.2"
ruff = "^0.5.4"
black = "^24.8.0"
ruff = "^0.5.7"

[tool.poetry.group.test.dependencies]
coverage = {extras = ["toml"], version = "^7.6.1"}
moto = {extras = ["ec2", "ecs", "iam", "s3", "ssm"], version = "^5.0.12"}
pipenv = "^2022.1.8" # only used in tests
pytest = "^8.3.2"
pytest-cov = "^5.0.0"
pytest-mock = "^3.14.0"
pytest-order = "^1.2.1"
pytest-subprocess = "^1.5.2"
pytest-sugar = "^1.0.0"
pytest-xdist = {extras = ["psutil"], version = "^3.6.1"}
testfixtures = "^7.0.3" # TODO (kyle) remove use of this dependency - was inherited
tomli-w = "^1.0.0"

[tool.poetry.group.types.dependencies]
mypy-boto3 = "^1.16" # importable boto3 type annotations
mypy-boto3 = "^1.34.158" # importable boto3 type annotations

[tool.poetry.group.types.dependencies.boto3-stubs]
extras = [
Expand All @@ -115,7 +114,7 @@ extras = [
"ssm",
"sts",
]
version = "^1.16"
version = "^1.34.158"

[tool.poetry.scripts]
runway = "runway._cli.main:cli"
Expand Down Expand Up @@ -173,7 +172,7 @@ omit = [

[tool.poetry-dynamic-versioning] # poetry self add "poetry-dynamic-versioning[plugin]"
bump = true
enable = true
enable = false
fix-shallow-repository = true
metadata = false
strict = true
Expand Down
2 changes: 1 addition & 1 deletion runway/cfngin/hooks/awslambda/models/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ class AwsLambdaHookArgs(HookArgsBaseModel):

_resolve_path_fields = validator("cache_dir", "source_code", allow_reuse=True)(resolve_path_field) # type: ignore

@validator("runtime", always=True, allow_reuse=True)
@validator("runtime", always=True, allow_reuse=True) # type: ignore
def _validate_runtime_or_docker(
cls, v: str | None, values: dict[str, Any] # noqa: N805
) -> str | None:
Expand Down
4 changes: 2 additions & 2 deletions runway/cfngin/hooks/docker/_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ class LoginArgs(BaseModel):
username: str = "AWS"
"""The registry username."""

@validator("ecr", pre=True, allow_reuse=True)
@validator("ecr", pre=True, allow_reuse=True) # type: ignore
def _set_ecr(cls, v: Any, values: dict[str, Any]) -> Any: # noqa: N805
"""Set the value of ``ecr``."""
if v and isinstance(v, dict):
return ElasticContainerRegistry.parse_obj({"context": values.get("context"), **v})
return v

@validator("registry", pre=True, always=True, allow_reuse=True)
@validator("registry", pre=True, always=True, allow_reuse=True) # type: ignore
def _set_registry(cls, v: Any, values: dict[str, Any]) -> Any: # noqa: N805
"""Set the value of ``registry``."""
if v:
Expand Down
2 changes: 1 addition & 1 deletion runway/cfngin/hooks/docker/data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def fqn(self) -> str:
return self.PUBLIC_URI_TEMPLATE.format(registry_alias=self.alias)
return self.URI_TEMPLATE.format(aws_account_id=self.account_id, aws_region=self.region)

@root_validator(allow_reuse=True, pre=True)
@root_validator(allow_reuse=True, pre=True) # type: ignore
def _set_defaults(cls, values: dict[str, Any]) -> dict[str, Any]: # noqa: N805
"""Set default values based on other values."""
values.setdefault("public", bool(values.get("alias")))
Expand Down
8 changes: 4 additions & 4 deletions runway/cfngin/hooks/docker/image/_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class ImageBuildArgs(BaseModel):
tags: List[str] = ["latest"] # noqa: UP006
"""List of tags to apply to the image."""

@validator("docker", pre=True, always=True, allow_reuse=True)
@validator("docker", pre=True, always=True, allow_reuse=True) # type: ignore
def _set_docker(
cls, # noqa: N805
v: dict[str, Any] | DockerImageBuildApiOptions | Any,
Expand All @@ -134,7 +134,7 @@ def _set_docker(
v.tag = repo
return v

@validator("ecr_repo", pre=True, allow_reuse=True)
@validator("ecr_repo", pre=True, allow_reuse=True) # type: ignore
def _set_ecr_repo(cls, v: Any, values: dict[str, Any]) -> Any: # noqa: N805
"""Set the value of ``ecr_repo``."""
if v and isinstance(v, dict):
Expand All @@ -153,7 +153,7 @@ def _set_ecr_repo(cls, v: Any, values: dict[str, Any]) -> Any: # noqa: N805
)
return v

@validator("repo", pre=True, always=True, allow_reuse=True)
@validator("repo", pre=True, always=True, allow_reuse=True) # type: ignore
def _set_repo(cls, v: str | None, values: dict[str, Any]) -> str | None: # noqa: N805
"""Set the value of ``repo``."""
if v:
Expand All @@ -165,7 +165,7 @@ def _set_repo(cls, v: str | None, values: dict[str, Any]) -> str | None: # noqa

return None

@validator("dockerfile", pre=True, always=True, allow_reuse=True)
@validator("dockerfile", pre=True, always=True, allow_reuse=True) # type: ignore
def _validate_dockerfile(cls, v: Any, values: dict[str, Any]) -> Any: # noqa: N805
"""Validate ``dockerfile``."""
path: Path = values["path"]
Expand Down
6 changes: 3 additions & 3 deletions runway/cfngin/hooks/docker/image/_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ImagePushArgs(BaseModel):
tags: List[str] = [] # depends on image # noqa: UP006
"""List of tags to push."""

@validator("ecr_repo", pre=True, allow_reuse=True)
@validator("ecr_repo", pre=True, allow_reuse=True) # type: ignore
def _set_ecr_repo(cls, v: Any, values: dict[str, Any]) -> Any: # noqa: N805
"""Set the value of ``ecr_repo``."""
if v and isinstance(v, dict):
Expand All @@ -66,7 +66,7 @@ def _set_ecr_repo(cls, v: Any, values: dict[str, Any]) -> Any: # noqa: N805
)
return v

@validator("repo", pre=True, always=True, allow_reuse=True)
@validator("repo", pre=True, always=True, allow_reuse=True) # type: ignore
def _set_repo(cls, v: str | None, values: dict[str, Any]) -> str | None: # noqa: N805
"""Set the value of ``repo``."""
if v:
Expand All @@ -82,7 +82,7 @@ def _set_repo(cls, v: str | None, values: dict[str, Any]) -> str | None: # noqa

return None

@validator("tags", pre=True, always=True, allow_reuse=True)
@validator("tags", pre=True, always=True, allow_reuse=True) # type: ignore
def _set_tags(cls, v: list[str], values: dict[str, Any]) -> list[str]: # noqa: N805
"""Set the value of ``tags``."""
if v:
Expand Down
6 changes: 3 additions & 3 deletions runway/cfngin/hooks/docker/image/_remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ImageRemoveArgs(BaseModel):
tags: List[str] = [] # depends on image # noqa: UP006
"""List of tags to remove."""

@validator("ecr_repo", pre=True, allow_reuse=True)
@validator("ecr_repo", pre=True, allow_reuse=True) # type: ignore
def _set_ecr_repo(cls, v: Any, values: dict[str, Any]) -> Any: # noqa: N805
"""Set the value of ``ecr_repo``."""
if v and isinstance(v, dict):
Expand All @@ -73,7 +73,7 @@ def _set_ecr_repo(cls, v: Any, values: dict[str, Any]) -> Any: # noqa: N805
)
return v

@validator("repo", pre=True, always=True, allow_reuse=True)
@validator("repo", pre=True, always=True, allow_reuse=True) # type: ignore
def _set_repo(cls, v: str | None, values: dict[str, Any]) -> str | None: # noqa: N805
"""Set the value of ``repo``."""
if v:
Expand All @@ -89,7 +89,7 @@ def _set_repo(cls, v: str | None, values: dict[str, Any]) -> str | None: # noqa

return None

@validator("tags", pre=True, always=True, allow_reuse=True)
@validator("tags", pre=True, always=True, allow_reuse=True) # type: ignore
def _set_tags(cls, v: list[str], values: dict[str, Any]) -> list[str]: # noqa: N805
"""Set the value of ``tags``."""
if v:
Expand Down
2 changes: 1 addition & 1 deletion runway/cfngin/hooks/ecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CreateClustersHookArgs(BaseModel):
clusters: List[str] # noqa: UP006
"""List of cluster names to create."""

@validator("clusters", allow_reuse=True, pre=True)
@validator("clusters", allow_reuse=True, pre=True) # type: ignore
def _convert_clusters(cls, v: list[str] | str) -> list[str]: # noqa: N805
"""Convert value of ``clusters`` from str to list."""
if isinstance(v, str):
Expand Down
4 changes: 2 additions & 2 deletions runway/cfngin/hooks/ssm/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class Config:
"value": {"alias": "Value"},
}

@validator("policies", allow_reuse=True, pre=True)
@validator("policies", allow_reuse=True, pre=True) # type: ignore
def _convert_policies(cls, v: list[dict[str, Any]] | str | Any) -> str: # noqa: N805
"""Convert policies to acceptable value."""
if isinstance(v, str):
Expand All @@ -102,7 +102,7 @@ def _convert_policies(cls, v: list[dict[str, Any]] | str | Any) -> str: # noqa:
return json.dumps(v, cls=JsonEncoder)
raise TypeError(f"unexpected type {type(v)}; permitted: list[dict[str, Any]] | str | None")

@validator("tags", allow_reuse=True, pre=True)
@validator("tags", allow_reuse=True, pre=True) # type: ignore
def _convert_tags(
cls, v: dict[str, str] | list[dict[str, str]] | Any # noqa: N805
) -> list[dict[str, str]]:
Expand Down
2 changes: 1 addition & 1 deletion runway/cfngin/lookups/handlers/ami.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ArgsDataModel(BaseModel):
region: Optional[str] = None
"""AWS region."""

@validator("executable_users", "owners", allow_reuse=True, pre=True)
@validator("executable_users", "owners", allow_reuse=True, pre=True) # type: ignore
def _convert_str_to_list(cls, v: Union[list[str], str]) -> list[str]: # noqa: N805
"""Convert str to list."""
if isinstance(v, str):
Expand Down
2 changes: 1 addition & 1 deletion runway/cfngin/lookups/handlers/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ArgsDataModel(BaseModel):
codec: str
"""Codec that will be used to parse and/or manipulate the data."""

@validator("codec", allow_reuse=True)
@validator("codec", allow_reuse=True) # type: ignore
def _validate_supported_codec(cls, v: str) -> str: # noqa: N805
"""Validate that the selected codec is supported."""
if v in CODECS:
Expand Down
14 changes: 7 additions & 7 deletions runway/config/models/cfngin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,18 @@ def schema_extra(schema: dict[str, Any]) -> None: # type: ignore
{"type": "string", "pattern": utils.CFNGIN_LOOKUP_STRING_REGEX},
]

_resolve_path_fields = validator( # pyright: ignore[reportUnknownVariableType]
_resolve_path_fields = validator( # type: ignore
"stack_policy_path", "template_path", allow_reuse=True
)(utils.resolve_path_field)

@root_validator(pre=True)
@root_validator(pre=True) # type: ignore
def _validate_class_and_template(cls, values: dict[str, Any]) -> dict[str, Any]: # noqa: N805
"""Validate class_path and template_path are not both provided."""
if values.get("class_path") and values.get("template_path"):
raise ValueError("only one of class_path or template_path can be defined")
return values

@root_validator(pre=True)
@root_validator(pre=True) # type: ignore
def _validate_class_or_template(cls, values: dict[str, Any]) -> dict[str, Any]: # noqa: N805
"""Ensure that either class_path or template_path is defined."""
# if the stack is disabled or locked, it is ok that these are missing
Expand Down Expand Up @@ -287,11 +287,11 @@ class Config(ConfigProperty.Config):
schema_extra = {"description": "Configuration file for Runway's CFNgin."}
title = "CFNgin Config File"

_resolve_path_fields = validator( # pyright: ignore[reportUnknownVariableType]
_resolve_path_fields = validator( # type: ignore
"cfngin_cache_dir", "sys_path", allow_reuse=True
)(utils.resolve_path_field)

@validator("post_deploy", "post_destroy", "pre_deploy", "pre_destroy", pre=True)
@validator("post_deploy", "post_destroy", "pre_deploy", "pre_destroy", pre=True) # type: ignore
def _convert_hook_definitions(
cls, v: Union[dict[str, Any], list[dict[str, Any]]] # noqa: N805
) -> list[dict[str, Any]]:
Expand All @@ -300,7 +300,7 @@ def _convert_hook_definitions(
return v
return list(v.values())

@validator("stacks", pre=True)
@validator("stacks", pre=True) # type: ignore
def _convert_stack_definitions(
cls, v: Union[dict[str, Any], list[dict[str, Any]]] # noqa: N805
) -> list[dict[str, Any]]:
Expand All @@ -313,7 +313,7 @@ def _convert_stack_definitions(
result.append(stack)
return result

@validator("stacks")
@validator("stacks") # type: ignore
def _validate_unique_stack_names(
cls, stacks: list[CfnginStackDefinitionModel] # noqa: N805
) -> list[CfnginStackDefinitionModel]:
Expand Down
Loading