Skip to content

Commit 1fcda64

Browse files
authored
Merge pull request #375 from maxmind/greg/stf-557
Validate and update links (STF-557)
2 parents 3373d8b + 262e8ab commit 1fcda64

13 files changed

Lines changed: 150 additions & 11 deletions

.github/workflows/address-sanitizer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
persist-credentials: false
2525

2626
- name: Install the latest version of uv
27-
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # 8.1.0
27+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
2828

2929
- name: Install packages
3030
run: |

.github/workflows/clang-analyzer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
run: sudo apt install clang-tools
2424

2525
- name: Install the latest version of uv
26-
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # 8.1.0
26+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
2727

2828
- name: Build and run analyzer
2929
# We exclude extension/libmaxminddb/ as libmaxminddb has its own workflow

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
languages: python, cpp
3535

3636
- name: Install the latest version of uv
37-
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # 8.1.0
37+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
3838

3939
- run: uv build
4040
env:

.github/workflows/links.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Links
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: "0 13 * * 1" # weekly, to catch external link rot without a commit
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
linkChecker:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18+
with:
19+
persist-credentials: false
20+
21+
- name: Setup mise
22+
uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
23+
with:
24+
install: false
25+
26+
# Install only lychee (not the repo's full toolchain) and run the check.
27+
- name: Check links
28+
env:
29+
MISE_AUTO_INSTALL: "false"
30+
run: |
31+
mise install lychee
32+
mise run check-links

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
sudo udevadm trigger --name-match=kvm
7676
7777
- name: Build wheels
78-
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # 3.4.1
78+
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
7979
env:
8080
CIBW_ENABLE: pypy pypy-eol
8181
CIBW_PLATFORM: ${{ matrix.platform }}
@@ -118,4 +118,4 @@ jobs:
118118
path: dist
119119
merge-multiple: true
120120

121-
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # 1.14.0
121+
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0

.github/workflows/test-libmaxminddb.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
persist-credentials: false
3333

3434
- name: Install the latest version of uv
35-
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # 8.1.0
35+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
3636

3737
- name: Install tox
3838
run: uv tool install --python-preference only-managed --python 3.14 tox --with tox-uv --with tox-gh

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
submodules: true
2424
persist-credentials: false
2525
- name: Install the latest version of uv
26-
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # 8.1.0
26+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
2727
- name: Install tox
2828
run: uv tool install --python-preference only-managed --python 3.14 tox --with tox-uv --with tox-gh
2929
- name: Install Python

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
.coverage
99
.eggs
1010
.idea
11+
.lycheecache
1112
.pyre
1213
.tox
1314
build

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Usage
3535

3636
To use this module, you must first download or create a MaxMind DB file. We
3737
provide `free GeoLite databases
38-
<https://dev.maxmind.com/geoip/geolocate-an-ip/databases?lang=en>`_. These
38+
<https://dev.maxmind.com/geoip/geolocate-an-ip/databases/?lang=en>`_. These
3939
files must be decompressed with ``gunzip``.
4040

4141
After you have obtained a database and imported the module, call
@@ -116,5 +116,6 @@ Please report all issues with this code using the `GitHub issue tracker
116116
<https://github.com/maxmind/MaxMind-DB-Reader-python/issues>`_
117117

118118
If you are having an issue with a MaxMind service that is not specific to this
119-
API, please contact `MaxMind support <https://www.maxmind.com/en/support>`_ for
119+
API, please contact `MaxMind support
120+
<https://support.maxmind.com/knowledge-base>`_ for
120121
assistance.

lychee.toml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Lychee link checker configuration
2+
# https://lychee.cli.rs/#/usage/config
3+
#
4+
# Run locally with:
5+
# lychee './**/*.md' './**/*.rst' './maxminddb/**/*.py' './pyproject.toml'
6+
7+
# Include URL fragments in checks
8+
include_fragments = true
9+
10+
# Don't allow any redirects, so links that have moved are surfaced and can be
11+
# updated to their canonical destination.
12+
max_redirects = 0
13+
14+
# Accept these HTTP status codes
15+
# 100-103: Informational responses
16+
# 200-299: Success responses
17+
# 403: Forbidden (some sites use this for rate limiting)
18+
# 429: Too Many Requests
19+
# 500-599: Server errors (temporary issues shouldn't fail CI)
20+
# 999: LinkedIn's custom status code
21+
accept = ["100..=103", "200..=299", "403", "429", "500..=599", "999"]
22+
23+
# Exclude URL patterns from checking (treated as regular expressions)
24+
exclude = [
25+
# GitHub blob URLs with line-number fragments (not parseable as page anchors)
26+
'^https://github\.com/[^/]+/[^/]+/blob/[0-9a-fA-F]+/.+#L\d+$',
27+
# Live / auth-gated MaxMind endpoints: appear as code string literals or
28+
# require login, so they can't be verified by an anonymous request.
29+
'^https://geoip\.maxmind\.com',
30+
'^https://geolite\.info',
31+
'^https://minfraud\.maxmind\.com',
32+
'^https://sandbox\.maxmind\.com',
33+
'^https://updates\.maxmind\.com',
34+
'^https://www\.maxmind\.com/en/accounts/',
35+
'^https://www\.maxmind\.com/en/account/login',
36+
# Local / placeholder URLs (e.g. the proxy example in docstrings)
37+
'^file://',
38+
'^https?://example\.(com|org|net)',
39+
'^http://localhost',
40+
'127\.0\.0\.1',
41+
]
42+
43+
# Exclude file paths from getting checked (regular expressions, matched against
44+
# the path relative to the working directory). Patterns are segment-anchored
45+
# with (^|/) so short names like "build" don't match unintended paths.
46+
exclude_path = [
47+
'(^|/)node_modules/',
48+
'(^|/)\.venv/',
49+
'(^|/)venv/',
50+
'(^|/)build/',
51+
'(^|/)dist/',
52+
'(^|/)\.eggs/',
53+
'(^|/)[^/]*\.egg-info/',
54+
'(^|/)docs/_build/',
55+
# Vendored git submodules (upstream C library and shared test fixtures)
56+
'(^|/)extension/libmaxminddb/',
57+
'(^|/)tests/data/',
58+
# Changelog: historical entries are preserved as-is, not rewritten
59+
'(^|/)HISTORY\.rst$',
60+
]
61+
62+
# Cache results for 1 day to speed up repeated checks
63+
cache = true
64+
max_cache_age = "1d"
65+
66+
# Skip missing input files instead of erroring
67+
skip_missing = true

0 commit comments

Comments
 (0)