Skip to content

Commit ca40c74

Browse files
authored
Merge branch 'master' into add-parse-and-decodedurl-docs
2 parents 2bae6f6 + 0153229 commit ca40c74

16 files changed

Lines changed: 1526 additions & 1047 deletions

.gitignore

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
docs/_build
1+
/docs/_build/
22
tmp.py
3-
htmlcov/
4-
.coverage.*
53
*.py[cod]
6-
.mypy_cache
74

85
# emacs
96
*~
@@ -32,11 +29,22 @@ lib64
3229
# Installer logs
3330
pip-log.txt
3431

35-
# Unit test / coverage reports
36-
.coverage
37-
.tox/
32+
# Testing
33+
/.tox/
3834
nosetests.xml
3935

36+
# Coverage
37+
/.coverage
38+
/.coverage.*
39+
/htmlcov/
40+
/.mypy_cache/
41+
42+
# Documentation
43+
/htmldocs/
44+
45+
# Documentation
46+
/htmldocs/
47+
4048
# Translations
4149
*.mo
4250

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ matrix:
2222
- python: "3.8"
2323
env: TOXENV=test-py38,codecov
2424
- python: "pypy"
25-
env: TOXENV=test-pypy,codecov
25+
env: TOXENV=test-pypy2,codecov
2626
- python: "pypy3"
2727
env: TOXENV=test-pypy3,codecov
2828
- python: "2.7"

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
## dev (not yet released)
44

5+
* CPython 3.7 and 3.8 and PyPy3 added to test matrix
6+
* Hyperlink now has type hints and they are now exported per
7+
[PEP 561](https://www.python.org/dev/peps/pep-0561/).
8+
* Several bugs related to hidden state were fixed, making it so that all data
9+
on a `URL` object (including `rooted` and `uses_netloc`) is reflected by and
10+
consistent with its textual representation.
11+
This does mean that sometimes these constructor arguments are ignored, if it
12+
would create invalid or unparseable URL text.
13+
514
## 19.0.0
615

716
*(April 7, 2019)*
@@ -13,7 +22,8 @@ A query parameter-centric release, with two enhancements:
1322
[#39](https://github.com/python-hyper/hyperlink/pull/39))
1423
* `URL.remove()` now accepts *value* and *limit* parameters, allowing
1524
for removal of specific name-value pairs, as well as limiting the
16-
number of removals. (see [#71](https://github.com/python-hyper/hyperlink/pull/71))
25+
number of removals.
26+
(See [#71](https://github.com/python-hyper/hyperlink/pull/71))
1727

1828
## 18.0.0
1929

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include README.md LICENSE CHANGELOG.md tox.ini requirements-test.txt .coveragerc Makefile pytest.ini .tox-coveragerc
1+
include README.md LICENSE CHANGELOG.md tox.ini pyproject.toml .coveragerc Makefile pytest.ini .tox-coveragerc
22
exclude TODO.md .appveyor.yml
33

44
graft docs

pyproject.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[build-system]
2+
3+
requires = ["setuptools", "wheel"]
4+
build-backend = "setuptools.build_meta"
5+
6+
7+
[tool.black]
8+
9+
line-length = 80
10+
target-version = ["py27"]

setup.py

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,48 +10,47 @@
1010
from setuptools import find_packages, setup
1111

1212

13-
__author__ = 'Mahmoud Hashemi and Glyph Lefkowitz'
14-
__version__ = '19.0.1dev'
15-
__contact__ = 'mahmoud@hatnote.com'
16-
__url__ = 'https://github.com/python-hyper/hyperlink'
17-
__license__ = 'MIT'
13+
__author__ = "Mahmoud Hashemi and Glyph Lefkowitz"
14+
__version__ = "19.0.1dev"
15+
__contact__ = "mahmoud@hatnote.com"
16+
__url__ = "https://github.com/python-hyper/hyperlink"
17+
__license__ = "MIT"
1818

1919

20-
setup(name='hyperlink',
21-
version=__version__,
22-
description="A featureful, immutable, and correct URL for Python.",
23-
long_description=__doc__,
24-
author=__author__,
25-
author_email=__contact__,
26-
url=__url__,
27-
packages=find_packages(where="src"),
28-
package_dir={"": "src"},
29-
include_package_data=True,
30-
zip_safe=False,
31-
license=__license__,
32-
platforms='any',
33-
install_requires=[
34-
'idna>=2.5',
35-
'typing ; python_version<"3.5"',
36-
],
37-
python_requires='>=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
38-
classifiers=[
39-
'Topic :: Utilities',
40-
'Intended Audience :: Developers',
41-
'Topic :: Software Development :: Libraries',
42-
'Development Status :: 5 - Production/Stable',
43-
'Programming Language :: Python :: 2',
44-
'Programming Language :: Python :: 2.6',
45-
'Programming Language :: Python :: 2.7',
46-
'Programming Language :: Python :: 3',
47-
'Programming Language :: Python :: 3.4',
48-
'Programming Language :: Python :: 3.5',
49-
'Programming Language :: Python :: 3.6',
50-
'Programming Language :: Python :: 3.7',
51-
'Programming Language :: Python :: 3.8',
52-
'Programming Language :: Python :: Implementation :: PyPy',
53-
'License :: OSI Approved :: MIT License', ]
54-
)
20+
setup(
21+
name="hyperlink",
22+
version=__version__,
23+
description="A featureful, immutable, and correct URL for Python.",
24+
long_description=__doc__,
25+
author=__author__,
26+
author_email=__contact__,
27+
url=__url__,
28+
packages=find_packages(where="src"),
29+
package_dir={"": "src"},
30+
package_data=dict(hyperlink=["py.typed",],),
31+
zip_safe=False,
32+
license=__license__,
33+
platforms="any",
34+
install_requires=["idna>=2.5", 'typing ; python_version<"3.5"',],
35+
python_requires=">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
36+
classifiers=[
37+
"Topic :: Utilities",
38+
"Intended Audience :: Developers",
39+
"Topic :: Software Development :: Libraries",
40+
"Development Status :: 5 - Production/Stable",
41+
"Programming Language :: Python :: 2",
42+
"Programming Language :: Python :: 2.6",
43+
"Programming Language :: Python :: 2.7",
44+
"Programming Language :: Python :: 3",
45+
"Programming Language :: Python :: 3.4",
46+
"Programming Language :: Python :: 3.5",
47+
"Programming Language :: Python :: 3.6",
48+
"Programming Language :: Python :: 3.7",
49+
"Programming Language :: Python :: 3.8",
50+
"Programming Language :: Python :: Implementation :: PyPy",
51+
"License :: OSI Approved :: MIT License",
52+
],
53+
)
5554

5655
"""
5756
A brief checklist for release:

src/hyperlink/_socket.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from socket import inet_pton
33
except ImportError:
44
from typing import TYPE_CHECKING
5+
56
if TYPE_CHECKING: # pragma: no cover
67
pass
78
else:
@@ -25,7 +26,7 @@ class SockAddr(ctypes.Structure):
2526
def inet_pton(address_family, ip_string):
2627
# type: (int, str) -> bytes
2728
addr = SockAddr()
28-
ip_string_bytes = ip_string.encode('ascii')
29+
ip_string_bytes = ip_string.encode("ascii")
2930
addr.sa_family = address_family
3031
addr_size = ctypes.c_int(ctypes.sizeof(addr))
3132

@@ -37,10 +38,16 @@ def inet_pton(address_family, ip_string):
3738
except KeyError:
3839
raise socket.error("unknown address family")
3940

40-
if WSAStringToAddressA(
41-
ip_string_bytes, address_family, None,
42-
ctypes.byref(addr), ctypes.byref(addr_size)
43-
) != 0:
41+
if (
42+
WSAStringToAddressA(
43+
ip_string_bytes,
44+
address_family,
45+
None,
46+
ctypes.byref(addr),
47+
ctypes.byref(addr_size),
48+
)
49+
!= 0
50+
):
4451
raise socket.error(ctypes.FormatError())
4552

4653
return ctypes.string_at(getattr(addr, attribute), size)

0 commit comments

Comments
 (0)