-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use `tox` to run the sanity tests - Upgrade the default versions - Break the dependency on Python3.7 - Adjust some issues in the code to be compliant with the update tests - Do not run `policy` by default because ansible-core 2.13 depends on Python3.8 The fixed errors are listed below: ``` ************* Module cleanup aws/cleanup.py:53:9: W1514: Using open without explicitly specifying an encoding (unspecified-encoding) ************* Module terminator aws/terminator/__init__.py:273:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) ************* Module terminator.compute aws/terminator/compute.py:195:15: C0209: Formatting a regular string which could be a f-string (consider-using-f-string) ************* Module terminator.networking aws/terminator/networking.py:142:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) aws/terminator/networking.py:164:27: R1729: Use a generator instead 'any(self.is_vpc_default(attachment_id) for attachment_id in attachments)' (use-a-generator) aws/terminator/networking.py:272:15: R1729: Use a generator instead 'any(association['Main'] for association in self.instance.get('Associations', []))' (use-a-generator) ************* Module terminator.storage_services aws/terminator/storage_services.py:55:30: R1735: Consider using {} instead of dict() (use-dict-literal) ```
- Loading branch information
Showing
8 changed files
with
89 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
# AWS Terminator | ||
|
||
An AWS Lambda function for cleaning up AWS resources. | ||
|
||
## Run the sanity tests | ||
|
||
We use `tox` to run the sanity tests: | ||
|
||
```console | ||
$ tox | ||
``` | ||
|
||
You can run one specific test with a `-e foo` parameter. Use `tox -av` to list them all: | ||
|
||
```console | ||
$ tox -e pylint | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
boto3==1.21.10 | ||
botocore==1.24.10 | ||
certifi==2021.10.8 | ||
charset-normalizer==2.0.12 | ||
docutils==0.18.1 | ||
idna==3.3 | ||
jmespath==0.10.0 | ||
boto3==1.25.5 | ||
botocore==1.28.5 | ||
certifi==2022.9.24 | ||
charset-normalizer==2.1.1 | ||
idna==3.4 | ||
jmespath==1.0.1 | ||
python-dateutil==2.8.2 | ||
requests==2.27.1 | ||
s3transfer==0.5.2 | ||
requests==2.28.1 | ||
s3transfer==0.6.0 | ||
six==1.16.0 | ||
urllib3==1.26.8 | ||
urllib3==1.26.12 | ||
PyYAML==6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,25 @@ | ||
# freeze pylint and its requirements for consistent test results | ||
astroid == 2.2.5 | ||
isort == 4.3.15 | ||
lazy-object-proxy == 1.3.1 | ||
mccabe == 0.6.1 | ||
pylint == 2.3.1 | ||
typed-ast == 1.4.0 # 1.4.0 is required to compile on Python 3.8 | ||
wrapt == 1.11.1 | ||
ansible-core==2.13.5 | ||
astroid==2.12.12 | ||
cffi==1.15.1 | ||
cryptography==38.0.3 | ||
dill==0.3.6 | ||
isort==5.10.1 | ||
Jinja2==3.1.2 | ||
lazy-object-proxy==1.8.0 | ||
MarkupSafe==2.1.1 | ||
mccabe==0.7.0 | ||
packaging==21.3 | ||
pathspec==0.10.1 | ||
platformdirs==2.5.2 | ||
pycodestyle==2.9.1 | ||
pycparser==2.21 | ||
pylint==2.15.5 | ||
pyparsing==3.0.9 | ||
PyYAML==6.0 | ||
resolvelib==0.8.1 | ||
tomli==2.0.1 | ||
tomlkit==0.11.6 | ||
typing_extensions==4.4.0 | ||
wrapt==1.14.1 | ||
yamllint==1.28.0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[tox] | ||
skipsdist=True | ||
envlist=pycodestyle,pylint,yamllint | ||
|
||
[test-deps] | ||
deps = | ||
-cconstraints.txt | ||
-raws/requirements.txt | ||
|
||
[testenv:pylint] | ||
description = Check with Pylint | ||
deps = | ||
{[test-deps]deps} | ||
pylint | ||
commands = pylint --rcfile {toxinidir}/hacking/pylint.rc {toxinidir}/aws | ||
|
||
[testenv:pycodestyle] | ||
description = Check with pycodestyle | ||
deps = | ||
{[test-deps]deps} | ||
pycodestyle | ||
commands = pycodestyle --config {toxinidir}/pycodestyle.ini {toxinidir}/aws | ||
|
||
[testenv:yamllint] | ||
description = Check with YAMLlint | ||
deps = | ||
{[test-deps]deps} | ||
yamllint | ||
commands = yamllint --config-file {toxinidir}/.yamllint {toxinidir}/aws {toxinidir}/hacking | ||
|
||
[testenv:policy] | ||
description = Run the test-policies playbook | ||
deps = | ||
{[test-deps]deps} | ||
ansible-core | ||
commands = ansible-playbook -i localhost {toxinidir}/hacking/aws_config/test-policies.yml |