diff -Nru python-maxminddb-2.2.0/debian/changelog python-maxminddb-2.4.0/debian/changelog --- python-maxminddb-2.2.0/debian/changelog 2023-03-01 00:37:19.000000000 +0000 +++ python-maxminddb-2.4.0/debian/changelog 2023-07-13 23:52:00.000000000 +0000 @@ -1,8 +1,10 @@ -python-maxminddb (2.2.0-1build1) lunar; urgency=medium +python-maxminddb (2.4.0-1) unstable; urgency=medium - * Rebuild to drop Python 3.10 extension + * New upstream release. + - Drop backported patch avoid-distutils. + * Update copyright years. - -- Jeremy Bicha Tue, 28 Feb 2023 19:37:19 -0500 + -- Faidon Liambotis Fri, 14 Jul 2023 02:52:00 +0300 python-maxminddb (2.2.0-1) unstable; urgency=medium diff -Nru python-maxminddb-2.2.0/debian/copyright python-maxminddb-2.4.0/debian/copyright --- python-maxminddb-2.2.0/debian/copyright 2023-01-16 09:27:42.000000000 +0000 +++ python-maxminddb-2.4.0/debian/copyright 2023-07-13 23:51:43.000000000 +0000 @@ -3,11 +3,11 @@ Source: https://github.com/maxmind/MaxMind-DB-Reader-python Files: * -Copyright: 2013-2021 MaxMind, Inc. +Copyright: 2013-2023 MaxMind, Inc. License: Apache-2.0 Files: tests/data/* -Copyright: 2013-2021 MaxMind, Inc. +Copyright: 2013-2023 MaxMind, Inc. License: CC-BY-SA-3.0-Unported Files: debian/* diff -Nru python-maxminddb-2.2.0/debian/patches/avoid-distutils python-maxminddb-2.4.0/debian/patches/avoid-distutils --- python-maxminddb-2.2.0/debian/patches/avoid-distutils 2023-01-16 09:27:42.000000000 +0000 +++ python-maxminddb-2.4.0/debian/patches/avoid-distutils 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -From: Gregory Oschwald -Date: Tue, 7 Dec 2021 14:22:04 -0800 -Subject: Do not use distutils - -Origin: upstream, https://github.com/maxmind/MaxMind-DB-Reader-python/commit/4ddd4ca604ab0f78f763664b76d7d0eebfdbe6a8 -Bug-Debian: https://bugs.debian.org/1022449 ---- - setup.py | 14 +++++++++++--- - 1 file changed, 11 insertions(+), 3 deletions(-) - -diff --git a/setup.py b/setup.py -index 40c1ea0..9cd33b5 100644 ---- a/setup.py -+++ b/setup.py -@@ -5,10 +5,18 @@ import sys - # This import is apparently needed for Nose on Red Hat's Python - import multiprocessing - --from distutils.command.build_ext import build_ext --from distutils.errors import CCompilerError, DistutilsExecError, DistutilsPlatformError -- - from setuptools import setup, Extension -+from setuptools.command.build_ext import build_ext -+ -+# These were only added to setuptools in 59.0.1. -+try: -+ from setuptools.errors import CCompilerError -+ from setuptools.errors import DistutilsExecError -+ from setuptools.errors import DistutilsPlatformError -+except ImportError: -+ from distutils.errors import CCompilerError -+ from distutils.errors import DistutilsExecError -+ from distutils.errors import DistutilsPlatformError - - cmdclass = {} - PYPY = hasattr(sys, "pypy_version_info") diff -Nru python-maxminddb-2.2.0/debian/patches/series python-maxminddb-2.4.0/debian/patches/series --- python-maxminddb-2.2.0/debian/patches/series 2023-01-11 04:52:36.000000000 +0000 +++ python-maxminddb-2.4.0/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -avoid-distutils diff -Nru python-maxminddb-2.2.0/dev-bin/release.sh python-maxminddb-2.4.0/dev-bin/release.sh --- python-maxminddb-2.2.0/dev-bin/release.sh 2021-09-24 17:10:12.000000000 +0000 +++ python-maxminddb-2.4.0/dev-bin/release.sh 2023-06-28 15:53:29.000000000 +0000 @@ -53,18 +53,17 @@ exit 1 fi -git commit -m "Update for $tag" -a +if [ -n "$(git status --porcelain)" ]; then + git commit -m "Update for $tag" -a +fi git push -message="$version - -$notes" - -hub release create -m "$message" "$tag" +gh release create --target "$(git branch --show-current)" -t "$version" -n "$notes" "$tag" git push --tags -rm -fr dist -python setup.py build_html sdist +rm -fr build dist +python -m sphinx -M html ./docs ./build/sphinx -W +python setup.py sdist twine upload dist/* diff -Nru python-maxminddb-2.2.0/docs/conf.py python-maxminddb-2.4.0/docs/conf.py --- python-maxminddb-2.2.0/docs/conf.py 2021-09-24 17:10:12.000000000 +0000 +++ python-maxminddb-2.4.0/docs/conf.py 2023-06-28 15:53:29.000000000 +0000 @@ -53,7 +53,7 @@ # General information about the project. project = "maxminddb" -copyright = "2013-2021, MaxMind, Inc." +copyright = "2013-2023, MaxMind, Inc." # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -131,7 +131,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] +# html_static_path = ["_static"] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. @@ -250,4 +250,6 @@ # texinfo_show_urls = 'footnote' # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {"http://docs.python.org/": None} +intersphinx_mapping = { + "python": ("https://python.readthedocs.org/en/latest/", None), +} diff -Nru python-maxminddb-2.2.0/docs/index.rst python-maxminddb-2.4.0/docs/index.rst --- python-maxminddb-2.2.0/docs/index.rst 2021-09-24 17:10:12.000000000 +0000 +++ python-maxminddb-2.4.0/docs/index.rst 2023-06-28 15:53:29.000000000 +0000 @@ -35,6 +35,6 @@ * :ref:`modindex` * :ref:`search` -:copyright: (c) 2013-2021 by MaxMind, Inc. +:copyright: (c) 2013-2023 by MaxMind, Inc. :license: Apache License, Version 2.0 diff -Nru python-maxminddb-2.2.0/extension/maxminddb.c python-maxminddb-2.4.0/extension/maxminddb.c --- python-maxminddb-2.2.0/extension/maxminddb.c 2021-09-24 17:10:12.000000000 +0000 +++ python-maxminddb-2.4.0/extension/maxminddb.c 2023-06-28 15:53:29.000000000 +0000 @@ -99,8 +99,7 @@ return -1; } - uint16_t status = MMDB_open(filename, MMDB_MODE_MMAP, mmdb); - Py_XDECREF(filepath); + int const status = MMDB_open(filename, MMDB_MODE_MMAP, mmdb); if (MMDB_SUCCESS != status) { free(mmdb); @@ -108,9 +107,12 @@ "Error opening database file (%s). Is this a valid " "MaxMind DB file?", filename); + Py_XDECREF(filepath); return -1; } + Py_XDECREF(filepath); + mmdb_obj->mmdb = mmdb; mmdb_obj->closed = Py_False; return 0; @@ -276,14 +278,14 @@ case 16: { ip_address->ss_family = AF_INET6; struct sockaddr_in6 *sin = (struct sockaddr_in6 *)ip_address; - memcpy(sin->sin6_addr.s6_addr, bytes, len); + memcpy(sin->sin6_addr.s6_addr, bytes, (size_t)len); Py_DECREF(packed); return 1; } case 4: { ip_address->ss_family = AF_INET; struct sockaddr_in *sin = (struct sockaddr_in *)ip_address; - memcpy(&(sin->sin_addr.s_addr), bytes, len); + memcpy(&(sin->sin_addr.s_addr), bytes, (size_t)len); Py_DECREF(packed); return 1; } @@ -526,7 +528,7 @@ *entry_data_list = (*entry_data_list)->next; PyObject *key = PyUnicode_FromStringAndSize( - (char *)(*entry_data_list)->entry_data.utf8_string, + (*entry_data_list)->entry_data.utf8_string, (*entry_data_list)->entry_data.data_size); if (!key) { // PyUnicode_FromStringAndSize will set an appropriate exception @@ -737,6 +739,7 @@ if (PyType_Ready(&Metadata_Type)) { return NULL; } + Py_INCREF(&Metadata_Type); PyModule_AddObject(m, "Metadata", (PyObject *)&Metadata_Type); PyObject *error_mod = PyImport_ImportModule("maxminddb.errors"); diff -Nru python-maxminddb-2.2.0/.github/dependabot.yml python-maxminddb-2.4.0/.github/dependabot.yml --- python-maxminddb-2.2.0/.github/dependabot.yml 2021-09-24 17:10:12.000000000 +0000 +++ python-maxminddb-2.4.0/.github/dependabot.yml 2023-06-28 15:53:29.000000000 +0000 @@ -5,3 +5,7 @@ schedule: interval: daily open-pull-requests-limit: 10 +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: daily diff -Nru python-maxminddb-2.2.0/.github/workflows/address-sanitizer.yml python-maxminddb-2.4.0/.github/workflows/address-sanitizer.yml --- python-maxminddb-2.2.0/.github/workflows/address-sanitizer.yml 1970-01-01 00:00:00.000000000 +0000 +++ python-maxminddb-2.4.0/.github/workflows/address-sanitizer.yml 2023-06-28 15:53:29.000000000 +0000 @@ -0,0 +1,38 @@ +name: Run Address Sanitizer +on: + push: + pull_request: + schedule: + - cron: '13 15 * * SUN' +jobs: + build: + name: Address Sanitizer + runs-on: ubuntu-latest + env: + ASAN_OPTIONS: strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:detect_invalid_pointer_pairs=2:detect_leaks=0 + CC: clang + CFLAGS: -fsanitize=address -Wall -Wextra -Wpedantic -Wformat=2 -Walloca -Wvla -Wimplicit-fallthrough -Wcast-qual -Wconversion -Wshadow -Wundef -Wstrict-prototypes -Wswitch-enum -fstack-protector -D_FORTIFY_SOURCE=2 -Werror + LDFLAGS: -fsanitize=address + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: true + + - name: Install libmaxminddb + run: sudo apt install libmaxminddb-dev + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox tox-gh-actions + + - name: Test with tox + run: MM_FORCE_EXT_TESTS=1 tox + env: + LD_PRELOAD: libasan.so.6 diff -Nru python-maxminddb-2.2.0/.github/workflows/clang-analyzer.yml python-maxminddb-2.4.0/.github/workflows/clang-analyzer.yml --- python-maxminddb-2.2.0/.github/workflows/clang-analyzer.yml 2021-09-24 17:10:12.000000000 +0000 +++ python-maxminddb-2.4.0/.github/workflows/clang-analyzer.yml 2023-06-28 15:53:29.000000000 +0000 @@ -12,15 +12,15 @@ runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install libmaxminddb run: sudo apt install clang-tools libmaxminddb-dev - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: - python-version: 3.x + python-version: 3.11 - name: Build and run analyzer run: CFLAGS="-Werror -Wall -Wextra" scan-build --status-bugs python setup.py build diff -Nru python-maxminddb-2.2.0/.github/workflows/codeql-analysis.yml python-maxminddb-2.4.0/.github/workflows/codeql-analysis.yml --- python-maxminddb-2.2.0/.github/workflows/codeql-analysis.yml 2021-09-24 17:10:12.000000000 +0000 +++ python-maxminddb-2.4.0/.github/workflows/codeql-analysis.yml 2023-06-28 15:53:29.000000000 +0000 @@ -2,6 +2,8 @@ on: push: + branches-ignore: + - 'dependabot/**' pull_request: schedule: - cron: '0 18 * * 0' @@ -13,7 +15,7 @@ steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: # We must fetch at least the immediate parents so that if this is # a pull request then we can checkout the head. @@ -26,7 +28,7 @@ # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 # Override language selection by uncommenting this and choosing your languages with: languages: python, cpp @@ -43,4 +45,4 @@ python setup.py build - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 diff -Nru python-maxminddb-2.2.0/.github/workflows/lint.yml python-maxminddb-2.4.0/.github/workflows/lint.yml --- python-maxminddb-2.2.0/.github/workflows/lint.yml 2021-09-24 17:10:12.000000000 +0000 +++ python-maxminddb-2.4.0/.github/workflows/lint.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -name: Python lint - -on: - push: - pull_request: - schedule: - - cron: '3 19 * * SUN' - -jobs: - build: - - name: Python linting - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install --upgrade pylint black mypy voluptuous-stubs types-maxminddb - - - name: Install - run: python setup.py install - - - name: Run mypy - run: mypy maxminddb tests - - - name: Run Pylint - run: pylint maxminddb - - - name: Run Black - run: black --check --diff . diff -Nru python-maxminddb-2.2.0/.github/workflows/test.yml python-maxminddb-2.4.0/.github/workflows/test.yml --- python-maxminddb-2.2.0/.github/workflows/test.yml 2021-09-24 17:10:12.000000000 +0000 +++ python-maxminddb-2.4.0/.github/workflows/test.yml 2023-06-28 15:53:29.000000000 +0000 @@ -14,14 +14,14 @@ # We don't test on Windows and macOS currently due to issues # build libmaxminddb there. platform: [ubuntu-latest] - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9, "3.10", 3.11] name: Python ${{ matrix.python-version }} on ${{ matrix.platform }} runs-on: ${{ matrix.platform }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true @@ -29,7 +29,7 @@ run: sudo apt install libmaxminddb-dev - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} diff -Nru python-maxminddb-2.2.0/.gitmodules python-maxminddb-2.4.0/.gitmodules --- python-maxminddb-2.2.0/.gitmodules 2021-09-24 17:10:12.000000000 +0000 +++ python-maxminddb-2.4.0/.gitmodules 2023-06-28 15:53:29.000000000 +0000 @@ -1,3 +1,3 @@ [submodule "tests/data"] path = tests/data - url = git://github.com/maxmind/MaxMind-DB.git + url = https://github.com/maxmind/MaxMind-DB diff -Nru python-maxminddb-2.2.0/HISTORY.rst python-maxminddb-2.4.0/HISTORY.rst --- python-maxminddb-2.2.0/HISTORY.rst 2021-09-24 17:10:12.000000000 +0000 +++ python-maxminddb-2.4.0/HISTORY.rst 2023-06-28 15:53:29.000000000 +0000 @@ -3,9 +3,36 @@ History ------- -2.1.1 +2.4.0 (2023-06-28) ++++++++++++++++++ +* Package metadata was migrated from ``setup.py`` to ``setup.cfg``. GitHub + #113. +* The C extension now decrements the reference count on an object + containing the database filename after its use in an error message rather + than before. Pull request by Lumír 'Frenzy' Balhar. GitHub #114. + +2.3.0 (2023-05-09) +++++++++++++++++++ + +* IMPORTANT: Python 3.7 or greater is required. If you are using an older + version, please use an earlier release. +* ``distutils`` is no longer used for building the C extension. +* Missing ``Py_INCREF`` was added to module initialization for the C + extension. Pull request by R. Christian McDonald. GitHub #106. + +2.2.0 (2021-09-24) +++++++++++++++++++ + +* The return type for ``maxminddb.open_database()`` has been simplified + to be just the ``Reader`` class as opposed to a union of that with + the extension class. This is done by casting the extension to + ``Reader``. The extension class has the same public API as the + pure Python implementation. This simplifies type checking for users of + this library. The ``Reader`` class is exposed as ``maxminddb.Reader``. + Pull request by wouter bolsterlee. GitHub #88. +* ``maxminddb.__all__`` is now set to define a public API. Pull request + by wouter bolsterlee. GitHub #88. * Fix minor regression in ``repr`` output of ``maxminddb.reader.Metadata`` in 2.1.0. diff -Nru python-maxminddb-2.2.0/maxminddb/decoder.py python-maxminddb-2.4.0/maxminddb/decoder.py --- python-maxminddb-2.2.0/maxminddb/decoder.py 2021-09-24 17:10:12.000000000 +0000 +++ python-maxminddb-2.4.0/maxminddb/decoder.py 2023-06-28 15:53:29.000000000 +0000 @@ -48,9 +48,7 @@ array.append(value) return array, offset - def _decode_boolean( # pylint: disable=no-self-use - self, size: int, offset: int - ) -> Tuple[bool, int]: + def _decode_boolean(self, size: int, offset: int) -> Tuple[bool, int]: return size != 0, offset def _decode_bytes(self, size: int, offset: int) -> Tuple[bytes, int]: diff -Nru python-maxminddb-2.2.0/maxminddb/__init__.py python-maxminddb-2.4.0/maxminddb/__init__.py --- python-maxminddb-2.2.0/maxminddb/__init__.py 2021-09-24 17:10:12.000000000 +0000 +++ python-maxminddb-2.4.0/maxminddb/__init__.py 2023-06-28 15:53:29.000000000 +0000 @@ -81,7 +81,7 @@ __title__ = "maxminddb" -__version__ = "2.1.0" +__version__ = "2.4.0" __author__ = "Gregory Oschwald" __license__ = "Apache License, Version 2.0" -__copyright__ = "Copyright 2013-2021 MaxMind, Inc." +__copyright__ = "Copyright 2013-2023 MaxMind, Inc." diff -Nru python-maxminddb-2.2.0/maxminddb/reader.py python-maxminddb-2.4.0/maxminddb/reader.py --- python-maxminddb-2.2.0/maxminddb/reader.py 2021-09-24 17:10:12.000000000 +0000 +++ python-maxminddb-2.4.0/maxminddb/reader.py 2023-06-28 15:53:29.000000000 +0000 @@ -64,8 +64,9 @@ filename = database elif mode == MODE_MEMORY: with open(database, "rb") as db_file: # type: ignore - self._buffer = db_file.read() - self._buffer_size = len(self._buffer) + buf = db_file.read() + self._buffer = buf + self._buffer_size = len(buf) filename = database elif mode == MODE_FD: self._buffer = database.read() # type: ignore diff -Nru python-maxminddb-2.2.0/.pylintrc python-maxminddb-2.4.0/.pylintrc --- python-maxminddb-2.2.0/.pylintrc 2021-09-24 17:10:12.000000000 +0000 +++ python-maxminddb-2.4.0/.pylintrc 2023-06-28 15:53:29.000000000 +0000 @@ -1,6 +1,3 @@ -[MESSAGES CONTROL] -disable=C0330 - [BASIC] no-docstring-rgx=_.* diff -Nru python-maxminddb-2.2.0/pyproject.toml python-maxminddb-2.4.0/pyproject.toml --- python-maxminddb-2.2.0/pyproject.toml 1970-01-01 00:00:00.000000000 +0000 +++ python-maxminddb-2.4.0/pyproject.toml 2023-06-28 15:53:29.000000000 +0000 @@ -0,0 +1,6 @@ +# We should probably migrate most of setup.cfg here + +[tool.black] +# src is showing up in our GitHub linting builds. It seems to +# contain deps. +extend-exclude = '^/src/' \ No newline at end of file diff -Nru python-maxminddb-2.2.0/README.rst python-maxminddb-2.4.0/README.rst --- python-maxminddb-2.2.0/README.rst 2021-09-24 17:10:12.000000000 +0000 +++ python-maxminddb-2.4.0/README.rst 2023-06-28 15:53:29.000000000 +0000 @@ -94,7 +94,7 @@ Requirements ------------ -This code requires Python 3.6+. Older versions are not supported. The C +This code requires Python 3.7+. Older versions are not supported. The C extension requires CPython. Versioning diff -Nru python-maxminddb-2.2.0/.readthedocs.yaml python-maxminddb-2.4.0/.readthedocs.yaml --- python-maxminddb-2.2.0/.readthedocs.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-maxminddb-2.4.0/.readthedocs.yaml 2023-06-28 15:53:29.000000000 +0000 @@ -0,0 +1,6 @@ +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.11" diff -Nru python-maxminddb-2.2.0/setup.cfg python-maxminddb-2.4.0/setup.cfg --- python-maxminddb-2.2.0/setup.cfg 2021-09-24 17:10:12.000000000 +0000 +++ python-maxminddb-2.4.0/setup.cfg 2023-06-28 15:53:29.000000000 +0000 @@ -1,26 +1,77 @@ -[aliases] -build_html = build_sphinx -b html --build-dir docs - [flake8] +extend-ignore = E203 # black uses 88 : ¯\_(ツ)_/¯ max-line-length = 88 +[metadata] +name = maxminddb +author = Gregory Oschwald +author_email = goschwald@maxmind.com +license = Apache License, Version 2.0 +description = Reader for the MaxMind DB format +url = http://www.maxmind.com/ +long_description = file: README.rst +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 :: 3 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python + Topic :: Internet :: Proxy Servers + Topic :: Internet +project_urls = + Documentation = https://maxminddb.readthedocs.org/ + Source Code = https://github.com/maxmind/MaxMind-DB-Reader-python + Issue Tracker = https://github.com/maxmind/MaxMind-DB-Reader-python/issues + +[options] +package_dir = + maxminddb = maxminddb +packages = maxminddb +install_requires = +include_package_data = True +python_requires = >=3.7 + [wheel] universal = 1 +[options.package_data] +maxminddb = extension.pyi; py.typed + [tox:tox] -envlist = py36, py37, py38, py39, mypy +envlist = {py37,py38,py39,py310}-test,py310-{black,lint,flake8,mypy} [gh-actions] python = - 3.6: py36 3.7: py37 3.8: py38 - 3.9: py39, mypy + 3.9: py39 + 3.10: py310,black,lint,flake8,mypy -[testenv] -deps = - pytest - mocket +[testenv:{py37,py38,py39,py310}-test] +deps = pytest commands = pytest tests passenv = * + +[testenv:py310-black] +deps = black +commands = black --check --diff . + +[testenv:py310-lint] +deps = pylint +commands = pylint maxminddb + +[testenv:py310-flake8] +deps = flake8 +commands = flake8 maxminddb + +[testenv:py310-mypy] +deps = mypy +commands = mypy maxminddb tests diff -Nru python-maxminddb-2.2.0/setup.py python-maxminddb-2.4.0/setup.py --- python-maxminddb-2.2.0/setup.py 2021-09-24 17:10:12.000000000 +0000 +++ python-maxminddb-2.4.0/setup.py 2023-06-28 15:53:29.000000000 +0000 @@ -2,18 +2,22 @@ import re import sys -# This import is apparently needed for Nose on Red Hat's Python -import multiprocessing - -from distutils.command.build_ext import build_ext -from distutils.errors import CCompilerError, DistutilsExecError, DistutilsPlatformError - from setuptools import setup, Extension +from setuptools.command.build_ext import build_ext + +# These were only added to setuptools in 59.0.1. +try: + from setuptools.errors import CCompilerError + from setuptools.errors import DistutilsExecError + from setuptools.errors import DistutilsPlatformError +except ImportError: + from distutils.errors import CCompilerError + from distutils.errors import DistutilsExecError + from distutils.errors import DistutilsPlatformError cmdclass = {} PYPY = hasattr(sys, "pypy_version_info") JYTHON = sys.platform.startswith("java") -requirements = [] compile_args = ["-Wall", "-Wextra"] @@ -33,7 +37,7 @@ class BuildFailed(Exception): def __init__(self): - self.cause = sys.exc_info()[1] # work around py 2/3 different syntax + self.cause = sys.exc_info()[1] class ve_build_ext(build_ext): @@ -52,7 +56,7 @@ raise BuildFailed() except ValueError: # this can happen on Windows 64 bit, see Python issue 7511 - if "'path'" in str(sys.exc_info()[1]): # works with both py 2/3 + if "'path'" in str(sys.exc_info()[1]): raise BuildFailed() raise @@ -68,9 +72,6 @@ with open(os.path.join(ROOT, "maxminddb", "__init__.py"), "rb") as fd: maxminddb_text = fd.read().decode("utf8") - LICENSE = ( - re.compile(r".*__license__ = \"(.*?)\"", re.S).match(maxminddb_text).group(1) - ) VERSION = ( re.compile(r".*__version__ = \"(.*?)\"", re.S).match(maxminddb_text).group(1) ) @@ -98,41 +99,7 @@ if with_cext: kwargs["ext_modules"] = ext_module - setup( - name="maxminddb", - version=VERSION, - author="Gregory Oschwald", - author_email="goschwald@maxmind.com", - description="Reader for the MaxMind DB format", - long_description=README, - url="http://www.maxmind.com/", - packages=find_packages("."), - package_data={"": ["LICENSE"], "maxminddb": ["extension.pyi", "py.typed"]}, - package_dir={"maxminddb": "maxminddb"}, - python_requires=">=3.6", - include_package_data=True, - install_requires=requirements, - tests_require=["nose"], - test_suite="nose.collector", - license=LICENSE, - cmdclass=cmdclass, - 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 :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python", - "Topic :: Internet :: Proxy Servers", - "Topic :: Internet", - ], - **kwargs - ) + setup(version=VERSION, cmdclass=cmdclass, **kwargs) if PYPY or JYTHON: diff -Nru python-maxminddb-2.2.0/tests/decoder_test.py python-maxminddb-2.4.0/tests/decoder_test.py --- python-maxminddb-2.2.0/tests/decoder_test.py 2021-09-24 17:10:12.000000000 +0000 +++ python-maxminddb-2.4.0/tests/decoder_test.py 2023-06-28 15:53:29.000000000 +0000 @@ -191,7 +191,6 @@ self.check_decoding(type, input, expected) def check_decoding(self, type, input, expected, name=None): - name = name or expected db = mmap.mmap(-1, len(input)) db.write(input)