maxminddb-rust 0.8.0__tar.gz → 0.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/.github/workflows/benchmark.yml +4 -4
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/.github/workflows/codeql.yml +5 -5
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/.github/workflows/lint.yml +8 -8
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/.github/workflows/release.yml +16 -16
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/.github/workflows/test.yml +16 -11
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/.github/workflows/zizmor.yml +2 -2
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/CHANGELOG.md +53 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/Cargo.lock +29 -40
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/Cargo.toml +2 -2
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/PKG-INFO +5 -6
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/README.md +1 -1
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/examples/context_manager.py +4 -3
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/maxminddb_rust.pyi +2 -1
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/pyproject.toml +4 -5
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/src/decode.rs +107 -16
- maxminddb_rust-0.9.0/src/ip.rs +222 -0
- maxminddb_rust-0.9.0/src/iterator.rs +526 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/src/lib.rs +163 -151
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/src/open.rs +1 -2
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/src/path.rs +65 -32
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/tests/bad_data_test.py +37 -12
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/tests/get_many_path_test.py +41 -7
- maxminddb_rust-0.9.0/tests/get_many_test.py +209 -0
- maxminddb_rust-0.9.0/tests/ip_object_test.py +92 -0
- maxminddb_rust-0.9.0/tests/iterator_test.py +289 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/tests/maxmind/README.md +1 -1
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/tests/maxmind/reader_test.py +30 -19
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/tests/path_test.py +76 -2
- maxminddb_rust-0.9.0/uv.lock +235 -0
- maxminddb_rust-0.8.0/src/ip.rs +0 -146
- maxminddb_rust-0.8.0/src/iterator.rs +0 -188
- maxminddb_rust-0.8.0/tests/get_many_test.py +0 -93
- maxminddb_rust-0.8.0/uv.lock +0 -275
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/.githooks/pre-commit +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/.github/dependabot.yml +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/.gitignore +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/.gitmodules +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/CONTRIBUTING.md +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/LICENSE +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/MIGRATION.md +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/benchmarks/_common.py +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/benchmarks/benchmark.py +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/benchmarks/benchmark_batch.py +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/benchmarks/benchmark_comprehensive.py +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/benchmarks/benchmark_parallel.py +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/benchmarks/benchmark_path.py +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/benchmarks/compare_refs.py +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/dev-bin/release.sh +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/examples/basic_usage.py +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/examples/batch_processing.py +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/examples/iterator_demo.py +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/precious.toml +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/py.typed +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/src/metadata.rs +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/tests/__init__.py +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/tests/benchmark_args_test.py +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/tests/concurrency_test.py +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/tests/introspection_test.py +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/tests/maxmind/UPSTREAM_LICENSE +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/tests/maxmind/__init__.py +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/tests/open_mode_test.py +0 -0
- {maxminddb_rust-0.8.0 → maxminddb_rust-0.9.0}/tests/resource_guard_test.py +0 -0
|
@@ -38,19 +38,19 @@ jobs:
|
|
|
38
38
|
|
|
39
39
|
steps:
|
|
40
40
|
- name: Check out repository
|
|
41
|
-
uses: actions/checkout@
|
|
41
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
42
42
|
with:
|
|
43
43
|
fetch-depth: 0
|
|
44
44
|
persist-credentials: false
|
|
45
45
|
submodules: recursive
|
|
46
46
|
|
|
47
47
|
- name: Install Rust
|
|
48
|
-
uses: dtolnay/rust-toolchain@
|
|
48
|
+
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
|
|
49
49
|
with:
|
|
50
50
|
toolchain: stable
|
|
51
51
|
|
|
52
52
|
- name: Install uv
|
|
53
|
-
uses: astral-sh/setup-uv@
|
|
53
|
+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
|
54
54
|
|
|
55
55
|
- name: Run benchmark comparison
|
|
56
56
|
env:
|
|
@@ -73,7 +73,7 @@ jobs:
|
|
|
73
73
|
--json-output benchmark-results.json
|
|
74
74
|
|
|
75
75
|
- name: Upload benchmark results
|
|
76
|
-
uses: actions/upload-artifact@
|
|
76
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
77
77
|
if: always()
|
|
78
78
|
with:
|
|
79
79
|
name: benchmark-results
|
|
@@ -21,7 +21,7 @@ jobs:
|
|
|
21
21
|
|
|
22
22
|
steps:
|
|
23
23
|
- name: Checkout repository
|
|
24
|
-
uses: actions/checkout@
|
|
24
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
25
25
|
with:
|
|
26
26
|
fetch-depth: 2
|
|
27
27
|
persist-credentials: false
|
|
@@ -31,17 +31,17 @@ jobs:
|
|
|
31
31
|
run: git checkout HEAD^2
|
|
32
32
|
|
|
33
33
|
- name: Set up Python
|
|
34
|
-
uses: actions/setup-python@
|
|
34
|
+
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
35
35
|
with:
|
|
36
36
|
python-version: "3.x"
|
|
37
37
|
|
|
38
38
|
- name: Install Rust
|
|
39
|
-
uses: dtolnay/rust-toolchain@
|
|
39
|
+
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
|
|
40
40
|
with:
|
|
41
41
|
toolchain: stable
|
|
42
42
|
|
|
43
43
|
- name: Initialize CodeQL
|
|
44
|
-
uses: github/codeql-action/init@v4.
|
|
44
|
+
uses: github/codeql-action/init@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
|
|
45
45
|
with:
|
|
46
46
|
languages: python, rust
|
|
47
47
|
|
|
@@ -52,4 +52,4 @@ jobs:
|
|
|
52
52
|
run: maturin build --release
|
|
53
53
|
|
|
54
54
|
- name: Perform CodeQL Analysis
|
|
55
|
-
uses: github/codeql-action/analyze@v4.
|
|
55
|
+
uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
|
|
@@ -13,12 +13,12 @@ jobs:
|
|
|
13
13
|
name: Clippy
|
|
14
14
|
runs-on: ubuntu-latest
|
|
15
15
|
steps:
|
|
16
|
-
- uses: actions/checkout@
|
|
16
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
17
17
|
with:
|
|
18
18
|
persist-credentials: false
|
|
19
19
|
|
|
20
20
|
- name: Install Rust
|
|
21
|
-
uses: dtolnay/rust-toolchain@
|
|
21
|
+
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
|
|
22
22
|
with:
|
|
23
23
|
toolchain: stable
|
|
24
24
|
components: clippy
|
|
@@ -30,12 +30,12 @@ jobs:
|
|
|
30
30
|
name: Rustfmt
|
|
31
31
|
runs-on: ubuntu-latest
|
|
32
32
|
steps:
|
|
33
|
-
- uses: actions/checkout@
|
|
33
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
34
34
|
with:
|
|
35
35
|
persist-credentials: false
|
|
36
36
|
|
|
37
37
|
- name: Install Rust
|
|
38
|
-
uses: dtolnay/rust-toolchain@
|
|
38
|
+
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
|
|
39
39
|
with:
|
|
40
40
|
toolchain: stable
|
|
41
41
|
components: rustfmt
|
|
@@ -47,7 +47,7 @@ jobs:
|
|
|
47
47
|
name: Ruff
|
|
48
48
|
runs-on: ubuntu-latest
|
|
49
49
|
steps:
|
|
50
|
-
- uses: actions/checkout@
|
|
50
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
51
51
|
with:
|
|
52
52
|
persist-credentials: false
|
|
53
53
|
|
|
@@ -64,14 +64,14 @@ jobs:
|
|
|
64
64
|
name: Prettier
|
|
65
65
|
runs-on: ubuntu-latest
|
|
66
66
|
steps:
|
|
67
|
-
- uses: actions/checkout@
|
|
67
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
68
68
|
with:
|
|
69
69
|
persist-credentials: false
|
|
70
70
|
|
|
71
71
|
- name: Setup Node.js
|
|
72
|
-
uses: actions/setup-node@
|
|
72
|
+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
73
73
|
with:
|
|
74
|
-
node-version: "
|
|
74
|
+
node-version: "26"
|
|
75
75
|
|
|
76
76
|
- name: Install Prettier
|
|
77
77
|
run: npm install -g prettier
|
|
@@ -34,15 +34,15 @@ jobs:
|
|
|
34
34
|
target: x86_64
|
|
35
35
|
- os: windows-latest
|
|
36
36
|
target: aarch64
|
|
37
|
-
python_versions: "3.11 3.12 3.13 3.14"
|
|
37
|
+
python_versions: "3.11 3.12 3.13 3.14 3.14t 3.15 3.15t"
|
|
38
38
|
|
|
39
39
|
steps:
|
|
40
|
-
- uses: actions/checkout@
|
|
40
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
41
41
|
with:
|
|
42
42
|
persist-credentials: false
|
|
43
43
|
|
|
44
44
|
- name: Set up Python
|
|
45
|
-
uses: actions/setup-python@
|
|
45
|
+
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
46
46
|
with:
|
|
47
47
|
python-version: "3.x"
|
|
48
48
|
|
|
@@ -57,7 +57,7 @@ jobs:
|
|
|
57
57
|
|
|
58
58
|
- name: Set up QEMU
|
|
59
59
|
if: runner.os == 'Linux' && matrix.target == 'aarch64'
|
|
60
|
-
uses: docker/setup-qemu-action@
|
|
60
|
+
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
|
|
61
61
|
with:
|
|
62
62
|
platforms: arm64
|
|
63
63
|
|
|
@@ -65,12 +65,12 @@ jobs:
|
|
|
65
65
|
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
66
66
|
with:
|
|
67
67
|
target: ${{ matrix.target }}
|
|
68
|
-
args: --release --out dist --interpreter ${{ matrix.python_versions || '3.
|
|
68
|
+
args: --release --out dist --interpreter ${{ matrix.python_versions || '3.9 3.10 3.11 3.12 3.13 3.14 3.14t 3.15 3.15t' }}
|
|
69
69
|
sccache: "false"
|
|
70
70
|
manylinux: auto
|
|
71
71
|
|
|
72
72
|
- name: Upload wheels
|
|
73
|
-
uses: actions/upload-artifact@
|
|
73
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
74
74
|
with:
|
|
75
75
|
name: maxminddb-rust-whl-${{ matrix.os }}-${{ matrix.target }}
|
|
76
76
|
path: dist
|
|
@@ -79,7 +79,7 @@ jobs:
|
|
|
79
79
|
name: Build source distribution
|
|
80
80
|
runs-on: ubuntu-latest
|
|
81
81
|
steps:
|
|
82
|
-
- uses: actions/checkout@
|
|
82
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
83
83
|
with:
|
|
84
84
|
persist-credentials: false
|
|
85
85
|
|
|
@@ -90,7 +90,7 @@ jobs:
|
|
|
90
90
|
args: --out dist
|
|
91
91
|
|
|
92
92
|
- name: Upload sdist
|
|
93
|
-
uses: actions/upload-artifact@
|
|
93
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
94
94
|
with:
|
|
95
95
|
name: maxminddb-rust-sdist
|
|
96
96
|
path: dist
|
|
@@ -100,23 +100,23 @@ jobs:
|
|
|
100
100
|
runs-on: ubuntu-latest
|
|
101
101
|
env:
|
|
102
102
|
CIBW_BUILD: cp314-pyodide_wasm32
|
|
103
|
-
CIBW_DEPENDENCY_VERSIONS_PYODIDE: "packages: pyodide-build==0.
|
|
103
|
+
CIBW_DEPENDENCY_VERSIONS_PYODIDE: "packages: pyodide-build==0.39.3"
|
|
104
104
|
CIBW_ENVIRONMENT: CARGO_PROFILE_RELEASE_PANIC=abort
|
|
105
105
|
CIBW_PLATFORM: pyodide
|
|
106
|
-
CIBW_PYODIDE_VERSION: "314.0.
|
|
106
|
+
CIBW_PYODIDE_VERSION: "314.0.7"
|
|
107
107
|
CIBW_TEST_COMMAND: >-
|
|
108
108
|
python -c "import maxminddb_rust; reader =
|
|
109
109
|
maxminddb_rust.open_database('{project}/tests/data/test-data/GeoIP2-City-Test.mmdb');
|
|
110
110
|
assert reader.get('81.2.69.160')['country']['iso_code'] == 'GB'"
|
|
111
111
|
RUSTUP_TOOLCHAIN: "1.93.0"
|
|
112
112
|
steps:
|
|
113
|
-
- uses: actions/checkout@
|
|
113
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
114
114
|
with:
|
|
115
115
|
persist-credentials: false
|
|
116
116
|
submodules: recursive
|
|
117
117
|
|
|
118
118
|
- name: Set up Python
|
|
119
|
-
uses: actions/setup-python@
|
|
119
|
+
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
120
120
|
with:
|
|
121
121
|
python-version: "3.x"
|
|
122
122
|
|
|
@@ -127,10 +127,10 @@ jobs:
|
|
|
127
127
|
--target wasm32-unknown-emscripten
|
|
128
128
|
|
|
129
129
|
- name: Build and test Pyodide wheel
|
|
130
|
-
uses: pypa/cibuildwheel@
|
|
130
|
+
uses: pypa/cibuildwheel@f9b966cfadf4109556cadc5bb39ddb72d0ce664e # v4.3.5
|
|
131
131
|
|
|
132
132
|
- name: Upload Pyodide wheels
|
|
133
|
-
uses: actions/upload-artifact@
|
|
133
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
134
134
|
with:
|
|
135
135
|
name: maxminddb-rust-whl-pyodide-wasm32
|
|
136
136
|
path: wheelhouse/*.whl
|
|
@@ -145,11 +145,11 @@ jobs:
|
|
|
145
145
|
id-token: write
|
|
146
146
|
steps:
|
|
147
147
|
- name: Download artifacts
|
|
148
|
-
uses: actions/download-artifact@
|
|
148
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
149
149
|
with:
|
|
150
150
|
pattern: maxminddb-rust-*
|
|
151
151
|
path: dist
|
|
152
152
|
merge-multiple: true
|
|
153
153
|
|
|
154
154
|
- name: Publish to PyPI
|
|
155
|
-
uses: pypa/gh-action-pypi-publish@
|
|
155
|
+
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
|
|
@@ -17,22 +17,22 @@ jobs:
|
|
|
17
17
|
strategy:
|
|
18
18
|
fail-fast: false
|
|
19
19
|
matrix:
|
|
20
|
-
python-version: ["3.
|
|
20
|
+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
|
|
21
21
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
22
22
|
|
|
23
23
|
steps:
|
|
24
|
-
- uses: actions/checkout@
|
|
24
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
25
25
|
with:
|
|
26
26
|
persist-credentials: false
|
|
27
27
|
submodules: recursive
|
|
28
28
|
|
|
29
29
|
- name: Set up Python ${{ matrix.python-version }}
|
|
30
|
-
uses: actions/setup-python@
|
|
30
|
+
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
31
31
|
with:
|
|
32
32
|
python-version: ${{ matrix.python-version }}
|
|
33
33
|
|
|
34
34
|
- name: Install Rust
|
|
35
|
-
uses: dtolnay/rust-toolchain@
|
|
35
|
+
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
|
|
36
36
|
with:
|
|
37
37
|
toolchain: stable
|
|
38
38
|
|
|
@@ -51,22 +51,27 @@ jobs:
|
|
|
51
51
|
run: pytest -v tests/
|
|
52
52
|
|
|
53
53
|
test-free-threaded:
|
|
54
|
-
name: Test free-threaded Python
|
|
55
|
-
runs-on:
|
|
54
|
+
name: Test free-threaded Python ${{ matrix.python-version }} on ${{ matrix.os }}
|
|
55
|
+
runs-on: ${{ matrix.os }}
|
|
56
|
+
strategy:
|
|
57
|
+
fail-fast: false
|
|
58
|
+
matrix:
|
|
59
|
+
python-version: ["3.14t", "3.15t"]
|
|
60
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
56
61
|
|
|
57
62
|
steps:
|
|
58
|
-
- uses: actions/checkout@
|
|
63
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
59
64
|
with:
|
|
60
65
|
persist-credentials: false
|
|
61
66
|
submodules: recursive
|
|
62
67
|
|
|
63
|
-
- name: Set up free-threaded Python
|
|
64
|
-
uses: actions/setup-python@
|
|
68
|
+
- name: Set up free-threaded Python ${{ matrix.python-version }}
|
|
69
|
+
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
65
70
|
with:
|
|
66
|
-
python-version:
|
|
71
|
+
python-version: ${{ matrix.python-version }}
|
|
67
72
|
|
|
68
73
|
- name: Install Rust
|
|
69
|
-
uses: dtolnay/rust-toolchain@
|
|
74
|
+
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
|
|
70
75
|
with:
|
|
71
76
|
toolchain: stable
|
|
72
77
|
|
|
@@ -17,9 +17,9 @@ jobs:
|
|
|
17
17
|
security-events: write
|
|
18
18
|
steps:
|
|
19
19
|
- name: Checkout repository
|
|
20
|
-
uses: actions/checkout@
|
|
20
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
21
21
|
with:
|
|
22
22
|
persist-credentials: false
|
|
23
23
|
|
|
24
24
|
- name: Run zizmor
|
|
25
|
-
uses: zizmorcore/zizmor-action@
|
|
25
|
+
uses: zizmorcore/zizmor-action@45d7276c9ca790aabd705e31ca99c6185c3e76dd # v0.8.1
|
|
@@ -5,6 +5,58 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.9.0] - 2026-11-08
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Added Python 3.15 support, with wheels for the standard and free-threaded
|
|
13
|
+
builds. CI now tests 3.15 and free-threaded 3.15.
|
|
14
|
+
- Releases now include free-threaded wheels for Windows ARM64.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Updated PyO3 from 0.29 to 0.30. Calls to `open_database` are faster on
|
|
19
|
+
CPython 3.11 and later. The garbage collector now traverses the extension's
|
|
20
|
+
class objects, which fixes a possible memory leak of those classes.
|
|
21
|
+
- Updated Rust and Python dependencies, GitHub Actions, the Pyodide build, and
|
|
22
|
+
the MaxMind-DB test submodule. The CodeQL action is now pinned to a commit
|
|
23
|
+
SHA like the other actions.
|
|
24
|
+
- `get_path()` and `get_many_path()` now cache up to 32 parsed tuple paths per
|
|
25
|
+
thread instead of per `Reader`, so cache hits take no lock.
|
|
26
|
+
- Each thread that decodes records keeps caches of up to 2,560 short Python
|
|
27
|
+
strings and map keys, using about 120 KB of tables, until the thread exits.
|
|
28
|
+
|
|
29
|
+
### Performance
|
|
30
|
+
|
|
31
|
+
- `get()`, `get_many()`, and lookups with `ipaddress` objects are about 20%
|
|
32
|
+
faster, and iteration is about 40% faster, measured against 0.8.0 with a
|
|
33
|
+
GeoIP2 City database on Python 3.14.
|
|
34
|
+
- Repeated strings and map keys in records reuse cached Python strings.
|
|
35
|
+
- Iteration builds `ipaddress` network objects without calling their
|
|
36
|
+
constructors. Each iterator first checks that the classes are the unpatched
|
|
37
|
+
standard library classes and that sample networks match. Otherwise it calls
|
|
38
|
+
the constructors, so patched or mocked classes behave as before.
|
|
39
|
+
|
|
40
|
+
### Removed
|
|
41
|
+
|
|
42
|
+
- Dropped support for Python 3.8, which reached end of life in October 2024.
|
|
43
|
+
PyO3 0.30 no longer supports it. Python 3.9 or later is now required.
|
|
44
|
+
|
|
45
|
+
### Fixed
|
|
46
|
+
|
|
47
|
+
- `get_many()` and `get_many_path()` no longer size the result from the
|
|
48
|
+
`__len__` of a generic iterable. A length such as `sys.maxsize` made them
|
|
49
|
+
panic with "capacity overflow" before reading any item.
|
|
50
|
+
- An error raised by the `__iter__` of the `ips` argument now propagates.
|
|
51
|
+
Before, every error became a `TypeError`. A `TypeError`, such as "object is
|
|
52
|
+
not iterable", still gets the "ips must be an iterable" message and keeps
|
|
53
|
+
the original error as its cause.
|
|
54
|
+
- `get_many()` and `get_many_path()` now iterate a list or tuple subclass that
|
|
55
|
+
overrides `__iter__`, instead of reading its contents directly.
|
|
56
|
+
- An error raised while reading `_ip` from an IP address object, such as a
|
|
57
|
+
`RuntimeError` from a property, now propagates. The lookup falls back to the
|
|
58
|
+
object's `packed` value only when `_ip` is missing or is not a usable int.
|
|
59
|
+
|
|
8
60
|
## [0.8.0] - 2026-09-12
|
|
9
61
|
|
|
10
62
|
### Changed
|
|
@@ -236,6 +288,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
236
288
|
- Python 3.8+
|
|
237
289
|
- CPython implementation
|
|
238
290
|
|
|
291
|
+
[0.9.0]: https://github.com/oschwald/maxminddb-rust-python/compare/v0.8.0...v0.9.0
|
|
239
292
|
[0.8.0]: https://github.com/oschwald/maxminddb-rust-python/compare/v0.7.0...v0.8.0
|
|
240
293
|
[0.7.0]: https://github.com/oschwald/maxminddb-rust-python/compare/v0.6.0...v0.7.0
|
|
241
294
|
[0.6.0]: https://github.com/oschwald/maxminddb-rust-python/compare/v0.5.0...v0.6.0
|
|
@@ -4,9 +4,9 @@ version = 4
|
|
|
4
4
|
|
|
5
5
|
[[package]]
|
|
6
6
|
name = "arc-swap"
|
|
7
|
-
version = "1.9.
|
|
7
|
+
version = "1.9.4"
|
|
8
8
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
-
checksum = "
|
|
9
|
+
checksum = "db4c94f57a570fce5d381be3289b3f79aef6332d72948fe82ab5772e423ccf92"
|
|
10
10
|
dependencies = [
|
|
11
11
|
"rustversion",
|
|
12
12
|
]
|
|
@@ -25,9 +25,9 @@ checksum = "cf370abdafd54d13e54a620e8c3e1145f28e46cc9d704bc6d94414559df41763"
|
|
|
25
25
|
|
|
26
26
|
[[package]]
|
|
27
27
|
name = "libc"
|
|
28
|
-
version = "0.2.
|
|
28
|
+
version = "0.2.191"
|
|
29
29
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
30
|
-
checksum = "
|
|
30
|
+
checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
|
|
31
31
|
|
|
32
32
|
[[package]]
|
|
33
33
|
name = "maxminddb"
|
|
@@ -43,7 +43,7 @@ dependencies = [
|
|
|
43
43
|
|
|
44
44
|
[[package]]
|
|
45
45
|
name = "maxminddb-rust"
|
|
46
|
-
version = "0.
|
|
46
|
+
version = "0.9.0"
|
|
47
47
|
dependencies = [
|
|
48
48
|
"arc-swap",
|
|
49
49
|
"ipnetwork",
|
|
@@ -63,9 +63,9 @@ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
|
63
63
|
|
|
64
64
|
[[package]]
|
|
65
65
|
name = "memmap2"
|
|
66
|
-
version = "0.9.
|
|
66
|
+
version = "0.9.12"
|
|
67
67
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
68
|
-
checksum = "
|
|
68
|
+
checksum = "6b0ca1155a9ecc25aa12e8313a119f32edf0255fea2f44839c4ac0a12b2ac157"
|
|
69
69
|
dependencies = [
|
|
70
70
|
"libc",
|
|
71
71
|
]
|
|
@@ -93,9 +93,9 @@ dependencies = [
|
|
|
93
93
|
|
|
94
94
|
[[package]]
|
|
95
95
|
name = "pyo3"
|
|
96
|
-
version = "0.
|
|
96
|
+
version = "0.30.1"
|
|
97
97
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
98
|
-
checksum = "
|
|
98
|
+
checksum = "229ca13b8a15bb0d1487b81ab975bfcd97513416499a8312011b6036e42e0de4"
|
|
99
99
|
dependencies = [
|
|
100
100
|
"libc",
|
|
101
101
|
"once_cell",
|
|
@@ -107,18 +107,18 @@ dependencies = [
|
|
|
107
107
|
|
|
108
108
|
[[package]]
|
|
109
109
|
name = "pyo3-build-config"
|
|
110
|
-
version = "0.
|
|
110
|
+
version = "0.30.1"
|
|
111
111
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
112
|
-
checksum = "
|
|
112
|
+
checksum = "70130e2b6dd1ee589a8788026a429561ca5c40fa7a2fa7914c2282eddae24700"
|
|
113
113
|
dependencies = [
|
|
114
114
|
"target-lexicon",
|
|
115
115
|
]
|
|
116
116
|
|
|
117
117
|
[[package]]
|
|
118
118
|
name = "pyo3-ffi"
|
|
119
|
-
version = "0.
|
|
119
|
+
version = "0.30.1"
|
|
120
120
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
121
|
-
checksum = "
|
|
121
|
+
checksum = "5e7ff73c555c286d212d4ce7e5fbda845a973c4f61bd5f160f5f2c3c2a04d1c4"
|
|
122
122
|
dependencies = [
|
|
123
123
|
"libc",
|
|
124
124
|
"pyo3-build-config",
|
|
@@ -126,26 +126,26 @@ dependencies = [
|
|
|
126
126
|
|
|
127
127
|
[[package]]
|
|
128
128
|
name = "pyo3-macros"
|
|
129
|
-
version = "0.
|
|
129
|
+
version = "0.30.1"
|
|
130
130
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
131
|
-
checksum = "
|
|
131
|
+
checksum = "c46d2e5862c7bb8207e3b639f713dda3c499933444784154c11d013c5a691b60"
|
|
132
132
|
dependencies = [
|
|
133
133
|
"proc-macro2",
|
|
134
134
|
"pyo3-macros-backend",
|
|
135
135
|
"quote",
|
|
136
|
-
"syn
|
|
136
|
+
"syn",
|
|
137
137
|
]
|
|
138
138
|
|
|
139
139
|
[[package]]
|
|
140
140
|
name = "pyo3-macros-backend"
|
|
141
|
-
version = "0.
|
|
141
|
+
version = "0.30.1"
|
|
142
142
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
143
|
-
checksum = "
|
|
143
|
+
checksum = "38b89f066f2ae72a2aef52d1537ca2fcd104440ebfadee06e97aa90738a25b9b"
|
|
144
144
|
dependencies = [
|
|
145
145
|
"heck",
|
|
146
146
|
"proc-macro2",
|
|
147
147
|
"quote",
|
|
148
|
-
"syn
|
|
148
|
+
"syn",
|
|
149
149
|
]
|
|
150
150
|
|
|
151
151
|
[[package]]
|
|
@@ -202,25 +202,14 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
|
|
|
202
202
|
dependencies = [
|
|
203
203
|
"proc-macro2",
|
|
204
204
|
"quote",
|
|
205
|
-
"syn
|
|
205
|
+
"syn",
|
|
206
206
|
]
|
|
207
207
|
|
|
208
208
|
[[package]]
|
|
209
209
|
name = "syn"
|
|
210
|
-
version = "
|
|
210
|
+
version = "3.0.9"
|
|
211
211
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
212
|
-
checksum = "
|
|
213
|
-
dependencies = [
|
|
214
|
-
"proc-macro2",
|
|
215
|
-
"quote",
|
|
216
|
-
"unicode-ident",
|
|
217
|
-
]
|
|
218
|
-
|
|
219
|
-
[[package]]
|
|
220
|
-
name = "syn"
|
|
221
|
-
version = "3.0.5"
|
|
222
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
223
|
-
checksum = "12df2e0110f65b775f769bb17ef989067a1d931b2eb822bd4346631eeada89f9"
|
|
212
|
+
checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
|
|
224
213
|
dependencies = [
|
|
225
214
|
"proc-macro2",
|
|
226
215
|
"quote",
|
|
@@ -235,26 +224,26 @@ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
|
|
|
235
224
|
|
|
236
225
|
[[package]]
|
|
237
226
|
name = "thiserror"
|
|
238
|
-
version = "2.0.
|
|
227
|
+
version = "2.0.21"
|
|
239
228
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
240
|
-
checksum = "
|
|
229
|
+
checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e"
|
|
241
230
|
dependencies = [
|
|
242
231
|
"thiserror-impl",
|
|
243
232
|
]
|
|
244
233
|
|
|
245
234
|
[[package]]
|
|
246
235
|
name = "thiserror-impl"
|
|
247
|
-
version = "2.0.
|
|
236
|
+
version = "2.0.21"
|
|
248
237
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
249
|
-
checksum = "
|
|
238
|
+
checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524"
|
|
250
239
|
dependencies = [
|
|
251
240
|
"proc-macro2",
|
|
252
241
|
"quote",
|
|
253
|
-
"syn
|
|
242
|
+
"syn",
|
|
254
243
|
]
|
|
255
244
|
|
|
256
245
|
[[package]]
|
|
257
246
|
name = "unicode-ident"
|
|
258
|
-
version = "1.0.
|
|
247
|
+
version = "1.0.27"
|
|
259
248
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
260
|
-
checksum = "
|
|
249
|
+
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "maxminddb-rust"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.9.0"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
authors = ["Gregory Oschwald <oschwald@gmail.com>"]
|
|
6
6
|
description = "Rust-based Python binding for MaxMind DB - high-performance alternative to maxminddb"
|
|
@@ -17,7 +17,7 @@ arc-swap = "1"
|
|
|
17
17
|
ipnetwork = "0.21"
|
|
18
18
|
maxminddb = "0.32.0"
|
|
19
19
|
memmap2 = "0.9"
|
|
20
|
-
pyo3 = "0.
|
|
20
|
+
pyo3 = "0.30.1"
|
|
21
21
|
rustc-hash = "2"
|
|
22
22
|
self_cell = "1.2.2"
|
|
23
23
|
serde = "1.0"
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maxminddb-rust
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.0
|
|
4
4
|
Classifier: Development Status :: 4 - Beta
|
|
5
5
|
Classifier: Environment :: WebAssembly :: Emscripten
|
|
6
6
|
Classifier: Intended Audience :: Developers
|
|
7
7
|
Classifier: License :: OSI Approved :: ISC License (ISCL)
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
10
9
|
Classifier: Programming Language :: Python :: 3.9
|
|
11
10
|
Classifier: Programming Language :: Python :: 3.10
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.13
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.14
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
16
16
|
Classifier: Programming Language :: Rust
|
|
17
17
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
18
18
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
19
|
Classifier: Topic :: Database
|
|
20
20
|
Classifier: Topic :: Internet
|
|
21
|
-
Requires-Dist: pytest>=8.
|
|
22
|
-
Requires-Dist: pytest>=8.4.2,<9.0.0 ; python_full_version == '3.9.*' and extra == 'test'
|
|
21
|
+
Requires-Dist: pytest>=8.4.2,<9.0.0 ; python_full_version < '3.10' and extra == 'test'
|
|
23
22
|
Requires-Dist: pytest>=9.0.2 ; python_full_version >= '3.10' and extra == 'test'
|
|
24
23
|
Provides-Extra: test
|
|
25
24
|
License-File: LICENSE
|
|
@@ -27,7 +26,7 @@ Summary: Rust-based Python binding for MaxMind DB - high-performance alternative
|
|
|
27
26
|
Keywords: maxmind,geoip,geolocation,ip-address,mmdb
|
|
28
27
|
Author-email: Gregory Oschwald <oschwald@gmail.com>
|
|
29
28
|
License: ISC
|
|
30
|
-
Requires-Python: >=3.
|
|
29
|
+
Requires-Python: >=3.9
|
|
31
30
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
32
31
|
Project-URL: Bug Tracker, https://github.com/oschwald/maxminddb-rust-python/issues
|
|
33
32
|
Project-URL: Changelog, https://github.com/oschwald/maxminddb-rust-python/blob/main/CHANGELOG.md
|
|
@@ -55,7 +54,7 @@ expected throughput in your environment.
|
|
|
55
54
|
|
|
56
55
|
The reader is thread-safe and can be shared across threads. On standard CPython
|
|
57
56
|
builds, CPU-bound lookups from Python threads remain constrained by the GIL.
|
|
58
|
-
Free-threaded CPython 3.14 wheels allow lookup threads to run concurrently;
|
|
57
|
+
Free-threaded CPython 3.14 and 3.15 wheels allow lookup threads to run concurrently;
|
|
59
58
|
scaling depends on the database and workload.
|
|
60
59
|
|
|
61
60
|
## Features
|
|
@@ -17,7 +17,7 @@ expected throughput in your environment.
|
|
|
17
17
|
|
|
18
18
|
The reader is thread-safe and can be shared across threads. On standard CPython
|
|
19
19
|
builds, CPU-bound lookups from Python threads remain constrained by the GIL.
|
|
20
|
-
Free-threaded CPython 3.14 wheels allow lookup threads to run concurrently;
|
|
20
|
+
Free-threaded CPython 3.14 and 3.15 wheels allow lookup threads to run concurrently;
|
|
21
21
|
scaling depends on the database and workload.
|
|
22
22
|
|
|
23
23
|
## Features
|
|
@@ -70,9 +70,10 @@ def multiple_databases() -> None:
|
|
|
70
70
|
country_db = "/var/lib/GeoIP/GeoLite2-Country.mmdb"
|
|
71
71
|
|
|
72
72
|
# Open multiple databases with nested context managers
|
|
73
|
-
with
|
|
74
|
-
city_db
|
|
75
|
-
|
|
73
|
+
with (
|
|
74
|
+
maxminddb_rust.open_database(city_db) as city_reader,
|
|
75
|
+
maxminddb_rust.open_database(country_db) as country_reader,
|
|
76
|
+
):
|
|
76
77
|
ip = "8.8.8.8"
|
|
77
78
|
print(f" Looking up {ip} in both databases:")
|
|
78
79
|
|
|
@@ -4,10 +4,11 @@ This module provides a high-performance alternative to the maxminddb Python pack
|
|
|
4
4
|
implemented in Rust using PyO3 with 100% API compatibility.
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
+
from collections.abc import Iterable, Iterator, Sequence
|
|
7
8
|
from ipaddress import IPv4Address, IPv4Network, IPv6Address, IPv6Network
|
|
8
9
|
from os import PathLike
|
|
9
10
|
from types import TracebackType
|
|
10
|
-
from typing import Any, BinaryIO,
|
|
11
|
+
from typing import Any, BinaryIO, Literal
|
|
11
12
|
|
|
12
13
|
__all__ = [ # noqa: RUF022 - Match the extension export order.
|
|
13
14
|
"Reader",
|