Skip to content

Commit dc777a5

Browse files
authored
Add bandit to CI (#87)
* Add bandit to CI * Create a Travis CI job for bandit * Cover setup.py with bandit * Keep consistency in Travis CI jobs
1 parent 7a8c19c commit dc777a5

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ matrix:
1212
- python: 3.7
1313
env: TOXENV=py37,stack-scrapy-2.2-py3,stack-scrapy-2.3-py3,stack-scrapy-2.4-py3
1414
- python: 3.8
15-
env: TOXENV=py38,docs,stack-scrapy-2.2-py3,stack-scrapy-2.3-py3,stack-scrapy-2.4-py3
15+
env: TOXENV=py38,security,docs,stack-scrapy-2.2-py3,stack-scrapy-2.3-py3,stack-scrapy-2.4-py3
1616

1717
install:
1818
- pip install -U tox codecov

scrapy_crawlera/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ def exp_backoff(step, max):
1111
max_attempts = math.log(max / step, 2)
1212
for attempt in count(0, 1):
1313
if attempt <= max_attempts:
14-
yield random.uniform(0, step * 2 ** attempt)
14+
yield random.uniform(0, step * 2 ** attempt) # nosec
1515
else:
16-
yield random.uniform(0, max)
16+
yield random.uniform(0, max) # nosec

tox.ini

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# tox.ini
22
[tox]
3-
envlist = py27,py34,py35,py36,py37,py38,py39,docs
3+
envlist = py27,py34,py35,py36,py37,py38,py39,docs,security
44

55
[testenv]
66
deps =
@@ -9,6 +9,12 @@ deps =
99
commands =
1010
py.test --doctest-modules --cov=scrapy_crawlera {posargs:scrapy_crawlera tests}
1111

12+
[testenv:security]
13+
deps =
14+
bandit
15+
commands =
16+
bandit -r {posargs:scrapy_crawlera setup.py}
17+
1218
[testenv:stack-scrapy-1.0]
1319
basepython = python2.7
1420
deps =

0 commit comments

Comments
 (0)