Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/clang-analyzer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@ jobs:
python-version: 3.13

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
run: python -m pip install uv

- name: Build and run analyzer
# We exclude extension/libmaxminddb/ as libmaxminddb has its own workflow
# for this and we are not able to correct any issues with that code here.
run: scan-build --exclude extension/libmaxminddb/ --status-bugs python setup.py build
run: scan-build --exclude extension/libmaxminddb/ --status-bugs uv build
env:
CFLAGS: "-Werror -Wall -Wextra"
MAXMINDDB_REQUIRE_EXTENSION: 1
6 changes: 2 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@ jobs:
# uses a compiled language

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
run: python -m pip install uv

- run: python setup.py build
- run: uv build
env:
MAXMINDDB_REQUIRE_EXTENSION: 1

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-libmaxminddb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools tox tox-gh-actions wheel
pip install setuptools tox tox-gh-actions uv wheel


- name: Install libmaxminddb
Expand All @@ -58,7 +58,7 @@ jobs:
echo "LDFLAGS=-L/opt/homebrew/lib" >> "$GITHUB_ENV"

- name: Build with Werror and Wall
run: python setup.py build
run: uv build
env:
CFLAGS: "${{ env.CFLAGS }} -Werror -Wall -Wextra"

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.so
*.sw?
*~
.clangd
.coverage
.eggs
.idea
Expand Down
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ History
* The vendored ``libmaxminddb`` has been updated to 1.12.2.
* The C extension now checks that the database metadata lookup was
successful.
* A theoretical segmentation fault with the C extension when doing lookups
on a corrupt or invalid database was fixed.

2.6.3 (2025-01-09)
++++++++++++++++++
Expand Down
10 changes: 2 additions & 8 deletions extension/maxminddb.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,10 +751,7 @@ static PyObject *from_map(MMDB_entry_data_list_s **entry_data_list) {
const uint32_t map_size = (*entry_data_list)->entry_data.data_size;

uint32_t i;
// entry_data_list cannot start out NULL (see from_entry_data_list). We
// check it in the loop because it may become NULL.
// coverity[check_after_deref]
for (i = 0; i < map_size && entry_data_list; i++) {
for (i = 0; i < map_size && *entry_data_list; i++) {
*entry_data_list = (*entry_data_list)->next;

PyObject *key = PyUnicode_FromStringAndSize(
Expand Down Expand Up @@ -792,10 +789,7 @@ static PyObject *from_array(MMDB_entry_data_list_s **entry_data_list) {
}

uint32_t i;
// entry_data_list cannot start out NULL (see from_entry_data_list). We
// check it in the loop because it may become NULL.
// coverity[check_after_deref]
for (i = 0; i < size && entry_data_list; i++) {
for (i = 0; i < size && *entry_data_list; i++) {
*entry_data_list = (*entry_data_list)->next;
PyObject *value = from_entry_data_list(entry_data_list);
if (value == NULL) {
Expand Down
15 changes: 9 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[build-system]
requires = ["setuptools>=68.2.2", "setuptools-scm", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "maxminddb"
version = "2.6.3"
Expand All @@ -11,13 +7,12 @@ authors = [
]
requires-python = ">=3.9"
readme = "README.rst"
license = {text = "Apache License, Version 2.0"}
license = "Apache-2.0"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
Expand Down Expand Up @@ -46,6 +41,14 @@ lint = [
"ruff>=0.11.6",
]

[build-system]
requires = [
"setuptools>=77.0.3",
"setuptools-scm",
"wheel",
]
build-backend = "setuptools.build_meta"

[tool.setuptools.package-data]
maxminddb = ["py.typed"]

Expand Down
Loading