dataclasses backport required for Python 3.6
See original GitHub issueDescribe the bug
Since #567, dataclasses
is being used. This module is not in Python 3.6, so the backport needs to be installed.
To Reproduce Steps to reproduce the behavior:
$ python --version
> python 3.6.11
$ python -m venv .env
> ...
$ source .venv/bin/activate
$ pip install checkov
> ...
$ checkov --version
Traceback (most recent call last):
File "/tmp/test/.env/bin/checkov", line 2, in <module>
from checkov.main import run
File "/tmp/test/.env/lib/python3.6/site-packages/checkov/main.py", line 15, in <module>
from checkov.common.util.docs_generator import print_checks
File "/tmp/test/.env/lib/python3.6/site-packages/checkov/common/util/docs_generator.py", line 11, in <module>
from checkov.serverless.registry import sls_registry
File "/tmp/test/.env/lib/python3.6/site-packages/checkov/serverless/__init__.py", line 1, in <module>
from checkov.serverless.checks.function import *
File "/tmp/test/.env/lib/python3.6/site-packages/checkov/serverless/checks/__init__.py", line 3, in <module>
from checkov.serverless.checks.function import *
File "/tmp/test/.env/lib/python3.6/site-packages/checkov/serverless/checks/function/__init__.py", line 1, in <module>
from checkov.serverless.checks.function.aws import *
File "/tmp/test/.env/lib/python3.6/site-packages/checkov/serverless/checks/function/aws/StarActionPolicyDocument.py", line 1, in <module>
from checkov.serverless.checks.function.base_function_check import BaseFunctionCheck
File "/tmp/test/.env/lib/python3.6/site-packages/checkov/serverless/checks/function/base_function_check.py", line 5, in <module>
from checkov.serverless.checks.function.registry import function_registry
File "/tmp/test/.env/lib/python3.6/site-packages/checkov/serverless/checks/function/registry.py", line 1, in <module>
from checkov.serverless.base_registry import ServerlessRegistry
File "/tmp/test/.env/lib/python3.6/site-packages/checkov/serverless/base_registry.py", line 2, in <module>
from dataclasses import dataclass
ModuleNotFoundError: No module named 'dataclasses
#
# To resolve
#
$ pip install dataclasses
$ checkov --version
1.0.544
Expected behavior
setup.py
should have a dependency for dataclasses
, if the Python version is 3.6
.
Desktop (please complete the following information):
- OS: Ubuntu 20.04
- Checkov Version 1.0.544
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
dataclasses - PyPI
This is an implementation of PEP 557, Data Classes. It is a backport for Python 3.6. Because dataclasses will be included in Python...
Read more >Could not find a version that satisfies the requirement ... - GitHub
This repo is only about the 3.6 backport. dataclasses is built in to python 3.8, so you don't need to install anything, you...
Read more >A Backport Of The Dataclasses Module for Python 3.6 - Morioh
This is an implementation of PEP 557, Data Classes. It is a backport for Python 3.6. Because dataclasses will be included in Python...
Read more >python - What are data classes and how are they different from ...
If you want to use dataclasses module in Python versions < 3.7, then you could install the backported module (requires 3.6) or use...
Read more >PyCharm doesn't allow 'dataclasses' backport for Python 3.6
Enable PyCharm's code compatibility inspection for Python 3.6; Install 'dataclasses' backport package from PyPI; Use 'import dataclasses' in some file.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
let’s update setup.py to support only python 3.7 and above.
Done. @timhourigan thank you for reporting this.