maxminddb-polars 0.1.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_polars-0.1.0/.cargo/audit.toml +13 -0
- maxminddb_polars-0.1.0/.githooks/pre-commit +7 -0
- maxminddb_polars-0.1.0/.github/ISSUE_TEMPLATE/bug.yml +44 -0
- maxminddb_polars-0.1.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
- maxminddb_polars-0.1.0/.github/ISSUE_TEMPLATE/feature.yml +26 -0
- maxminddb_polars-0.1.0/.github/dependabot.yml +56 -0
- maxminddb_polars-0.1.0/.github/pull_request_template.md +13 -0
- maxminddb_polars-0.1.0/.github/workflows/artifacts.yml +297 -0
- maxminddb_polars-0.1.0/.github/workflows/audit.yml +64 -0
- maxminddb_polars-0.1.0/.github/workflows/benchmark.yml +57 -0
- maxminddb_polars-0.1.0/.github/workflows/codeql.yml +42 -0
- maxminddb_polars-0.1.0/.github/workflows/compatibility.yml +61 -0
- maxminddb_polars-0.1.0/.github/workflows/fuzz.yml +70 -0
- maxminddb_polars-0.1.0/.github/workflows/lint.yml +111 -0
- maxminddb_polars-0.1.0/.github/workflows/release.yml +195 -0
- maxminddb_polars-0.1.0/.github/workflows/test.yml +62 -0
- maxminddb_polars-0.1.0/.github/workflows/zizmor.yml +27 -0
- maxminddb_polars-0.1.0/.gitignore +28 -0
- maxminddb_polars-0.1.0/.gitmodules +3 -0
- maxminddb_polars-0.1.0/.prettierignore +7 -0
- maxminddb_polars-0.1.0/.python-version +1 -0
- maxminddb_polars-0.1.0/CHANGELOG.md +37 -0
- maxminddb_polars-0.1.0/CONTRIBUTING.md +93 -0
- maxminddb_polars-0.1.0/Cargo.lock +3855 -0
- maxminddb_polars-0.1.0/Cargo.toml +44 -0
- maxminddb_polars-0.1.0/LICENSE +16 -0
- maxminddb_polars-0.1.0/PKG-INFO +114 -0
- maxminddb_polars-0.1.0/README.md +80 -0
- maxminddb_polars-0.1.0/SECURITY.md +14 -0
- maxminddb_polars-0.1.0/benchmarks/compare.py +222 -0
- maxminddb_polars-0.1.0/benchmarks/lookups.py +136 -0
- maxminddb_polars-0.1.0/benchmarks/real_city.py +108 -0
- maxminddb_polars-0.1.0/benchmarks/results/comparison-high-cardinality.json +96 -0
- maxminddb_polars-0.1.0/benchmarks/results/comparison-repeated.json +96 -0
- maxminddb_polars-0.1.0/benchmarks/results/development-fixtures.json +187 -0
- maxminddb_polars-0.1.0/benchmarks/results/real-geolite2-city.json +45 -0
- maxminddb_polars-0.1.0/benchmarks/smoke.py +47 -0
- maxminddb_polars-0.1.0/dev-bin/release.sh +230 -0
- maxminddb_polars-0.1.0/docs/adr/0001-public-api.md +69 -0
- maxminddb_polars-0.1.0/docs/adr/0002-partial-projection.md +45 -0
- maxminddb_polars-0.1.0/docs/api.md +102 -0
- maxminddb_polars-0.1.0/docs/comparison.md +66 -0
- maxminddb_polars-0.1.0/docs/compatibility.md +52 -0
- maxminddb_polars-0.1.0/docs/custom-schemas.md +39 -0
- maxminddb_polars-0.1.0/docs/maintaining.md +95 -0
- maxminddb_polars-0.1.0/docs/performance.md +60 -0
- maxminddb_polars-0.1.0/docs/release-readiness.md +72 -0
- maxminddb_polars-0.1.0/docs/security-testing.md +47 -0
- maxminddb_polars-0.1.0/maxminddb_polars/__init__.py +10 -0
- maxminddb_polars-0.1.0/maxminddb_polars/_api.py +135 -0
- maxminddb_polars-0.1.0/maxminddb_polars/_internal.py +25 -0
- maxminddb_polars-0.1.0/maxminddb_polars/_schema.py +57 -0
- maxminddb_polars-0.1.0/maxminddb_polars/py.typed +1 -0
- maxminddb_polars-0.1.0/maxminddb_polars/schemas.py +143 -0
- maxminddb_polars-0.1.0/package-lock.json +29 -0
- maxminddb_polars-0.1.0/package.json +10 -0
- maxminddb_polars-0.1.0/precious.toml +83 -0
- maxminddb_polars-0.1.0/pyproject.toml +85 -0
- maxminddb_polars-0.1.0/rust-toolchain.toml +5 -0
- maxminddb_polars-0.1.0/scripts/check +23 -0
- maxminddb_polars-0.1.0/scripts/inspect_artifacts.py +146 -0
- maxminddb_polars-0.1.0/src/cache.rs +210 -0
- maxminddb_polars-0.1.0/src/fuzzing.rs +91 -0
- maxminddb_polars-0.1.0/src/guard.rs +17 -0
- maxminddb_polars-0.1.0/src/known.rs +499 -0
- maxminddb_polars-0.1.0/src/lib.rs +84 -0
- maxminddb_polars-0.1.0/src/lookup.rs +729 -0
- maxminddb_polars-0.1.0/src/schema.rs +591 -0
- maxminddb_polars-0.1.0/src/value.rs +713 -0
- maxminddb_polars-0.1.0/tests/fuzz-fixtures/projected-value-extended-type-overflow.mmdb.b64 +305 -0
- maxminddb_polars-0.1.0/tests/python/test_custom_schemas.py +198 -0
- maxminddb_polars-0.1.0/tests/python/test_lookup.py +193 -0
- maxminddb_polars-0.1.0/tests/python/test_lookup_path.py +105 -0
- maxminddb_polars-0.1.0/tests/python/test_packaging.py +36 -0
- maxminddb_polars-0.1.0/uv.lock +1045 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[advisories]
|
|
2
|
+
# The Polars 1.43 plugin ABI requires pyo3-polars 0.27 and PyO3 0.28. The
|
|
3
|
+
# affected PyList/PyTuple iterator nth methods and PyCFunction closure API are
|
|
4
|
+
# not called by this project. Bincode is a required Polars 0.54 transitive
|
|
5
|
+
# dependency. Revisit all exceptions with the Polars 0.55 / pyo3-polars 0.28
|
|
6
|
+
# compatibility update, or by 2026-09-30.
|
|
7
|
+
ignore = [
|
|
8
|
+
"RUSTSEC-2025-0141",
|
|
9
|
+
"RUSTSEC-2026-0176",
|
|
10
|
+
"RUSTSEC-2026-0177",
|
|
11
|
+
"RUSTSEC-2026-0194",
|
|
12
|
+
"RUSTSEC-2026-0195",
|
|
13
|
+
]
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Report incorrect behavior, a crash, or a compatibility problem
|
|
3
|
+
title: ""
|
|
4
|
+
labels: [bug]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: >-
|
|
9
|
+
Do not report security vulnerabilities here. Use private vulnerability
|
|
10
|
+
reporting as described in SECURITY.md.
|
|
11
|
+
- type: input
|
|
12
|
+
id: version
|
|
13
|
+
attributes:
|
|
14
|
+
label: maxminddb-polars version
|
|
15
|
+
placeholder: 0.1.0a1
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
- type: input
|
|
19
|
+
id: environment
|
|
20
|
+
attributes:
|
|
21
|
+
label: Environment
|
|
22
|
+
description: Include Python, Polars, operating system, and architecture.
|
|
23
|
+
validations:
|
|
24
|
+
required: true
|
|
25
|
+
- type: textarea
|
|
26
|
+
id: reproduction
|
|
27
|
+
attributes:
|
|
28
|
+
label: Minimal reproduction
|
|
29
|
+
description: Use a public test database or describe the schema without sharing licensed data.
|
|
30
|
+
render: python
|
|
31
|
+
validations:
|
|
32
|
+
required: true
|
|
33
|
+
- type: textarea
|
|
34
|
+
id: expected
|
|
35
|
+
attributes:
|
|
36
|
+
label: Expected behavior
|
|
37
|
+
validations:
|
|
38
|
+
required: true
|
|
39
|
+
- type: textarea
|
|
40
|
+
id: actual
|
|
41
|
+
attributes:
|
|
42
|
+
label: Actual behavior
|
|
43
|
+
validations:
|
|
44
|
+
required: true
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Propose a new lookup capability, schema, or integration
|
|
3
|
+
title: ""
|
|
4
|
+
labels: [enhancement]
|
|
5
|
+
body:
|
|
6
|
+
- type: textarea
|
|
7
|
+
id: problem
|
|
8
|
+
attributes:
|
|
9
|
+
label: Problem
|
|
10
|
+
description: What use case cannot be handled cleanly today?
|
|
11
|
+
validations:
|
|
12
|
+
required: true
|
|
13
|
+
- type: textarea
|
|
14
|
+
id: proposal
|
|
15
|
+
attributes:
|
|
16
|
+
label: Proposed API or behavior
|
|
17
|
+
validations:
|
|
18
|
+
required: true
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: alternatives
|
|
21
|
+
attributes:
|
|
22
|
+
label: Alternatives considered
|
|
23
|
+
- type: textarea
|
|
24
|
+
id: performance
|
|
25
|
+
attributes:
|
|
26
|
+
label: Performance or compatibility considerations
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: cargo
|
|
4
|
+
directory: /
|
|
5
|
+
schedule:
|
|
6
|
+
interval: weekly
|
|
7
|
+
day: monday
|
|
8
|
+
time: "14:00"
|
|
9
|
+
open-pull-requests-limit: 5
|
|
10
|
+
cooldown:
|
|
11
|
+
default-days: 4
|
|
12
|
+
groups:
|
|
13
|
+
polars-rust:
|
|
14
|
+
patterns:
|
|
15
|
+
- polars
|
|
16
|
+
- pyo3-polars
|
|
17
|
+
|
|
18
|
+
- package-ecosystem: pip
|
|
19
|
+
directory: /
|
|
20
|
+
schedule:
|
|
21
|
+
interval: weekly
|
|
22
|
+
day: monday
|
|
23
|
+
time: "14:00"
|
|
24
|
+
open-pull-requests-limit: 5
|
|
25
|
+
cooldown:
|
|
26
|
+
default-days: 4
|
|
27
|
+
|
|
28
|
+
- package-ecosystem: github-actions
|
|
29
|
+
directory: /
|
|
30
|
+
schedule:
|
|
31
|
+
interval: weekly
|
|
32
|
+
day: monday
|
|
33
|
+
time: "14:00"
|
|
34
|
+
open-pull-requests-limit: 5
|
|
35
|
+
cooldown:
|
|
36
|
+
default-days: 4
|
|
37
|
+
|
|
38
|
+
- package-ecosystem: npm
|
|
39
|
+
directory: /
|
|
40
|
+
schedule:
|
|
41
|
+
interval: weekly
|
|
42
|
+
day: monday
|
|
43
|
+
time: "14:00"
|
|
44
|
+
open-pull-requests-limit: 5
|
|
45
|
+
cooldown:
|
|
46
|
+
default-days: 4
|
|
47
|
+
|
|
48
|
+
- package-ecosystem: gitsubmodule
|
|
49
|
+
directory: /
|
|
50
|
+
schedule:
|
|
51
|
+
interval: weekly
|
|
52
|
+
day: monday
|
|
53
|
+
time: "14:00"
|
|
54
|
+
open-pull-requests-limit: 2
|
|
55
|
+
cooldown:
|
|
56
|
+
default-days: 4
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
<!-- Explain the problem and the chosen solution. -->
|
|
4
|
+
|
|
5
|
+
## Validation
|
|
6
|
+
|
|
7
|
+
<!-- List tests, compatibility checks, and benchmarks that actually ran. -->
|
|
8
|
+
|
|
9
|
+
- [ ] `scripts/check`
|
|
10
|
+
- [ ] User-visible changes are documented in `CHANGELOG.md`
|
|
11
|
+
- [ ] Public API changes include docs and type hints
|
|
12
|
+
- [ ] Performance-sensitive changes include a same-machine comparison
|
|
13
|
+
- [ ] No licensed or locally installed MMDB database is included
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
name: Artifacts
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
push:
|
|
7
|
+
branches: [main]
|
|
8
|
+
paths:
|
|
9
|
+
- Cargo.lock
|
|
10
|
+
- Cargo.toml
|
|
11
|
+
- LICENSE
|
|
12
|
+
- maxminddb_polars/**
|
|
13
|
+
- pyproject.toml
|
|
14
|
+
- scripts/inspect_artifacts.py
|
|
15
|
+
- src/**
|
|
16
|
+
- uv.lock
|
|
17
|
+
- .github/workflows/artifacts.yml
|
|
18
|
+
pull_request:
|
|
19
|
+
paths:
|
|
20
|
+
- Cargo.lock
|
|
21
|
+
- Cargo.toml
|
|
22
|
+
- LICENSE
|
|
23
|
+
- maxminddb_polars/**
|
|
24
|
+
- pyproject.toml
|
|
25
|
+
- scripts/inspect_artifacts.py
|
|
26
|
+
- src/**
|
|
27
|
+
- uv.lock
|
|
28
|
+
- .github/workflows/artifacts.yml
|
|
29
|
+
|
|
30
|
+
permissions:
|
|
31
|
+
contents: read
|
|
32
|
+
|
|
33
|
+
concurrency:
|
|
34
|
+
group: artifacts-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
35
|
+
cancel-in-progress: ${{ github.event_name != 'release' }}
|
|
36
|
+
|
|
37
|
+
jobs:
|
|
38
|
+
wheels:
|
|
39
|
+
name: Wheel (${{ matrix.platform }})
|
|
40
|
+
runs-on: ${{ matrix.os }}
|
|
41
|
+
timeout-minutes: 75
|
|
42
|
+
strategy:
|
|
43
|
+
fail-fast: false
|
|
44
|
+
matrix:
|
|
45
|
+
include:
|
|
46
|
+
- platform: manylinux-x86_64
|
|
47
|
+
os: ubuntu-latest
|
|
48
|
+
target: x86_64
|
|
49
|
+
manylinux: auto
|
|
50
|
+
smoke: true
|
|
51
|
+
- platform: manylinux-aarch64
|
|
52
|
+
os: ubuntu-latest
|
|
53
|
+
target: aarch64
|
|
54
|
+
manylinux: auto
|
|
55
|
+
smoke: false
|
|
56
|
+
- platform: musllinux-x86_64
|
|
57
|
+
os: ubuntu-latest
|
|
58
|
+
target: x86_64
|
|
59
|
+
manylinux: musllinux_1_2
|
|
60
|
+
smoke: false
|
|
61
|
+
- platform: musllinux-aarch64
|
|
62
|
+
os: ubuntu-latest
|
|
63
|
+
target: aarch64
|
|
64
|
+
manylinux: musllinux_1_2
|
|
65
|
+
smoke: false
|
|
66
|
+
- platform: macos-x86_64
|
|
67
|
+
os: macos-15-intel
|
|
68
|
+
target: x86_64
|
|
69
|
+
manylinux: auto
|
|
70
|
+
smoke: true
|
|
71
|
+
- platform: macos-aarch64
|
|
72
|
+
os: macos-latest
|
|
73
|
+
target: aarch64
|
|
74
|
+
manylinux: auto
|
|
75
|
+
smoke: true
|
|
76
|
+
- platform: windows-x86_64
|
|
77
|
+
os: windows-latest
|
|
78
|
+
target: x64
|
|
79
|
+
manylinux: auto
|
|
80
|
+
smoke: true
|
|
81
|
+
steps:
|
|
82
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
83
|
+
with:
|
|
84
|
+
persist-credentials: false
|
|
85
|
+
submodules: recursive
|
|
86
|
+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
87
|
+
with:
|
|
88
|
+
python-version: "3.13"
|
|
89
|
+
- uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0
|
|
90
|
+
if: runner.os == 'Linux' && matrix.target == 'aarch64'
|
|
91
|
+
with:
|
|
92
|
+
platforms: arm64
|
|
93
|
+
- uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
94
|
+
with:
|
|
95
|
+
target: ${{ matrix.target }}
|
|
96
|
+
manylinux: ${{ matrix.manylinux }}
|
|
97
|
+
args: --release --locked --out dist
|
|
98
|
+
- name: Smoke-test native wheel
|
|
99
|
+
if: matrix.smoke
|
|
100
|
+
shell: bash
|
|
101
|
+
run: |
|
|
102
|
+
python -m pip install "polars>=1.43.2,<1.44"
|
|
103
|
+
python - <<'PY'
|
|
104
|
+
import glob
|
|
105
|
+
import subprocess
|
|
106
|
+
import sys
|
|
107
|
+
|
|
108
|
+
subprocess.check_call(
|
|
109
|
+
[
|
|
110
|
+
sys.executable,
|
|
111
|
+
"-m",
|
|
112
|
+
"pip",
|
|
113
|
+
"install",
|
|
114
|
+
"--no-index",
|
|
115
|
+
"--no-deps",
|
|
116
|
+
*glob.glob("dist/*.whl"),
|
|
117
|
+
]
|
|
118
|
+
)
|
|
119
|
+
PY
|
|
120
|
+
test_directory=$(mktemp -d)
|
|
121
|
+
cd "$test_directory"
|
|
122
|
+
python - <<'PY'
|
|
123
|
+
import importlib.metadata
|
|
124
|
+
import os
|
|
125
|
+
from pathlib import Path
|
|
126
|
+
|
|
127
|
+
import polars as pl
|
|
128
|
+
|
|
129
|
+
from maxminddb_polars import _maxminddb_polars
|
|
130
|
+
from maxminddb_polars import lookup_path
|
|
131
|
+
|
|
132
|
+
database = Path(os.environ["GITHUB_WORKSPACE"]) / "tests/data/test-data/GeoIP2-City-Test.mmdb"
|
|
133
|
+
result = pl.DataFrame({"ip": ["89.160.20.128"]}).lazy().select(
|
|
134
|
+
lookup_path("ip", database, ["country", "iso_code"]).alias("country")
|
|
135
|
+
).collect()
|
|
136
|
+
assert result.to_dict(as_series=False) == {"country": ["SE"]}
|
|
137
|
+
assert _maxminddb_polars.__version__ == importlib.metadata.version("maxminddb-polars")
|
|
138
|
+
PY
|
|
139
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
140
|
+
with:
|
|
141
|
+
name: wheel-${{ matrix.platform }}
|
|
142
|
+
path: dist/*.whl
|
|
143
|
+
if-no-files-found: error
|
|
144
|
+
retention-days: 30
|
|
145
|
+
|
|
146
|
+
abi3:
|
|
147
|
+
name: abi3 / Python ${{ matrix.python }} / Polars ${{ matrix.polars }}
|
|
148
|
+
needs: wheels
|
|
149
|
+
runs-on: ubuntu-latest
|
|
150
|
+
timeout-minutes: 15
|
|
151
|
+
strategy:
|
|
152
|
+
fail-fast: false
|
|
153
|
+
matrix:
|
|
154
|
+
include:
|
|
155
|
+
- python: "3.10"
|
|
156
|
+
polars: "1.43.2"
|
|
157
|
+
- python: "3.14"
|
|
158
|
+
polars: "1.43.2"
|
|
159
|
+
steps:
|
|
160
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
161
|
+
with:
|
|
162
|
+
persist-credentials: false
|
|
163
|
+
submodules: recursive
|
|
164
|
+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
165
|
+
with:
|
|
166
|
+
python-version: ${{ matrix.python }}
|
|
167
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
168
|
+
with:
|
|
169
|
+
name: wheel-manylinux-x86_64
|
|
170
|
+
path: dist
|
|
171
|
+
- name: Install exact wheel
|
|
172
|
+
env:
|
|
173
|
+
POLARS_VERSION: ${{ matrix.polars }}
|
|
174
|
+
shell: bash
|
|
175
|
+
run: |
|
|
176
|
+
python -m pip install "polars==$POLARS_VERSION"
|
|
177
|
+
python -m pip install --no-index --no-deps dist/*.whl
|
|
178
|
+
- name: Smoke-test abi3 wheel
|
|
179
|
+
shell: bash
|
|
180
|
+
run: |
|
|
181
|
+
test_directory=$(mktemp -d)
|
|
182
|
+
cd "$test_directory"
|
|
183
|
+
python - <<'PY'
|
|
184
|
+
import importlib.metadata
|
|
185
|
+
import os
|
|
186
|
+
from pathlib import Path
|
|
187
|
+
|
|
188
|
+
import polars as pl
|
|
189
|
+
|
|
190
|
+
from maxminddb_polars import _maxminddb_polars
|
|
191
|
+
from maxminddb_polars import lookup
|
|
192
|
+
|
|
193
|
+
database = Path(os.environ["GITHUB_WORKSPACE"]) / "tests/data/test-data/GeoLite2-ASN-Test.mmdb"
|
|
194
|
+
result = pl.DataFrame({"ip": ["1.0.0.0"]}).lazy().select(
|
|
195
|
+
lookup("ip", database).alias("record")
|
|
196
|
+
).collect(engine="streaming")
|
|
197
|
+
assert result["record"].struct.field("autonomous_system_number").item() == 15169
|
|
198
|
+
assert _maxminddb_polars.__version__ == importlib.metadata.version("maxminddb-polars")
|
|
199
|
+
PY
|
|
200
|
+
|
|
201
|
+
sdist:
|
|
202
|
+
name: Source distribution
|
|
203
|
+
runs-on: ubuntu-latest
|
|
204
|
+
timeout-minutes: 20
|
|
205
|
+
steps:
|
|
206
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
207
|
+
with:
|
|
208
|
+
persist-credentials: false
|
|
209
|
+
submodules: recursive
|
|
210
|
+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
211
|
+
with:
|
|
212
|
+
python-version: "3.13"
|
|
213
|
+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
214
|
+
- run: uv sync --all-extras --locked --no-install-project
|
|
215
|
+
- run: uv run --no-sync maturin sdist --out dist
|
|
216
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
217
|
+
with:
|
|
218
|
+
name: sdist
|
|
219
|
+
path: dist/*.tar.gz
|
|
220
|
+
if-no-files-found: error
|
|
221
|
+
retention-days: 30
|
|
222
|
+
|
|
223
|
+
validate:
|
|
224
|
+
name: Validate distributions
|
|
225
|
+
needs: [wheels, abi3, sdist]
|
|
226
|
+
runs-on: ubuntu-latest
|
|
227
|
+
timeout-minutes: 20
|
|
228
|
+
steps:
|
|
229
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
230
|
+
with:
|
|
231
|
+
persist-credentials: false
|
|
232
|
+
submodules: recursive
|
|
233
|
+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
234
|
+
with:
|
|
235
|
+
python-version: "3.13"
|
|
236
|
+
- uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # master
|
|
237
|
+
with:
|
|
238
|
+
toolchain: stable
|
|
239
|
+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
240
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
241
|
+
with:
|
|
242
|
+
pattern: wheel-*
|
|
243
|
+
path: dist
|
|
244
|
+
merge-multiple: true
|
|
245
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
246
|
+
with:
|
|
247
|
+
name: sdist
|
|
248
|
+
path: dist
|
|
249
|
+
- run: python scripts/inspect_artifacts.py dist/*
|
|
250
|
+
- name: Verify locked source state
|
|
251
|
+
run: |
|
|
252
|
+
cargo metadata --locked --format-version 1 --no-deps >/dev/null
|
|
253
|
+
uv lock --check
|
|
254
|
+
test "$(git -C tests/data rev-parse HEAD)" = "e1120013c4b5cbc830b958b2b7e73fba444d316d"
|
|
255
|
+
git diff --exit-code
|
|
256
|
+
- run: python -m pip install twine==6.2.0
|
|
257
|
+
- run: python -m twine check --strict dist/*
|
|
258
|
+
- name: Build and smoke-test from sdist
|
|
259
|
+
shell: bash
|
|
260
|
+
run: |
|
|
261
|
+
python -m pip install "polars>=1.43.2,<1.44"
|
|
262
|
+
python -m pip wheel --no-deps --wheel-dir sdist-wheel dist/*.tar.gz
|
|
263
|
+
python scripts/inspect_artifacts.py sdist-wheel/*.whl
|
|
264
|
+
python -m pip install --no-index --no-deps sdist-wheel/*.whl
|
|
265
|
+
test_directory=$(mktemp -d)
|
|
266
|
+
cd "$test_directory"
|
|
267
|
+
python - <<'PY'
|
|
268
|
+
import importlib.metadata
|
|
269
|
+
import os
|
|
270
|
+
from pathlib import Path
|
|
271
|
+
|
|
272
|
+
import polars as pl
|
|
273
|
+
|
|
274
|
+
from maxminddb_polars import _maxminddb_polars
|
|
275
|
+
from maxminddb_polars import lookup_path
|
|
276
|
+
|
|
277
|
+
database = Path(os.environ["GITHUB_WORKSPACE"]) / "tests/data/test-data/GeoIP2-City-Test.mmdb"
|
|
278
|
+
result = pl.DataFrame({"ip": ["89.160.20.128"]}).select(
|
|
279
|
+
lookup_path("ip", database, ["country", "iso_code"]).alias("country")
|
|
280
|
+
)
|
|
281
|
+
assert result.to_dict(as_series=False) == {"country": ["SE"]}
|
|
282
|
+
assert _maxminddb_polars.__version__ == importlib.metadata.version("maxminddb-polars")
|
|
283
|
+
PY
|
|
284
|
+
- name: Write checksums
|
|
285
|
+
run: sha256sum dist/* >SHA256SUMS
|
|
286
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
287
|
+
with:
|
|
288
|
+
name: publishable-distributions
|
|
289
|
+
path: dist/*
|
|
290
|
+
if-no-files-found: error
|
|
291
|
+
retention-days: 30
|
|
292
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
293
|
+
with:
|
|
294
|
+
name: distribution-checksums
|
|
295
|
+
path: SHA256SUMS
|
|
296
|
+
if-no-files-found: error
|
|
297
|
+
retention-days: 30
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: Dependency audit
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
paths:
|
|
8
|
+
- .cargo/audit.toml
|
|
9
|
+
- Cargo.lock
|
|
10
|
+
- Cargo.toml
|
|
11
|
+
- fuzz/Cargo.lock
|
|
12
|
+
- pyproject.toml
|
|
13
|
+
- uv.lock
|
|
14
|
+
- .github/workflows/audit.yml
|
|
15
|
+
schedule:
|
|
16
|
+
- cron: "43 14 * * *"
|
|
17
|
+
|
|
18
|
+
permissions:
|
|
19
|
+
contents: read
|
|
20
|
+
|
|
21
|
+
concurrency:
|
|
22
|
+
group: audit-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
23
|
+
cancel-in-progress: true
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
rust:
|
|
27
|
+
name: Cargo audit
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
timeout-minutes: 20
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
32
|
+
with:
|
|
33
|
+
persist-credentials: false
|
|
34
|
+
- uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # master
|
|
35
|
+
with:
|
|
36
|
+
toolchain: stable
|
|
37
|
+
- run: cargo install cargo-audit --version 0.22.2 --locked
|
|
38
|
+
- run: cargo audit --deny warnings
|
|
39
|
+
- run: cargo audit --deny warnings --file fuzz/Cargo.lock
|
|
40
|
+
|
|
41
|
+
python:
|
|
42
|
+
name: Python audit
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
timeout-minutes: 15
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
47
|
+
with:
|
|
48
|
+
persist-credentials: false
|
|
49
|
+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
50
|
+
- run: uv export --locked --no-dev --no-emit-project --format requirements-txt --output-file requirements.txt
|
|
51
|
+
- run: uvx pip-audit==2.10.1 --strict --requirement requirements.txt
|
|
52
|
+
|
|
53
|
+
dependency-review:
|
|
54
|
+
name: Dependency review
|
|
55
|
+
if: github.event_name == 'pull_request'
|
|
56
|
+
runs-on: ubuntu-latest
|
|
57
|
+
timeout-minutes: 10
|
|
58
|
+
permissions:
|
|
59
|
+
contents: read
|
|
60
|
+
steps:
|
|
61
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
62
|
+
with:
|
|
63
|
+
persist-credentials: false
|
|
64
|
+
- uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
name: Benchmark
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
rows:
|
|
7
|
+
description: Rows per sample
|
|
8
|
+
required: true
|
|
9
|
+
default: "500000"
|
|
10
|
+
repeats:
|
|
11
|
+
description: Measured samples
|
|
12
|
+
required: true
|
|
13
|
+
default: "7"
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
concurrency:
|
|
19
|
+
group: benchmark-${{ github.ref }}
|
|
20
|
+
cancel-in-progress: true
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
lookups:
|
|
24
|
+
name: Lookup benchmark
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
timeout-minutes: 45
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
29
|
+
with:
|
|
30
|
+
fetch-depth: 0
|
|
31
|
+
persist-credentials: false
|
|
32
|
+
submodules: recursive
|
|
33
|
+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
34
|
+
with:
|
|
35
|
+
python-version: "3.13"
|
|
36
|
+
- uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # master
|
|
37
|
+
with:
|
|
38
|
+
toolchain: stable
|
|
39
|
+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
40
|
+
- run: uv sync --all-extras --locked --no-install-project
|
|
41
|
+
- run: uv run --no-sync maturin develop
|
|
42
|
+
- name: Run benchmark
|
|
43
|
+
env:
|
|
44
|
+
BENCHMARK_REPEATS: ${{ inputs.repeats }}
|
|
45
|
+
BENCHMARK_ROWS: ${{ inputs.rows }}
|
|
46
|
+
run: >-
|
|
47
|
+
uv run --no-sync python benchmarks/lookups.py
|
|
48
|
+
--rows "$BENCHMARK_ROWS"
|
|
49
|
+
--repeats "$BENCHMARK_REPEATS"
|
|
50
|
+
--json benchmark-results.json
|
|
51
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
52
|
+
if: always()
|
|
53
|
+
with:
|
|
54
|
+
name: benchmark-results
|
|
55
|
+
path: benchmark-results.json
|
|
56
|
+
if-no-files-found: error
|
|
57
|
+
retention-days: 30
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: CodeQL
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
schedule:
|
|
8
|
+
- cron: "59 18 * * 0"
|
|
9
|
+
|
|
10
|
+
permissions: {}
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: codeql-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
analyze:
|
|
18
|
+
name: Analyze Rust and Python
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
timeout-minutes: 60
|
|
21
|
+
permissions:
|
|
22
|
+
# Upload CodeQL results to the repository's code-scanning service.
|
|
23
|
+
security-events: write
|
|
24
|
+
contents: read
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
27
|
+
with:
|
|
28
|
+
persist-credentials: false
|
|
29
|
+
submodules: recursive
|
|
30
|
+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
31
|
+
with:
|
|
32
|
+
python-version: "3.13"
|
|
33
|
+
- uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # master
|
|
34
|
+
with:
|
|
35
|
+
toolchain: stable
|
|
36
|
+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
37
|
+
- uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
|
|
38
|
+
with:
|
|
39
|
+
languages: python, rust
|
|
40
|
+
- run: uv sync --all-extras --locked --no-install-project
|
|
41
|
+
- run: uv run --no-sync maturin build --release --locked
|
|
42
|
+
- uses: github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name: Compatibility
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
schedule:
|
|
6
|
+
- cron: "31 16 1 * *"
|
|
7
|
+
pull_request:
|
|
8
|
+
paths:
|
|
9
|
+
- Cargo.lock
|
|
10
|
+
- Cargo.toml
|
|
11
|
+
- pyproject.toml
|
|
12
|
+
- uv.lock
|
|
13
|
+
- .github/workflows/compatibility.yml
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
concurrency:
|
|
19
|
+
group: compatibility-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
20
|
+
cancel-in-progress: true
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
supported:
|
|
24
|
+
name: Python ${{ matrix.python }} / Polars ${{ matrix.polars }}
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
timeout-minutes: 45
|
|
27
|
+
env:
|
|
28
|
+
POLARS_VERSION: ${{ matrix.polars }}
|
|
29
|
+
PYTHON_VERSION: ${{ matrix.python }}
|
|
30
|
+
strategy:
|
|
31
|
+
fail-fast: false
|
|
32
|
+
matrix:
|
|
33
|
+
include:
|
|
34
|
+
- python: "3.10"
|
|
35
|
+
polars: "1.43.2"
|
|
36
|
+
- python: "3.11"
|
|
37
|
+
polars: "1.43.2"
|
|
38
|
+
- python: "3.12"
|
|
39
|
+
polars: "1.43.2"
|
|
40
|
+
- python: "3.13"
|
|
41
|
+
polars: "1.43.2"
|
|
42
|
+
- python: "3.14"
|
|
43
|
+
polars: "1.43.2"
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
46
|
+
with:
|
|
47
|
+
persist-credentials: false
|
|
48
|
+
submodules: recursive
|
|
49
|
+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
50
|
+
with:
|
|
51
|
+
python-version: ${{ matrix.python }}
|
|
52
|
+
- uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # master
|
|
53
|
+
with:
|
|
54
|
+
toolchain: stable
|
|
55
|
+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
56
|
+
- run: >-
|
|
57
|
+
uv sync --python "$PYTHON_VERSION" --all-extras --locked
|
|
58
|
+
--no-install-project
|
|
59
|
+
- run: uv pip install --python .venv/bin/python "polars==$POLARS_VERSION"
|
|
60
|
+
- run: uv run --no-sync maturin develop
|
|
61
|
+
- run: uv run --no-sync pytest
|