Merge pull request #828 from cjmayo/py313

Support Python 3.13
This commit is contained in:
Chris Mayo 2024-08-21 19:38:07 +01:00 committed by GitHub
commit 611bdd6c0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 72 additions and 5 deletions

View file

@ -25,6 +25,7 @@ jobs:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
toxenv: [py]
include:
- python-version: "3.9"
@ -79,6 +80,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python-version }}"
allow-prereleases: true
- name: Pip cache
uses: actions/cache@v4

View file

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

View file

@ -15,6 +15,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
requires-python = ">=3.9"

View file

@ -0,0 +1,18 @@
# Test #
<http://url.example.com> text <http://url2.example.com>
[link]( http://urllink.example.com)
[link2](http://urllink2
.example.com)
[test][id1]
[URL][id2]
[id1]:
http://urldef1.example.com
[id2]: http://urldef2.example.com "URL"
![img](http://urlimg.example.com)

View file

@ -0,0 +1,42 @@
url file://%(curdir)s/%(datadir)s/file-octet-stream.markdown
cache key file://%(curdir)s/%(datadir)s/file-octet-stream.markdown
real url file://%(curdir)s/%(datadir)s/file-octet-stream.markdown
name %(datadir)s/file-octet-stream.markdown
warning The URL with content type 'application/octet-stream' is not parseable.
valid
url http://url.example.com
cache key http://url.example.com
real url http://url.example.com
error
url http://url2.example.com
cache key http://url2.example.com
real url http://url2.example.com
error
url http://urldef1.example.com
cache key http://urldef1.example.com
real url http://urldef1.example.com
error
url http://urldef2.example.com
cache key http://urldef2.example.com
real url http://urldef2.example.com
error
url http://urllink.example.com
cache key http://urllink.example.com
real url http://urllink.example.com
error
url http://urllink2.example.com
cache key http://urllink2.example.com
real url http://urllink2.example.com
error
url http://urlimg.example.com
cache key http://urlimg.example.com
real url http://urlimg.example.com
error

View file

@ -2,7 +2,7 @@ url file://%(curdir)s/%(datadir)s/file.markdown
cache key file://%(curdir)s/%(datadir)s/file.markdown
real url file://%(curdir)s/%(datadir)s/file.markdown
name %(datadir)s/file.markdown
warning The URL with content type 'application/octet-stream' is not parseable.
warning The URL with content type 'text/markdown' is not parseable.
valid
url http://url.example.com

View file

@ -87,7 +87,11 @@ class TestFile(LinkCheckTest):
def test_markdown(self):
confargs = dict(enabledplugins=["MarkdownCheck"])
self.file_test("file.markdown", confargs=confargs)
if sys.version_info < (3, 12, 5):
markdown_file = "file-octet-stream.markdown"
else:
markdown_file = "file.markdown"
self.file_test(markdown_file, confargs=confargs)
def test_urllist(self):
self.file_test("urllist.txt")

View file

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