Repository: aws-cloudformation/cfn-lint

Issue:
Can't run in Travis CI xenial
I was testing the new Travis CI image:

https://blog.travis-ci.com/2018-11-08-xenial-release
https://docs.travis-ci.com/user/reference/xenial/

My install script ran `pip install --user --upgrade cfn-lint` and then `cfn-lint my.cfn.yaml` which gave this error:

```Traceback (most recent call last):
  File "/home/travis/.local/bin/cfn-lint", line 7, in <module>
    from cfnlint.__main__ import main
  File "/home/travis/.local/lib/python2.7/site-packages/cfnlint/__main__.py", line 19, in <module>
    import cfnlint.core
  File "/home/travis/.local/lib/python2.7/site-packages/cfnlint/core.py", line 24, in <module>
    import cfnlint.maintenance
  File "/home/travis/.local/lib/python2.7/site-packages/cfnlint/maintenance.py", line 19, in <module>
    import requests
  File "/usr/lib/python2.7/dist-packages/requests/__init__.py", line 58, in <module>
    from . import utils
  File "/usr/lib/python2.7/dist-packages/requests/utils.py", line 25, in <module>
    from . import certs
ImportError: cannot import name certs
```

I "fixed" this problem by just changing to Python3 in my build script:

```
pyenv global 3.7
pip3 install --user --upgrade cfn-lint
cfn-lint stack.cfn.yaml
```

But there might be some other lingering issue here


Discussion:
Thanks.  I'll have to check this out.  I just tried a standard xenial container and things went well.   Let me do some more digging...
I think I remember having a similar issue but I did a quick cheat fix.  Can you tell me what cloud your TravisCi container is running on?  Should all be under the Worker information and the dns suffix of the hostname (e.g. `production-3-worker-com-gce-gwj9`).  Also what version is it?  I had found that I was having an issue on just one platform.  I'm curious and trying to see if we are having the same issue.

I was able to reproduce this with and running `sudo pip install cfn-lint` and the following in my .travisci file
```
sudo: true
dist: xenial
```
Yup. The Sudo true is a noop now btw

On Wed., 21 Nov. 2018, 07:48 kddejong, <notifications@github.com> wrote:

> I was able to reproduce this with and running sudo pip install cfn-lint
> and the following in my .travisci file
>
> sudo: true
> dist: xenial
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/awslabs/cfn-python-lint/issues/471#issuecomment-440424093>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAXKdTSu-zeNMV3TsXwi6h0wawhr4x2Lks5uxGqIgaJpZM4YqZ_L>
> .
>

Yea I think we switch to `sudo: false` in this pull request to get around this.  https://github.com/awslabs/cfn-python-lint/pull/381

Probably time to dig deeper and see whats going on here though.
@alexjurkiewicz are you using sudo in your pip install commands for cfn-lint?  Or installing with `--user`?
Latter

On Wed., 21 Nov. 2018, 08:15 kddejong, <notifications@github.com> wrote:

> @alexjurkiewicz <https://github.com/alexjurkiewicz> are you using sudo in
> your pip install commands for cfn-lint? Or installing with --user?
>
> —
> You are receiving this because you were mentioned.
>
>
> Reply to this email directly, view it on GitHub
> <https://github.com/awslabs/cfn-python-lint/issues/471#issuecomment-440432032>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAXKdXNw8rsC8jp4VDZ-XfQvuLmtP_mXks5uxHD4gaJpZM4YqZ_L>
> .
>

And are you using language python or another or blank?  Found a lot of ways to repeat so far but all seem to have some basis in using the systems python which seems to have an older version of requests.  We could pin to a higher version.  I'll spend a little time tomorrow seeing if I can figure out if there is a minimum version of requests we should be supporting.  
I was using `language: generic`

On Wed, 21 Nov 2018 at 15:23 kddejong <notifications@github.com> wrote:

> And are you using language python or another or blank? Found a lot of ways
> to repeat so far but all seem to have some basis in using the systems
> python which seems to have an older version of requests. We could pin to a
> higher version. I'll spend a little time tomorrow seeing if I can figure
> out if there is a minimum version of requests we should be supporting.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/awslabs/cfn-python-lint/issues/471#issuecomment-440524890>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAXKdYXsUuEwq5XgsSiaZt9f11VgkSxVks5uxNU_gaJpZM4YqZ_L>
> .
>


Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -52,7 +52,15 @@ def get_version(filename):
     ]},
     packages=find_packages('src'),
     zip_safe=False,
-    install_requires=['pyyaml', 'six', 'requests', 'aws-sam-translator>=1.6.0', 'jsonpatch', 'jsonschema~=2.6.0', 'pathlib2'],
+    install_requires=[
+        'pyyaml',
+        'six~=1.11',
+        'requests>=2.15.0',
+        'aws-sam-translator>=1.8.0',
+        'jsonpatch',
+        'jsonschema~=2.6',
+        'pathlib2>=2.3.0;python_version<"3.4"'
+    ],
     python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
     entry_points={
         'console_scripts': [


Test patch: