Skip to content

Commit 8269647

Browse files
authored
Merge pull request #869 from andrew-glenn/main
New regions and pre-commit fixes.
2 parents 145a119 + 28372ee commit 8269647

18 files changed

Lines changed: 191 additions & 148 deletions

.pre-commit-config.yaml

Lines changed: 95 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,98 @@
11
exclude: ^(.travis.yml|.pre-commit-config.yaml|.bumpversion.cfg)$
22
fail_fast: true
33
repos:
4-
- repo: https://github.com/pre-commit/mirrors-isort
5-
rev: v5.10.1
6-
hooks:
7-
- id: isort
8-
# language_version: python3.6
9-
- repo: https://github.com/ambv/black
10-
rev: 22.3.0
11-
hooks:
12-
- id: black
13-
exclude: regions_to_partitions.py
14-
- repo: https://github.com/pre-commit/pre-commit-hooks
15-
rev: v2.4.0
16-
hooks:
17-
- id: check-case-conflict
18-
- id: end-of-file-fixer
19-
- id: mixed-line-ending
20-
args:
21-
- --fix=lf
22-
- id: trailing-whitespace
23-
- id: flake8
24-
additional_dependencies:
25-
- flake8-bugbear>=19.3.0
26-
- flake8-builtins>=1.4.1
27-
- flake8-commas>=2.0.0
28-
- flake8-comprehensions>=2.1.0
29-
- flake8-debugger>=3.1.0
30-
- flake8-pep3101>=1.2.1
31-
- flake8-print>=3.1.0
32-
# language_version: python3.6
33-
- id: pretty-format-json
34-
args:
35-
- --autofix
36-
- --indent=4
37-
- --no-sort-keys
38-
- id: check-merge-conflict
39-
- repo: https://github.com/pre-commit/pygrep-hooks
40-
rev: v1.9.0
41-
hooks:
42-
- id: python-check-blanket-noqa
43-
- id: python-check-mock-methods
44-
- id: python-no-log-warn
45-
- repo: https://github.com/PyCQA/bandit
46-
rev: 1.7.4
47-
hooks:
48-
- id: bandit
49-
files: "^taskcat/"
50-
#- repo: https://github.com/pre-commit/mirrors-mypy
51-
# rev: v0.761
52-
# hooks:
53-
# - id: mypy
54-
# files: "^taskcat/"
55-
- repo: local
56-
hooks:
57-
- id: update-schema
58-
name: update-schema
59-
description: generate schema from dataclasses
60-
entry: ./generate_schema.py
61-
language: system
62-
pass_filenames: false
63-
always_run: true
64-
- id: git-secrets-register-aws
65-
name: git-secrets-register-aws
66-
description: Register AWS patterns with git-secrets
67-
entry: git-secrets --register-aws
68-
language: system
69-
always_run: true
70-
pass_filenames: false
71-
- id: git-secrets
72-
name: git-secrets
73-
description: Run git-secrets
74-
entry: git-secrets --scan
75-
language: system
76-
always_run: true
77-
- id: update-region-mappings
78-
name: update-region-mappings
79-
description: update region-partition mappings
80-
entry: ./update_partition_region_map.py
81-
language: system
82-
pass_filenames: false
83-
always_run: true
84-
- id: pylint-local
85-
name: pylint-local
86-
description: Run pylint in the local virtualenv
87-
entry: pylint "--disable=C0209" "taskcat/" "bin/"
88-
language: system
89-
pass_filenames: false
90-
always_run: true
91-
- id: pytest-local
92-
name: pytest-local
93-
description: Run pytest in the local virtualenv
94-
entry: pytest --cov="./taskcat/"
95-
language: system
96-
pass_filenames: false
97-
always_run: true
4+
- repo: https://github.com/pre-commit/mirrors-isort
5+
rev: v5.10.1
6+
hooks:
7+
- id: isort
8+
# language_version: python3.6
9+
- repo: https://github.com/ambv/black
10+
rev: 22.3.0
11+
hooks:
12+
- id: black
13+
exclude: regions_to_partitions.py
14+
- repo: https://github.com/pre-commit/pre-commit-hooks
15+
rev: v2.4.0
16+
hooks:
17+
- id: check-case-conflict
18+
- id: end-of-file-fixer
19+
- id: mixed-line-ending
20+
args:
21+
- --fix=lf
22+
- id: trailing-whitespace
23+
- id: flake8
24+
additional_dependencies:
25+
- flake8-bugbear>=19.3.0
26+
- flake8-builtins>=1.4.1
27+
- flake8-commas>=2.0.0
28+
- flake8-comprehensions>=2.1.0
29+
- flake8-debugger>=3.1.0
30+
- flake8-pep3101>=1.2.1
31+
- flake8-print>=3.1.0
32+
# language_version: python3.6
33+
- id: pretty-format-json
34+
args:
35+
- --autofix
36+
- --indent=4
37+
- --no-sort-keys
38+
- id: check-merge-conflict
39+
- repo: https://github.com/pre-commit/pygrep-hooks
40+
rev: v1.9.0
41+
hooks:
42+
- id: python-check-blanket-noqa
43+
- id: python-check-mock-methods
44+
- id: python-no-log-warn
45+
- repo: https://github.com/PyCQA/bandit
46+
rev: 1.8.6
47+
hooks:
48+
- id: bandit
49+
files:
50+
"^taskcat/"
51+
#- repo: https://github.com/pre-commit/mirrors-mypy
52+
# rev: v0.761
53+
# hooks:
54+
# - id: mypy
55+
# files: "^taskcat/"
56+
- repo: local
57+
hooks:
58+
- id: update-schema
59+
name: update-schema
60+
description: generate schema from dataclasses
61+
entry: ./generate_schema.py
62+
language: system
63+
pass_filenames: false
64+
always_run: true
65+
- id: git-secrets-register-aws
66+
name: git-secrets-register-aws
67+
description: Register AWS patterns with git-secrets
68+
entry: git-secrets --register-aws
69+
language: system
70+
always_run: true
71+
pass_filenames: false
72+
- id: git-secrets
73+
name: git-secrets
74+
description: Run git-secrets
75+
entry: git-secrets --scan
76+
language: system
77+
always_run: true
78+
- id: update-region-mappings
79+
name: update-region-mappings
80+
description: update region-partition mappings
81+
entry: ./update_partition_region_map.py
82+
language: system
83+
pass_filenames: false
84+
always_run: true
85+
- id: pylint-local
86+
name: pylint-local
87+
description: Run pylint in the local virtualenv
88+
entry: pylint "--disable=C0209" "taskcat/" "bin/"
89+
language: system
90+
pass_filenames: false
91+
always_run: true
92+
- id: pytest-local
93+
name: pytest-local
94+
description: Run pytest in the local virtualenv
95+
entry: pytest --cov="./taskcat/"
96+
language: system
97+
pass_filenames: false
98+
always_run: true

.project_automation/static_tests/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ git clone https://github.com/awslabs/git-secrets.git
1010
cd git-secrets
1111
make install
1212
cd ${PROJECT_PATH}
13-
pip install -r dev-requirements.txt -r requirements.txt
13+
pip install -r dev-requirements.txt -r requirements.txt
1414
pre-commit run --all-files
1515
if [ $? -ne 0 ]; then
1616
git status

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pre-commit~=2.9.2
1+
pre-commit~=4.2.0
22
black~=24.3.0
33
pylint~=3.2
44
pytest-cov~=2.7

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ version = "0.9.57"
33
authors = ["Andrew Glenn", "Jay McConnell", "Shivansh Singh", "Tony Vattathil"]
44
description = "An OpenSource Cloudformation Deployment Framework"
55
name = "taskcat"
6+
packages = [{include = "taskcat"}]
67

78
[tool.poetry.dependencies]
89
pathspec = '0.10.3'
@@ -73,3 +74,7 @@ Installation = "docs/INSTALLATION.md"
7374
#
7475
# [[tool.portray.mkdocs.nav]]
7576
# Usage = "docs/usage/"
77+
78+
[build-system]
79+
requires = ["poetry-core>=1.0.0"]
80+
build-backend = "poetry.core.masonry.api"

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
pathspec==0.10.3
22
reprint
3+
ruamel.yaml
34
tabulate>=0.8.2,<1.0
45
cfn_lint>=0.78.1,<2.0
56
setuptools>=40.4.3

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[metadata]
2-
description-file = README.md
2+
description_file = README.md
33

44
[flake8]
55
exclude =

taskcat/_cfn/stack_url_helper.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
"""
2-
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3-
4-
Permission is hereby granted, free of charge, to any person obtaining a copy of this
5-
software and associated documentation files (the "Software"), to deal in the Software
6-
without restriction, including without limitation the rights to use, copy, modify,
7-
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
8-
permit persons to whom the Software is furnished to do so.
9-
10-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
11-
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
12-
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
13-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
14-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
15-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2+
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy of this
5+
software and associated documentation files (the "Software"), to deal in the Software
6+
without restriction, including without limitation the rights to use, copy, modify,
7+
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so.
9+
10+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
11+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
12+
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
13+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
14+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
15+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1616
"""
1717

1818
import json

taskcat/_cli_modules/deploy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def run( # noqa: C901
6464
LOG.info(f"fetching git repo {url}")
6565
self._git_clone(url, path)
6666
self._recurse_submodules(path, url)
67-
_extra_tags = [(Tag({"Key": "taskcat-installer", "Value": name}))]
67+
_extra_tags = [Tag({"Key": "taskcat-installer", "Value": name})]
6868
Test.run(
6969
regions=regions,
7070
no_delete=True,

taskcat/_client_factory.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,11 @@ def _get_partition(self, profile):
173173
("aws", "us-east-1"),
174174
("aws-cn", "cn-north-1"),
175175
("aws-us-gov", "us-gov-west-1"),
176+
("aws-iso", "us-iso-east-1"),
177+
("aws-iso-b", "us-isob-east-1"),
178+
("aws-iso-e", "eu-isoe-west-1"),
179+
("aws-iso-f", "us-isof-east-1"),
180+
("aws-eusc", "eusc-de-east-1"),
176181
]
177182
for partition, region in partition_regions:
178183
try:

taskcat/_common_utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
"aws": "amazonaws.com",
2323
"aws-cn": "amazonaws.com.cn",
2424
"aws-us-gov": "amazonaws.com",
25+
"aws-iso": "c2s.ic.gov",
26+
"aws-iso-b": "sc2s.sgov.gov",
27+
"aws-iso-e": "cloud.adc-e.uk",
28+
"aws-iso-f": "csp.hci.ic.gov",
29+
"aws-eusc": "amazonaws.eu",
2530
}
2631

2732
FIRST_CAP_RE = re.compile("(.)([A-Z][a-z]+)")

0 commit comments

Comments
 (0)