Skip to content

Commit

Permalink
Update flake8 support
Browse files Browse the repository at this point in the history
According to the developer documentation, this project adheres to
flake8. Update it so that it actually does this and also add tests for
it to the CI pipeline.
  • Loading branch information
JoshuaWatt committed Jan 15, 2020
1 parent 087f418 commit d7fa945
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ install:
- pip3 install coveralls
- pip3 install requests
- pip3 install black
- pip3 install flake8
before_script:
- printf '\nimport coverage\ncoverage.current_coverage = coverage.process_startup()\n'
>> "/home/travis/virtualenv/python${TRAVIS_PYTHON_VERSION}/lib/python${TRAVIS_PYTHON_VERSION}/sitecustomize.py"
- rm -f .coverage-report.*
script:
- black --check $(git ls-files '*.py')
- flake8 $(git ls-files '*.py')
# Pre build the image. This prevents long delays with no output in test cases
- ./ci/build_image.py $TEST_IMAGE --provider=$DOCKER_PROVIDER --quiet
- COVERAGE_PROCESS_START=${TRAVIS_BUILD_DIR}/.coveragerc $SH -c "ci/test.py -vb PyrexImage_${DOCKER_PROVIDER}_$(echo $TEST_IMAGE | sed 's/\W/_/g')"
Expand Down
2 changes: 1 addition & 1 deletion ci/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ def test_optional_bind(self):
conf["run"]["bind"] += " %s,optional" % missing_bind
conf.write_conf()

s = self.assertPyrexContainerShellCommand("test ! -e %s" % missing_bind)
self.assertPyrexContainerShellCommand("test ! -e %s" % missing_bind)

def test_bad_bind_option(self):
temp_dir = tempfile.mkdtemp("-pyrex")
Expand Down
1 change: 1 addition & 0 deletions lint
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ else
black --check $(git ls-files '*.py')
fi

flake8 $(git ls-files '*.py')
2 changes: 1 addition & 1 deletion pyrex.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ def prep_container(
# them.
env_sock_proxy = config["run"]["envsockproxy"].split()
for name in set(container_envvars + preserve_env):
if not name in os.environ:
if name not in os.environ:
continue

val = os.environ[name]
Expand Down

0 comments on commit d7fa945

Please sign in to comment.