Skip to content

Commit 1b1e12a

Browse files
committed
Merge branch 'master' into strategies
* master: (24 commits) Remove W504 Add Glyph's text for python-hyper#112. Note changes since 19.0.0 Apply black to setup.py also Run black-reformat Couple more cleanup bits Ignore /htmldocs [requires.io] dependency update [requires.io] dependency update Spiff up the tox config a bit more There is no requirements-test.txt file in the source tree. Archor a few paths to the root of the source tree. Minor re-ordering. per CR: rephrase gibberish test docstring per CR: add https:/, enumerate the cases per CR: match __init__ match __init__ doc per CR: explain in much more detail <79 per CR: make the test a little more thorough, improve docstring fix up inconsistencies in parsing & textual representation of 'rooted' and 'uses_netloc' ... # Conflicts: # .gitignore # MANIFEST.in # tox.ini
2 parents 30c6937 + 0153229 commit 1b1e12a

14 files changed

+1517
-1046
lines changed

Diff for: .gitignore

+16-7
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-
/.hypothesis/
74

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

35-
# Unit test / coverage reports
36-
.coverage
37-
.tox/
32+
# Testing
33+
/.tox/
34+
/.hypothesis/
3835
nosetests.xml
3936

37+
# Coverage
38+
/.coverage
39+
/.coverage.*
40+
/htmlcov/
41+
/.mypy_cache/
42+
43+
# Documentation
44+
/htmldocs/
45+
46+
# Documentation
47+
/htmldocs/
48+
4049
# Translations
4150
*.mo
4251

Diff for: .travis.yml

+1-1
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"

Diff for: CHANGELOG.md

+11-1
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

Diff for: pyproject.toml

+10
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"]

Diff for: setup.py

+39-44
Original file line numberDiff line numberDiff line change
@@ -10,52 +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__ = '[email protected]'
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__ = "[email protected]"
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-
package_data=dict(
30-
hyperlink=[
31-
"py.typed",
32-
],
33-
),
34-
zip_safe=False,
35-
license=__license__,
36-
platforms='any',
37-
install_requires=[
38-
'idna>=2.5',
39-
'typing ; python_version<"3.5"',
40-
],
41-
python_requires='>=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
42-
classifiers=[
43-
'Topic :: Utilities',
44-
'Intended Audience :: Developers',
45-
'Topic :: Software Development :: Libraries',
46-
'Development Status :: 5 - Production/Stable',
47-
'Programming Language :: Python :: 2',
48-
'Programming Language :: Python :: 2.6',
49-
'Programming Language :: Python :: 2.7',
50-
'Programming Language :: Python :: 3',
51-
'Programming Language :: Python :: 3.4',
52-
'Programming Language :: Python :: 3.5',
53-
'Programming Language :: Python :: 3.6',
54-
'Programming Language :: Python :: 3.7',
55-
'Programming Language :: Python :: 3.8',
56-
'Programming Language :: Python :: Implementation :: PyPy',
57-
'License :: OSI Approved :: MIT License', ]
58-
)
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+
)
5954

6055
"""
6156
A brief checklist for release:

Diff for: src/hyperlink/_socket.py

+12-5
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)