Commit Graph

51 Commits

Author SHA1 Message Date
Wilfredo Sánchez Vega d15a940cbb
Merge branch 'master' into fix_some_type_issues 2021-04-04 11:53:37 -07:00
Glyph 4a96c84631 don't unquote percent-encoded + in to_iri since it may be ambiguous 2021-03-17 23:34:28 -07:00
David Euresti 5e44454ef0 Fix lint 2021-03-16 10:10:21 -07:00
David Euresti 5eb389652a Fix mypy 2021-03-16 10:07:53 -07:00
David Euresti 240731fb88 Fix some small type issues.
Use @overload to have a better return type to parse.
Use Iterable for QueryParameters to support generators and views.

Fixes #156
2021-03-16 09:42:44 -07:00
Tom Most a9eba07c72 Don't force encode +
Before:

>>> URL(scheme='https', host='foo', query={'f+o o': 'b+a r'}).to_text()
'https://foo/?f%2Bo o=b%2Ba r'

After:

>>> URL(scheme='https', host='foo', query={'f+o o': 'b+a r'}).to_text()
'https://foo/?f+o o=b+a r'

If spaces pass unencoded, surely + can.
2020-12-28 21:43:47 -08:00
Glyph ad88c47c93 make hyperlink handle + like an HTML form post by default 2020-12-28 00:32:19 -08:00
Wilfredo Sánchez 7923706415 Remove types from docstrings, since Sphinx sees the type hints now. 2020-06-07 16:17:02 -07:00
Mahmoud Hashemi 2d21b70636 sigh, GitHub's 'resolve conflicts' editor left whitespace on a blank line. removing it. 2020-04-15 14:48:07 -07:00
Mahmoud Hashemi ca40c74436
Merge branch 'master' into add-parse-and-decodedurl-docs 2020-04-15 14:40:21 -07:00
Mahmoud Hashemi 2bae6f6416 use versionadded 2020-04-11 16:24:48 -07:00
Mahmoud Hashemi 182f834658 fix a lint error 2020-04-11 16:23:01 -07:00
Mahmoud Hashemi b086352bdd bunch of minor doctest fixups 2020-04-11 15:36:05 -07:00
Mahmoud Hashemi 6682bd93e7 remove extra space in doctest 2020-04-10 00:32:12 -07:00
Mahmoud Hashemi 4afeb55fcb add parse doctest and 'new in' messages 2020-04-10 00:24:13 -07:00
Mahmoud Hashemi a06eedb69c adding initial draft of parse and DecodedURL API docs. Also added default argument to DecodedURL() to ease programmatic construction. Fixes #125 2020-04-10 00:02:34 -07:00
Wilfredo Sánchez e3ca809805 Run black-reformat 2020-04-02 09:45:19 -07:00
Glyph 4b81bb5db8 per CR: match __init__ 2020-03-31 00:22:14 -07:00
Glyph 97c62c27a0 match __init__ doc 2020-03-31 00:18:29 -07:00
Glyph a1b360c56d per CR: explain in much more detail 2020-03-31 00:10:05 -07:00
Wilfredo Sánchez Vega 4640716f09
Merge branch 'master' into rooted-and-netloc-redux 2020-03-17 18:24:48 -07:00
Wilfredo Sánchez f36b6b81f8 mypy added a more specific "unreachable" error code. 2020-03-10 19:23:53 -07:00
Glyph 32b078bf8b fix up inconsistencies in parsing & textual representation of 'rooted' and 'uses_netloc' 2020-02-16 01:35:08 -08:00
Mahmoud Hashemi 243c007495 Merge branch 'master' into travis-lint, fixing some conflicts, and fixing mypy errors around unspecified generics. 2020-01-20 17:27:00 -08:00
Wilfredo Sánchez 9661999935 Add return ntypes to doc strings 2019-12-02 14:14:00 -08:00
Wilfredo Sánchez 7e5d944a2a Add types back to doc strings 2019-12-02 13:57:54 -08:00
Wilfredo Sánchez 789514be4e Merge branch 'master' into mypy
* master:
  [requires.io] dependency update
  [requires.io] dependency update
  [requires.io] dependency update
  [requires.io] dependency update
  update decription
  Add docs-auto Tox environment
  add some tests and a fix
  Revert "Work around flake8 bug"
  Work around flake8 bug
  Un-export parse_host and remove it from the docs.
  Forgot to pin sphinx-rtd-theme
  parse is exported publicly but not documented.
  parse_host is documented but not exported publicly.
  URL.family does not exist.
  Add docs environment to tox config.

# Conflicts:
#	src/hyperlink/_url.py
2019-12-02 13:37:55 -08:00
Wilfredo Sánchez 13fccdf725 Reduce calls to cast() 2019-11-19 11:09:23 -08:00
Wilfredo Sánchez 29c3dd9cd7 pin pyflakes pending a release with https://github.com/PyCQA/pyflakes/pull/455
Clean up some type hints.
2019-11-19 10:39:29 -08:00
Glyph 1c0f640d56 add some tests and a fix 2019-11-10 00:54:36 -08:00
Wilfredo Sánchez 6bafade9b4 No longer need this change 2019-11-04 13:02:57 -08:00
Wilfredo Sánchez 5331f893d8 href is allowed to be a URL 2019-11-04 12:56:46 -08:00
Wilfredo Sánchez 1e96fdead7 Don't need Union here. 2019-11-04 12:26:58 -08:00
Wilfredo Sánchez 47574602f0 Get rid of subencoding=False code path in _percent_decode().
It isn't used by any of the rest of the code, and it makes _percent_decode() return either text or bytes, which then meant a lot of type casting elsewhere.
2019-11-04 12:24:55 -08:00
Wilfredo Sánchez 7f7121abc6 Type hints at 100%. 2019-11-04 12:12:12 -08:00
Wilfredo Sánchez 50acc09360 Finish typing for URL 2019-11-03 11:06:03 -08:00
Wilfredo Sánchez 8bf25e4064 More hints 2019-11-03 09:17:19 -08:00
Wilfredo Sánchez 5fa0ce26b7 This time with less oops 2019-11-02 17:14:12 -07:00
Wilfredo Sánchez 63c471dc3e unicode ➜ Text 2019-11-02 16:49:45 -07:00
Wilfredo Sánchez 0492f6f8ab Revert "More type hints"
This reverts commit eb46d28f63.
2019-11-02 16:46:26 -07:00
Wilfredo Sánchez eb46d28f63 More type hints 2019-11-02 16:08:21 -07:00
Wilfredo Sánchez 915d3ceef5 Add type hints to _encode_path_parts.
Get rid of joined argument, as it changed the input and output types and was overriden to False in all but one case.
2019-11-02 15:02:55 -07:00
Wilfredo Sánchez f459aa1d11 Add type hints to _encode_path_parts.
Get rid of joined argument, as it changed the input and output types and was overriden to False in all but one case.
2019-11-02 13:19:49 -07:00
Wilfredo Sánchez 913eb294db Undo a change to avoid tripping up coverage/patch. 2019-11-02 08:28:29 -07:00
Wilfredo Sánchez 873780bf05 Add more type hints 2019-11-01 12:27:17 -07:00
Wilfredo Sánchez f6e87a671a Silent flake8 from having opinions about type comments; let mypy complain is need be. 2019-10-26 20:53:48 -07:00
Wilfredo Sánchez 16a83d93aa Make mypy happy 2019-10-26 20:37:33 -07:00
Wilfredo Sánchez e0cee8a995 Move definition of inet_pton into its own file so that the Windows-specific treatment can happen without cluttering _url.py.
Makes use of TYPE_CHECKING not add to the noise so much.
2019-10-26 20:34:42 -07:00
Wilfredo Sánchez 38cdd106de Use CapsCase for SockAddr 2019-10-20 17:26:47 -07:00
Wilfredo Sánchez e213a58ed3 Add Flake8 to Tox config. 2019-10-20 17:13:52 -07:00