Cfn-python-lint: Pip install fails for 0.10.0

Created on 4 Dec 2018  路  5Comments  路  Source: aws-cloudformation/cfn-python-lint

cfn-lint version: (cfn-lint --version)

0.10.0

Description of issue.

My pipeline started failing when installing the latest version via pip.

example:

pip install cfn-lint==0.10.0

[...]
.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    copying regex_3/regex.py -> build/lib.linux-x86_64-3.7
    copying regex_3/_regex_core.py -> build/lib.linux-x86_64-3.7
    copying regex_3/test_regex.py -> build/lib.linux-x86_64-3.7
    running build_ext
    building '_regex' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/regex_3
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/local/include/python3.7m -c regex_3/_regex.c -o build/temp.linux-x86_64-3.7/regex_3/_regex.o
    unable to execute 'gcc': No such file or directory
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-r143_0dz/regex/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-467tj48_/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-r143_0dz/regex/

Version 0.9.2 works well.

Replicate with:

docker run --rm -it python:3.7.1-alpine3.8 /bin/sh -c 'pip install cfn-lint==0.10.0'

All 5 comments

Looking into it. Thanks for reporting this.

Same here. Found its defo caused by the introduction of the regex dependency with Pull Request #484.

Basically you need gcc available on the PATH now. Your call if thats fine, but I would have enjoyed a mention of this in the release notes :-)

We were trying to see if we could support the rule with re, but are having challenges around unicode characters. We're removing the rule that required regex and should be pushing a new point release shortly. Thanks for your patience!

@shibuyaku We will try to do a better job including that in the release notes. My ideal goal would be to run a test like what was mentioned with the created package. docker run --rm -it python:3.7.1-alpine3.8 /bin/sh -c 'pip install cfn-lint==0.10.0' (slightly adapted for the local package). Our goal has been to keep the dependencies at a minimum and requiring an outside item like gcc would absolutely fall into that. Unfortunately we missed this dependency this time. Thanks for reporting this and your patience in our response. The new version has been published and no longer requires regex

Pull request #508 adds the ability to do some level of integration testing. This issue would have been caught if we were doing this test. So once merged, going forward, our travis tests will include docker run --rm -it -v ${PWD}:/cfnlint -w /cfnlint python:3.7.1-alpine3.8 /bin/sh -c 'pip3 install -e . && cfn-lint test/fixtures/templates/good/generic.yaml We can of course expand this as needed but figured this was a good spot to start.

Was this page helpful?
0 / 5 - 0 ratings