From 9d4aaa2c48b402e206cf45c9ab9044a402e2a8b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Thu, 7 Nov 2019 16:22:08 -0800 Subject: [PATCH 01/10] Add docs environment to tox config. --- .travis.yml | 2 ++ tox.ini | 34 +++++++++++++++++++++++++++++----- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 028ed0b8..e17f3cd0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,8 @@ matrix: env: TOXENV=test-pypy3,codecov - python: "2.7" env: TOXENV=packaging-py27 + - python: "3.8" + env: TOXENV=docs install: diff --git a/tox.ini b/tox.ini index bb56d322..ad43dff7 100644 --- a/tox.ini +++ b/tox.ini @@ -5,6 +5,7 @@ envlist = test-py{26,27,34,35,36,37,38,py,py3} coverage_report packaging + docs skip_missing_interpreters = {tty:True:False} @@ -220,11 +221,34 @@ deps = commands = coverage combine coverage xml -o "{env:COVERAGE_XML}" - codecov --file="{env:COVERAGE_XML}" --env \ - GITHUB_REF GITHUB_COMMIT GITHUB_USER GITHUB_WORKFLOW \ - TRAVIS_BRANCH TRAVIS_BUILD_WEB_URL TRAVIS_COMMIT TRAVIS_COMMIT_MESSAGE \ - APPVEYOR_REPO_BRANCH APPVEYOR_REPO_COMMIT \ - APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED + codecov --file="{env:COVERAGE_XML}" --env \ + GITHUB_REF GITHUB_COMMIT GITHUB_USER GITHUB_WORKFLOW \ + TRAVIS_BRANCH TRAVIS_BUILD_WEB_URL \ + TRAVIS_COMMIT TRAVIS_COMMIT_MESSAGE \ + APPVEYOR_REPO_BRANCH APPVEYOR_REPO_COMMIT \ + APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL \ + APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED + + +## +# Documentation +## + +[testenv:docs] + +description = build documentation + +basepython = python3.8 + +deps = + Sphinx==2.2.1 + sphinx_rtd_theme + +commands = + sphinx-build \ + -b html -d "{envtmpdir}/doctrees" \ + "{toxinidir}/docs" \ + "{toxworkdir}/docs/html" ## From 497b26fd16361a2d917c5bf81f9ad9b7061983e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Thu, 7 Nov 2019 16:22:26 -0800 Subject: [PATCH 02/10] URL.family does not exist. --- docs/api.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/api.rst b/docs/api.rst index 47854540..c2498000 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -61,7 +61,6 @@ URLs have many parts, and URL objects have many attributes to represent them. .. autoattribute:: hyperlink.URL.userinfo .. autoattribute:: hyperlink.URL.user .. autoattribute:: hyperlink.URL.rooted -.. autoattribute:: hyperlink.URL.family Low-level functions ------------------- From 26cb7f8653001ad9ea72db63f59814fac6a23737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Thu, 7 Nov 2019 16:23:38 -0800 Subject: [PATCH 03/10] parse_host is documented but not exported publicly. --- src/hyperlink/__init__.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/hyperlink/__init__.py b/src/hyperlink/__init__.py index a027d52d..349b2199 100644 --- a/src/hyperlink/__init__.py +++ b/src/hyperlink/__init__.py @@ -1,16 +1,19 @@ +from ._url import ( + parse, + parse_host, + register_scheme, + URL, + EncodedURL, + DecodedURL, + URLParseError, +) -from ._url import (URL, - parse, - EncodedURL, - DecodedURL, - URLParseError, - register_scheme) - -__all__ = [ - "URL", +__all__ = ( "parse", + "parse_host", + "register_scheme", + "URL", "EncodedURL", "DecodedURL", "URLParseError", - "register_scheme", -] +) From 088859a4ca44c5808ce63c866d5b5dd0aff64be4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Thu, 7 Nov 2019 16:23:53 -0800 Subject: [PATCH 04/10] parse is exported publicly but not documented. --- docs/api.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/api.rst b/docs/api.rst index c2498000..d2fd7ed7 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -70,5 +70,6 @@ A couple of notable helpers used by the :class:`~hyperlink.URL` type. .. autoclass:: hyperlink.URLParseError .. autofunction:: hyperlink.register_scheme .. autofunction:: hyperlink.parse_host +.. autofunction:: hyperlink.parse .. TODO: run doctests in docs? From 2c9cf879b6c877c34f71edfdb210e4ea321f4d9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Thu, 7 Nov 2019 16:35:47 -0800 Subject: [PATCH 05/10] Forgot to pin sphinx-rtd-theme --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index ad43dff7..8e353863 100644 --- a/tox.ini +++ b/tox.ini @@ -242,7 +242,7 @@ basepython = python3.8 deps = Sphinx==2.2.1 - sphinx_rtd_theme + sphinx-rtd-theme==0.4.3 commands = sphinx-build \ From f1cb4776f6c6d6961a195736c4b38a8e57552f8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Thu, 7 Nov 2019 16:38:08 -0800 Subject: [PATCH 06/10] Un-export parse_host and remove it from the docs. --- docs/api.rst | 1 - src/hyperlink/__init__.py | 2 -- 2 files changed, 3 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index d2fd7ed7..e5473f84 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -69,7 +69,6 @@ A couple of notable helpers used by the :class:`~hyperlink.URL` type. .. autoclass:: hyperlink.URLParseError .. autofunction:: hyperlink.register_scheme -.. autofunction:: hyperlink.parse_host .. autofunction:: hyperlink.parse .. TODO: run doctests in docs? diff --git a/src/hyperlink/__init__.py b/src/hyperlink/__init__.py index 349b2199..f680b01a 100644 --- a/src/hyperlink/__init__.py +++ b/src/hyperlink/__init__.py @@ -1,6 +1,5 @@ from ._url import ( parse, - parse_host, register_scheme, URL, EncodedURL, @@ -10,7 +9,6 @@ __all__ = ( "parse", - "parse_host", "register_scheme", "URL", "EncodedURL", From 22ac514d24111079f5238bc0f3e413547033a844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Thu, 7 Nov 2019 16:42:10 -0800 Subject: [PATCH 07/10] Work around flake8 bug --- src/hyperlink/test/test_socket.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hyperlink/test/test_socket.py b/src/hyperlink/test/test_socket.py index a66e1b05..0af2ed07 100644 --- a/src/hyperlink/test/test_socket.py +++ b/src/hyperlink/test/test_socket.py @@ -3,7 +3,7 @@ try: from socket import inet_pton except ImportError: - inet_pton = None # type: ignore[assignment] + inet_pton = None # type: ignore[assignment] intentional if not inet_pton: import socket From 2eae7f6401d3d05232cff9469d8b578c09aeebff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Thu, 7 Nov 2019 16:43:50 -0800 Subject: [PATCH 08/10] Revert "Work around flake8 bug" This reverts commit 22ac514d24111079f5238bc0f3e413547033a844. --- src/hyperlink/test/test_socket.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hyperlink/test/test_socket.py b/src/hyperlink/test/test_socket.py index 0af2ed07..a66e1b05 100644 --- a/src/hyperlink/test/test_socket.py +++ b/src/hyperlink/test/test_socket.py @@ -3,7 +3,7 @@ try: from socket import inet_pton except ImportError: - inet_pton = None # type: ignore[assignment] intentional + inet_pton = None # type: ignore[assignment] if not inet_pton: import socket From 40f78a6bac99222cec1130d3c614680a75b484b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Tue, 19 Nov 2019 11:35:51 -0800 Subject: [PATCH 09/10] Add docs-auto Tox environment --- tox.ini | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tox.ini b/tox.ini index 648fa5fe..ed5a914a 100644 --- a/tox.ini +++ b/tox.ini @@ -251,6 +251,25 @@ commands = "{toxworkdir}/docs/html" +[testenv:docs-auto] + +description = build documentation + +basepython = python3.8 + +deps = + Sphinx==2.2.1 + sphinx-rtd-theme==0.4.3 + sphinx-autobuild==0.7.1 + +commands = + sphinx-autobuild \ + -b html -d "{envtmpdir}/doctrees" \ + --host=localhost \ + "{toxinidir}/docs" \ + "{toxworkdir}/docs/html" + + ## # Packaging ## From cd7115d8e48fc908d626269eedc5ef669082a4c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Tue, 19 Nov 2019 11:38:31 -0800 Subject: [PATCH 10/10] update decription --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index ed5a914a..4be3fb70 100644 --- a/tox.ini +++ b/tox.ini @@ -253,7 +253,7 @@ commands = [testenv:docs-auto] -description = build documentation +description = build documentation and rebuild automatically basepython = python3.8