Skip to content

Commit de4b34c

Browse files
committed
Enable flake8 and lint
1 parent a2700a1 commit de4b34c

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ before_install:
3939
- source ./ci/travis/setup.sh
4040

4141
install:
42-
- pip install setuptools-rust pytest pytest-benchmark tox numpy
42+
- pip install setuptools-rust pytest pytest-benchmark \
43+
tox numpy flake8
4344

4445
script:
46+
- flake8 examples/
4547
- ./ci/travis/test.sh
4648

4749
deploy:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from .rust_ext import *
1+
from .rust_ext import * # noqa

examples/simple-extension/setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import os
2-
import subprocess
31
import sys
42
from setuptools import find_packages, setup
53
from setuptools.command.test import test as TestCommand
64
from setuptools_rust import RustExtension
75

6+
87
class PyTest(TestCommand):
98
user_options = []
9+
1010
def run(self):
1111
self.run_command("test_rust")
1212
import subprocess
@@ -21,13 +21,15 @@ def get_cfg_flags():
2121
else:
2222
return ['--cfg=Py_3']
2323

24+
2425
def get_features():
2526
version = sys.version_info[0:2]
2627
if version[0] == 2:
2728
return ['numpy/python2']
2829
else:
2930
return ['numpy/python3']
3031

32+
3133
setup_requires = ['setuptools-rust>=0.6.0']
3234
install_requires = ['numpy']
3335
test_requires = install_requires + ['pytest']

examples/simple-extension/tests/test_ext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import numpy as np
22
from rust_ext import axpy, mult
3-
import pytest
3+
44

55
def test_axpy():
66
x = np.array([1.0, 2.0, 3.0])
@@ -12,8 +12,8 @@ def test_axpy():
1212
z = axpy(3.0, x, y)
1313
np.testing.assert_array_almost_equal(z, np.array([6.0, 9.0, 12.0, 15.0]))
1414

15+
1516
def test_mult():
1617
x = np.array([1.0, 2.0, 3.0])
1718
mult(3.0, x)
1819
np.testing.assert_array_almost_equal(x, np.array([3.0, 6.0, 9.0]))
19-

0 commit comments

Comments
 (0)