Codebase list hyperlink / 1ce1b3c
New upstream snapshot. Debian Janitor 2 years ago
10 changed file(s) with 131 addition(s) and 32 deletion(s). Raw diff Collapse all Expand all
00 [run]
11 branch = True
22 omit = */flycheck_*
3
4 [report]
5 precision = 2
6 exclude_lines =
7 if TYPE_CHECKING
8 \s*\.\.\.$
00 # Hyperlink Changelog
1
2 ## Next
3
4 * CPython 3.9 added to test matrix
5
6 ## 21.0.0
7
8 *(January 7, 2021)*
9
10 * Update plus sign (`+`) handling to work with/like HTML form encoding
11 (`POST`) by default, fixes [#129][i129], and associated roundtripping ([#146][i146]).
12 * Package IDNA tables. ([#134][i134])
13 * Long overdue dependency bumps
14
15 [i129]: https://github.com/python-hyper/hyperlink/issues/129
16 [i134]: https://github.com/python-hyper/hyperlink/issues/134
17 [i146]: https://github.com/python-hyper/hyperlink/issues/146
118
219 ## 20.0.1
320
00 Metadata-Version: 1.2
11 Name: hyperlink
2 Version: 21.0.0
2 Version: 21.0.1.dev0
33 Summary: A featureful, immutable, and correct URL for Python.
44 Home-page: https://github.com/python-hyper/hyperlink
55 Author: Mahmoud Hashemi and Glyph Lefkowitz
0 hyperlink (21.0.0-2) UNRELEASED; urgency=medium
0 hyperlink (21.0.0+git20210808.1.ec7d172-1) UNRELEASED; urgency=medium
11
22 * Bump debhelper from old 12 to 13.
33 * Update standards version to 4.5.1, no changes needed.
4 * New upstream snapshot.
45
5 -- Debian Janitor <janitor@jelmer.uk> Thu, 26 Aug 2021 04:14:04 -0000
6 -- Debian Janitor <janitor@jelmer.uk> Fri, 03 Sep 2021 11:14:17 -0000
67
78 hyperlink (21.0.0-1) experimental; urgency=medium
89
6060
6161 # General information about the project.
6262 project = u'hyperlink'
63 copyright = u'2018, Mahmoud Hashemi'
63 copyright = u'2021, Mahmoud Hashemi'
6464 author = u'Mahmoud Hashemi'
6565
66 version = '20.0'
67 release = '20.0.1'
66 version = '21.0'
67 release = '21.0.0'
6868
6969 if os.name != 'nt':
7070 today_fmt = '%B %d, %Y'
1010
1111
1212 __author__ = "Mahmoud Hashemi and Glyph Lefkowitz"
13 __version__ = "21.0.0"
13 __version__ = "21.0.1dev"
1414 __contact__ = "mahmoud@hatnote.com"
1515 __url__ = "https://github.com/python-hyper/hyperlink"
1616 __license__ = "MIT"
4242 TypeVar,
4343 Union,
4444 cast,
45 TYPE_CHECKING,
46 overload,
4547 )
4648 from unicodedata import normalize
4749 from ._socket import inet_pton
6466 QueryParameters = Union[
6567 Mapping[Text, Optional[Text]],
6668 QueryPairs,
67 Sequence[Tuple[Text, Optional[Text]]],
69 Iterable[Tuple[Text, Optional[Text]]],
6870 ]
6971 T = TypeVar("T")
72 # Literal is not available in all pythons so we only bring it in for mypy.
73 if TYPE_CHECKING:
74 from typing import Literal
7075
7176
7277 # from boltons.typeutils
224229 _QUERY_KEY_QUOTE_MAP = _make_quote_map(_QUERY_KEY_SAFE)
225230 _QUERY_KEY_DECODE_MAP = _make_decode_map(_QUERY_KEY_DELIMS)
226231 _QUERY_VALUE_QUOTE_MAP = _make_quote_map(_QUERY_VALUE_SAFE)
227 _QUERY_VALUE_DECODE_MAP = _make_decode_map(_QUERY_VALUE_DELIMS)
232 _QUERY_VALUE_DECODE_MAP = _make_decode_map(_QUERY_VALUE_DELIMS | set("+"))
228233 _FRAGMENT_QUOTE_MAP = _make_quote_map(_FRAGMENT_SAFE)
229234 _FRAGMENT_DECODE_MAP = _make_decode_map(_FRAGMENT_DELIMS)
230235 _UNRESERVED_QUOTE_MAP = _make_quote_map(_UNRESERVED_CHARS)
24142419 # # End Twisted Compat Code
24152420
24162421
2422 # Add some overloads so that parse gives a better return value.
2423 @overload
2424 def parse(url, decoded, lazy=False):
2425 # type: (Text, Literal[False], bool) -> URL
2426 """Passing decoded=False returns URL."""
2427
2428
2429 @overload
2430 def parse(url, decoded=True, lazy=False):
2431 # type: (Text, Literal[True], bool) -> DecodedURL
2432 """Passing decoded=True (or the default value) returns DecodedURL."""
2433
2434
2435 @overload
2436 def parse(url, decoded=True, lazy=False):
2437 # type: (Text, bool, bool) -> Union[URL, DecodedURL]
2438 """If decoded is not a literal we don't know the return type."""
2439
2440
24172441 def parse(url, decoded=True, lazy=False):
24182442 # type: (Text, bool, bool) -> Union[URL, DecodedURL]
24192443 """
3434
3535 assert durl.user == "user"
3636 assert durl.userinfo == ("user", "\0\0\0\0")
37
38 def test_roundtrip_iri_parameter_values(self):
39 # type: () -> None
40 """
41 .to_iri() should never modify the application-level data of a query
42 parameter.
43 """
44 for value in ["hello", "goodbye", "+", "/", ":", "?"]:
45 self.assertEqual(
46 DecodedURL(DecodedURL().set("test", value).to_iri()).get(
47 "test"
48 ),
49 [value],
50 )
51
52 def test_roundtrip_uri_parameter_values(self):
53 # type: () -> None
54 """
55 .to_uri() should never modify the application-level data of a query
56 parameter.
57 """
58 for value in ["hello", "goodbye", "+", "/", ":", "?"]:
59 self.assertEqual(
60 DecodedURL(DecodedURL().set("test", value).to_uri()).get(
61 "test"
62 ),
63 [value],
64 )
3765
3866 def test_passthroughs(self):
3967 # type: () -> None
00 Metadata-Version: 1.2
11 Name: hyperlink
2 Version: 21.0.0
2 Version: 21.0.1.dev0
33 Summary: A featureful, immutable, and correct URL for Python.
44 Home-page: https://github.com/python-hyper/hyperlink
55 Author: Mahmoud Hashemi and Glyph Lefkowitz
00 [tox]
11
22 envlist =
3 flake8, mypy, black
4 test-py{26,27,34,35,36,37,38,py2,py3}
3 flake8, black, mypy
4 test-py{26,27,34,35,36,37,38,39,py2,py3}
55 coverage_report
66 docs
77 packaging
1111
1212 [default]
1313
14 basepython = python3.8
15
16 deps =
17 idna==2.9
14 basepython = python3.9
15
16 deps =
17 idna==2.9 # rq.filter: <3
1818
1919 setenv =
2020 PY_MODULE=hyperlink
3131 description = run tests
3232
3333 basepython =
34 py: python
35
3436 py26: python2.6
3537 py27: python2.7
3638 py34: python3.4
3941 py37: python3.7
4042 py38: python3.8
4143 py39: python3.9
44 py310: python3.10
4245
4346 pypy2: pypy
4447 pypy3: pypy3
4750 {[default]deps}
4851
4952 # In Python 2, we need to pull in typing, mock
50 py{26,27,py2}: typing==3.7.4.3
53 py{26,27,py2}: typing==3.10.0.0
5154 py{26,27,py2}: mock==3.0.5 # rq.filter: <4
5255
5356 # For pytest
7376
7477 commands =
7578 pytest --cov={env:PY_MODULE} --cov-report=term-missing:skip-covered --doctest-modules {posargs:src/{env:PY_MODULE}}
79 coverage_xml: coverage xml
7680
7781
7882 ##
8892 skip_install = True
8993
9094 deps =
91 black==20.8b1
95 black==21.7b0
9296
9397 setenv =
9498 BLACK_LINT_ARGS=--check
119123 skip_install = True
120124
121125 deps =
122 flake8-bugbear==20.11.1
123 flake8==3.8.4
126 flake8-bugbear==21.4.3
127 flake8==3.9.2
124128 mccabe==0.6.1
125 pep8-naming==0.11.1
126 pycodestyle==2.6.0
127 pydocstyle==5.1.1
128 pyflakes==2.2.0
129 pep8-naming==0.12.1
130 pycodestyle==2.7.0
131 pydocstyle==6.1.1
132 pyflakes==2.3.1
129133
130134 commands =
131135 flake8 {posargs:setup.py src/{env:PY_MODULE}}
182186 basepython = {[default]basepython}
183187
184188 deps =
185 mypy==0.790
189 mypy==0.910
190 types-mock==0.1.5
186191
187192 {[default]deps}
188193
275280
276281 deps =
277282 {[testenv:coverage_report]deps}
278 codecov==2.1.11
283 codecov==2.1.12
279284
280285 passenv =
281286 # See https://github.com/codecov/codecov-python/blob/master/README.md#using-tox
291296 setenv =
292297 {[testenv:coverage_report]setenv}
293298
294 COVERAGE_XML={envlogdir}/coverage_report.xml
299 COVERAGE_XML={envlogdir}/coverage.xml
295300
296301 commands =
297302 # Note documentation for CI variables in passenv above
317322 basepython = {[default]basepython}
318323
319324 deps =
320 Sphinx==3.4.3
321 sphinx-rtd-theme==0.5.1
325 Sphinx==4.1.2
326 sphinx-rtd-theme==0.5.2
322327
323328 commands =
324329 sphinx-build \
335340
336341 deps =
337342 {[testenv:docs]deps}
338 sphinx-autobuild==2020.9.1
343 sphinx-autobuild==2021.3.14
339344
340345 commands =
341346 sphinx-autobuild \
359364
360365 deps =
361366 check-manifest==0.46
362 readme-renderer==28.0
363 twine==3.3.0
367 readme-renderer==29.0
368 twine==3.4.2
364369
365370 commands =
366371 check-manifest
367372 pip wheel --wheel-dir "{envtmpdir}/dist" --no-deps {toxinidir}
368373 twine check "{envtmpdir}/dist/"*
374
375
376 ##
377 # Print dependencies
378 ##
379
380 [testenv:dependencies]
381
382 description = print dependencies
383
384 basepython = {[default]basepython}
385
386 recreate = true
387
388 deps =
389
390 commands =
391 pip freeze --exclude={env:PY_MODULE}