Skip to content

Conversation

@andyjack
Copy link
Member

  • snyk needs to check requirements.txt, so add one, but be warned it
    isn't actually used as part of installing this project's dependencies;
    see setup.py
  • setup.py needs ipaddress for all python 2.x and python <3.3, but we're
    only testing 3.x for versions 3.3 or greater. Therefore only check 2.7
    since we'd expect the same snyk result for all python 2.x versions.

- snyk needs to check requirements.txt, so add one, but be warned it
  isn't actually used as part of installing this project's dependencies;
  see setup.py
- setup.py needs ipaddress for all python 2.x and python <3.3, but we're
  only testing 3.x for versions 3.3 or greater. Therefore only check 2.7
  since we'd expect the same snyk result for all python 2.x versions.
@coveralls
Copy link

coveralls commented Sep 17, 2018

Coverage Status

Coverage increased (+0.4%) to 94.979% when pulling 3cb21ba on andy/travis-runs-snyk into 08fd056 on master.

.travis.yml Outdated
- pip install coverage coveralls
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then pip install pylint yapf; fi
- if [[ $TRAVIS_PYTHON_VERSION == '3.7' ]]; then pip install pylint yapf; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install unittest2; fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we drop 2.6, we should remove this.

requirements.txt Outdated
@@ -0,0 +1,4 @@
# NOTE: This project does not use requirements.txt, it uses setup.py.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect some tooling will use this and it will cause issues. Why can't we just install it manually for Travis?

Copy link
Member

@oschwald oschwald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Two small changes.

setup.py Outdated
requirements.append('ipaddress')
if os.environ.get('SNYK_TOKEN'):
f = open('requirements.txt', 'w')
[f.write(r + '\n') for r in requirements]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using list comprehension to get a postfix for doesn't seem very Pythonic. Could you rewrite this as a normal for loop?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, you don't close the file. This doesn't matter too much, but something like:

with open('requirements.txt', 'w') as f:
    for r in requirements:
        f.write(r + '\n')

Might be better.

@oschwald oschwald merged commit 7940be4 into master Sep 18, 2018
@oschwald oschwald deleted the andy/travis-runs-snyk branch September 18, 2018 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants