bind9/bin/python/setup.py
Michał Kępień 1f4667061f Use setuptools instead of distutils if possible
According to PEP 632 [1], the distutils module is considered deprecated
in Python 3.10 and will be removed in Python 3.12.  Setup scripts
using it should be migrated to the setuptools module, which contains
drop-in replacements for distutils functions [2].  The catch is that the
setuptools module is not part of the Python Standard Library.

While this problem could be addressed by adding a hard dependency on
setuptools, it only affects BIND 9.16, which is an Extended Support
Version.  To avoid unnecessary disruptions, try importing setup() from
the setuptools module and fall back to using distutils if that fails.
Add a PyLint suppression for this specific "deprecated-module" warning.

Since the setuptools module is not part of the Python Standard Library
and therefore it is not guaranteed that it is universally available in
every Python installation, update Python-related checks in configure.ac
to ensure Python module installation does not silently fail.

[1] https://peps.python.org/pep-0632/
[2] https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html
2022-04-22 12:36:57 +02:00

26 lines
843 B
Python

# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
try:
from setuptools import setup
except ImportError:
# pylint: disable=deprecated-module
from distutils.core import setup
setup(name='isc',
version='2.0',
description='Python functions to support BIND utilities',
url='https://www.isc.org/bind',
author='Internet Systems Consortium, Inc',
author_email='info@isc.org',
license='MPL',
requires=['ply'],
packages=['isc'])