Merge pull request #770 from cjmayo/py39

This commit is contained in:
Chris Mayo 2023-12-04 19:22:05 +00:00 committed by GitHub
commit 268799ee0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 15 additions and 12 deletions

View file

@ -22,13 +22,12 @@ jobs:
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
toxenv: [py]
include:
- python-version: "3.8"
- python-version: "3.9"
toxenv: minreqs
services:

View file

@ -28,7 +28,7 @@ Features
Installation
-------------
Python 3.8 or later is needed. Using pip to install LinkChecker:
Python 3.9 or later is needed. Using pip to install LinkChecker:
``pip3 install linkchecker``

View file

@ -10,7 +10,7 @@ Introduction
LinkChecker is a free, `GPL <https://www.gnu.org/licenses/old-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.8 or later.
It runs on Python 3 systems, requiring Python 3.9 or later.
Visit the project on `GitHub <https://github.com/linkchecker/linkchecker>`_.

View file

@ -1,6 +1,10 @@
Upgrading
=========
Migrating from 10.3 to 10.x
---------------------------
Python 3.9 or newer is required.
Migrating from 10.2 to 10.3
---------------------------
Python 3.8 or newer is required.

View file

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

View file

@ -385,8 +385,8 @@ def get_user_config():
)
if not os.path.exists(userconf):
# initial config (with all options explained)
with importlib.resources.path(
f"{PACKAGE_NAME}.data", "linkcheckerrc") as initialconf:
with importlib.resources.as_file(importlib.resources.files(
f"{PACKAGE_NAME}.data").joinpath("linkcheckerrc")) as initialconf:
# copy the initial configuration to the user configuration
try:
make_userdir(userconf)

View file

@ -22,6 +22,7 @@ Various string utility functions. Note that these functions are not
necessarily optimised for large strings, so use with care.
"""
import math
import re
import textwrap
import os
@ -187,7 +188,7 @@ def strduration_long(duration, do_translate=True):
else:
duration, unit = divmod(duration, divisor)
if unit:
time_str.append(_n(single, plural, unit) % unit)
time_str.append(_n(single, plural, math.ceil(unit)) % unit)
time_str.reverse()
if len(time_str) > 2:
time_str.pop()

View file

@ -11,14 +11,13 @@ classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
requires-python = ">=3.8"
requires-python = ">=3.9"
dependencies = [
"requests >= 2.20",

View file

@ -1,5 +1,5 @@
[tox]
envlist = py3{8,9,10,11,12}, minreqs
envlist = py3{9,10,11,12}, minreqs
[base]
deps =