Skip to content

Commit 493bbcf

Browse files
authored
Merge branch 'master' into flake8
2 parents 47539f0 + ba4454e commit 493bbcf

File tree

9 files changed

+46
-25
lines changed

9 files changed

+46
-25
lines changed

.bandit.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
skips:
2+
- B101
3+
- B107

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@ language: python
22
sudo: false
33
matrix:
44
include:
5+
- python: 3.8
6+
env: TOXENV=security
57
- python: 3.8
68
env: TOXENV=flake8
79
- python: 2.7
810
env: TOXENV=py27
911
- python: pypy
1012
env: TOXENV=pypy
11-
- python: 3.4
12-
env: TOXENV=py34
1313
- python: 3.5
1414
env: TOXENV=py35
1515
- python: 3.6
1616
env: TOXENV=py36
1717
- python: 3.7
1818
env: TOXENV=py37
19+
- python: 3.8
20+
env: TOXENV=py38
1921
- python: pypy3
2022
env: TOXENV=pypy3
2123
- python: 3.7
@@ -49,7 +51,7 @@ deploy:
4951
tags: true
5052
all_branches: true
5153
repo: scrapy/w3lib
52-
condition: "$TOXENV == py27"
54+
condition: "$TOXENV == py37"
5355

5456
cache:
5557
directories:

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This is a Python library of web-related functions, such as:
2727
Requirements
2828
============
2929

30-
Python 2.7 or Python 3.4+
30+
Python 2.7 or Python 3.5+
3131

3232
Install
3333
=======

docs/conf.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
# Add any Sphinx extension module names here, as strings. They can be extensions
2727
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
2828
extensions = [
29+
'hoverxref.extension',
30+
'notfound.extension',
2931
'sphinx.ext.autodoc',
3032
'sphinx.ext.doctest',
3133
'sphinx.ext.intersphinx',
@@ -248,9 +250,19 @@
248250

249251

250252
# Example configuration for intersphinx: refer to the Python standard library.
251-
intersphinx_mapping = {'http://docs.python.org/': None}
253+
intersphinx_mapping = {
254+
'pytest': ('https://docs.pytest.org/en/latest', None),
255+
'python': ('https://docs.python.org/3', None),
256+
'scrapy': ('https://scrapy.readthedocs.io/en/latest', None),
257+
'tox': ('https://tox.readthedocs.io/en/latest', None),
258+
}
252259

253260

254-
# --- Nitpicking options ------------------------------------------------------
261+
# -- Nitpicking options -------------------------------------------------------
255262

256263
nitpicky = True
264+
265+
266+
# -- sphinx-hoverxref options -------------------------------------------------
267+
268+
hoverxref_auto_ref = True

docs/index.rst

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,15 @@ Install
3939
Tests
4040
=====
4141

42-
`pytest`_ is the preferred way to run tests. Just run: ``pytest`` from the
43-
root directory to execute tests using the default Python interpreter.
42+
:doc:`pytest <pytest:index>` is the preferred way to run tests. Just run:
43+
``pytest`` from the root directory to execute tests using the default Python
44+
interpreter.
4445

45-
`tox`_ could be used to run tests for all supported Python versions.
46-
Install it (using 'pip install tox') and then run ``tox`` from
46+
:doc:`tox <tox:index>` could be used to run tests for all supported Python
47+
versions. Install it (using 'pip install tox') and then run ``tox`` from
4748
the root directory - tests will be executed for all available
4849
Python interpreters.
4950

50-
.. _tox: http://tox.testrun.org
51-
.. _pytest: https://docs.pytest.org/en/latest/
52-
5351

5452
Changelog
5553
=========
@@ -60,12 +58,10 @@ Changelog
6058
History
6159
-------
6260

63-
The code of w3lib was originally part of the `Scrapy framework`_ but was later
64-
stripped out of Scrapy, with the aim of make it more reusable and to provide a
65-
useful library of web functions without depending on Scrapy.
66-
67-
.. _Scrapy framework: http://scrapy.org
68-
.. _NEWS file: https://github.com/scrapy/w3lib/blob/master/NEWS
61+
The code of w3lib was originally part of the :doc:`Scrapy framework
62+
<scrapy:index>` but was later stripped out of Scrapy, with the aim of make it
63+
more reusable and to provide a useful library of web functions without
64+
depending on Scrapy.
6965

7066

7167
Indices and tables

docs/requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sphinx
2+
sphinx-hoverxref
3+
sphinx-notfound-page
4+
sphinx_rtd_theme

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
'Programming Language :: Python :: 2',
2222
'Programming Language :: Python :: 2.7',
2323
'Programming Language :: Python :: 3',
24-
'Programming Language :: Python :: 3.4',
2524
'Programming Language :: Python :: 3.5',
2625
'Programming Language :: Python :: 3.6',
2726
'Programming Language :: Python :: 3.7',
27+
'Programming Language :: Python :: 3.8',
2828
'Programming Language :: Python :: Implementation :: CPython',
2929
'Programming Language :: Python :: Implementation :: PyPy',
3030
'Topic :: Internet :: WWW/HTTP',

tests/test_html.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def test_with_escape_chars(self):
211211
# text with escape chars
212212
self.assertEqual(replace_escape_chars(u'escape\n\n'), u'escape')
213213
self.assertEqual(replace_escape_chars(u'escape\n', which_ones=('\t',)), u'escape\n')
214-
self.assertEqual(replace_escape_chars(u'escape\tchars\n', which_ones=('\t')), 'escapechars\n')
214+
self.assertEqual(replace_escape_chars(u'escape\tchars\n', which_ones=('\t',)), 'escapechars\n')
215215
self.assertEqual(replace_escape_chars(u'escape\tchars\n', replace_by=' '), 'escape chars ')
216216
self.assertEqual(replace_escape_chars(u'escape\tchars\n', replace_by=u'\xa3'), u'escape\xa3chars\xa3')
217217
self.assertEqual(replace_escape_chars(u'escape\tchars\n', replace_by=b'\xc2\xa3'), u'escape\xa3chars\xa3')

tox.ini

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# and then run "tox" from this directory.
55

66
[tox]
7-
envlist = py27, pypy, py34, py35, py36, py37, pypy3, docs
7+
envlist = py27, pypy, py35, py36, py37, py38, pypy3, docs
88

99
[testenv]
1010
deps =
@@ -16,6 +16,12 @@ commands =
1616
--cov=w3lib --cov-report=term \
1717
{posargs:w3lib tests}
1818

19+
[testenv:security]
20+
deps =
21+
bandit
22+
commands =
23+
bandit -r -c .bandit.yml {posargs:w3lib}
24+
1925
[testenv:flake8]
2026
basepython = python3
2127
deps =
@@ -26,9 +32,7 @@ commands =
2632

2733
[docs]
2834
changedir = docs
29-
deps =
30-
sphinx
31-
sphinx_rtd_theme
35+
deps = -rdocs/requirements.txt
3236

3337
[testenv:docs]
3438
changedir = {[docs]changedir}

0 commit comments

Comments
 (0)