Merge pull request #490 from cjmayo/dnspython-2

Fix deprecation warning for resolver.query(), Drop Python 3.5 and add 3.9
This commit is contained in:
Chris Mayo 2020-09-23 19:52:34 +01:00 committed by GitHub
commit 54e34b2774
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 33 additions and 30 deletions

View file

@ -1,13 +1,13 @@
dist: bionic
language: python
python:
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9-dev"
jobs:
include:
- python: "3.5"
- python: "3.6"
env: TOXENV=oldbs4
- name: flake8
env: TOXENV=flake8

View file

@ -32,7 +32,7 @@ See `doc/install.txt`_ in the source code archive for general information. Excep
.. _doc/install.txt: doc/install.txt
Python 3.5 or later is needed.
Python 3.6 or later is needed.
The version in the pip repository is old. Instead, you can use pip to install the latest release from git: ``pip3 install git+https://github.com/linkchecker/linkchecker.git``. See `#359 <https://github.com/linkchecker/linkchecker/issues/359>`_.

View file

@ -1,14 +1,14 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2000-2014 Bastian Kleineidam
# Copyright (C) 2000-2016 Bastian Kleineidam, 2010-2020 LinkChecker Authors
# This file is distributed under the same license as the LinkChecker package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: LinkChecker \n"
"Project-Id-Version: LinkChecker 2020-09-14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-22 16:37+0100\n"
"POT-Creation-Date: 2020-09-14 19:50+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -25,7 +25,7 @@ msgid "Introduction"
msgstr ""
#: ../../src/index.rst:10
msgid "LinkChecker is a free, `GPL <http://www.gnu.org/licenses/gpl-2.0.html>`_ licensed website validator. LinkChecker checks links in web documents or full websites. It runs on Python 3 systems, requiring Python 3.5 or later."
msgid "LinkChecker is a free, `GPL <http://www.gnu.org/licenses/gpl-2.0.html>`_ licensed website validator. LinkChecker checks links in web documents or full websites. It runs on Python 3 systems, requiring Python 3.6 or later."
msgstr ""
#: ../../src/index.rst:15

View file

@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: LinkChecker \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-22 16:37+0100\n"
"POT-Creation-Date: 2020-09-14 19:50+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -30,7 +30,7 @@ msgstr ""
msgid ""
"LinkChecker is a free, `GPL <http://www.gnu.org/licenses/gpl-2.0.html>`_ "
"licensed website validator. LinkChecker checks links in web documents or "
"full websites. It runs on Python 3 systems, requiring Python 3.5 or "
"full websites. It runs on Python 3 systems, requiring Python 3.6 or "
"later."
msgstr ""

View file

@ -34,7 +34,7 @@ Manual setup for Unix systems
-----------------------------
First, install the required software.
1. Python >= 3.5.0 from https://www.python.org/
1. Python >= 3.6 from https://www.python.org/
Be sure to also have installed the included distutils module.
On most distributions, the distutils module is included in

View file

@ -10,7 +10,7 @@ Introduction
LinkChecker is a free, `GPL <http://www.gnu.org/licenses/gpl-2.0.html>`_
licensed website validator.
LinkChecker checks links in web documents or full websites.
It runs on Python 3 systems, requiring Python 3.5 or later.
It runs on Python 3 systems, requiring Python 3.6 or later.
Visit the project on `GitHub <https://github.com/linkchecker/linkchecker>`_.

View file

@ -2,7 +2,7 @@ Upgrading
=========
Migrating from 9.x to 10.0
--------------------------
Python 3.5 or newer is required.
Python 3.6 or newer is required.
The Python Beautiful Soup package is now required. A C compiler is not needed
for building.

View file

@ -20,11 +20,11 @@ Main package for link checking.
# version checks
import sys
if sys.version_info < (3, 5, 0, 'final', 0):
if sys.version_info < (3, 6, 0, 'final', 0):
import platform
raise SystemExit(
"This program requires Python 3.5.0 or later instead of %s."
"This program requires Python 3.6 or later instead of %s."
% platform.python_version()
)

View file

@ -14,6 +14,8 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import sys
import plistlib
try:
@ -23,6 +25,11 @@ try:
except ImportError:
has_biplist = False
if sys.version_info >= (3, 9):
# Although the biplist module imports on Python 3.9 it is not compatible:
# https://bitbucket.org/wooster/biplist/issues/12
has_biplist = False
def parse_bookmark_data(data):
"""Return iterator for bookmarks of the form (url, name).

View file

@ -319,7 +319,7 @@ class MailtoUrl(urlbase.UrlBase):
username, domain = mail.rsplit('@', 1)
log.debug(LOG_CHECK, "looking up MX mailhost %r", domain)
try:
answers = resolver.query(domain, 'MX')
answers = resolver.resolve(domain, 'MX', search=True)
except DNSException:
answers = []
if len(answers) == 0:

View file

@ -2,6 +2,6 @@
beautifulsoup4
requests >= 2.4
pyxdg
dnspython
dnspython >= 2.0
# optional:
argcomplete

View file

@ -27,8 +27,8 @@ Change it very carefully.
"""
import sys
if sys.version_info < (3, 5, 0, "final", 0):
raise SystemExit("This program requires Python 3.5 or later.")
if sys.version_info < (3, 6, 0, "final", 0):
raise SystemExit("This program requires Python 3.6 or later.")
import os
import re
import stat
@ -368,17 +368,17 @@ setup(
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Programming Language :: Python",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
options={},
# Requirements, usable with setuptools or the new Python packaging module.
python_requires=">= 3.5",
python_requires=">= 3.6",
install_requires=[
"requests >= 2.4",
"dnspython",
"dnspython >= 2.0",
"beautifulsoup4",
"pyxdg",
],

View file

@ -22,6 +22,7 @@ import pytest
from contextlib import contextmanager
from functools import lru_cache, wraps
from linkcheck import LinkCheckerInterrupt
from linkcheck.bookmarks.safari import has_biplist as bookmarks_has_biplist
basedir = os.path.dirname(__file__)
@ -173,12 +174,7 @@ need_pyftpdlib = _need_func(has_pyftpdlib, "pyftpdlib")
@lru_cache(1)
def has_biplist():
"""Test if biplist is available."""
try:
import biplist
return True
except ImportError:
return False
return bookmarks_has_biplist
need_biplist = _need_func(has_biplist, "biplist")

View file

@ -60,7 +60,7 @@ class TestHttp(HttpServerTest):
resultlines.append("warning No Content")
if status == 429:
resultlines.append("warning Rate limited (Retry-After: None)")
if (status not in [101, 102] and status < 200) or (
if (status not in [101, 102, 103] and status < 200) or (
status >= 400 and status != 429
):
result = "error"

View file

@ -1,5 +1,5 @@
[tox]
envlist = py35, py36, py37, py38, oldbs4
envlist = py36, py37, py38, py39, oldbs4
[base]
deps =
@ -30,7 +30,7 @@ deps =
beautifulsoup4 < 4.8.1
requests >= 2.4
pyxdg
dnspython
dnspython >= 2.0
{[base]deps}
[testenv:flake8]