[med-svn] [Git][med-team/python-bcbio-gff][master] drop import of setuptools bootstrap altogether (Closes: #1147787)
Alexandre Detiste (@detiste-guest)
gitlab at salsa.debian.org
Wed Sep 23 14:35:00 BST 2026
Alexandre Detiste pushed to branch master at Debian Med / python-bcbio-gff
Commits:
3527a3f4 by Alexandre Detiste at 2026-09-23T15:34:27+02:00
drop import of setuptools bootstrap altogether (Closes: #1147787)
- - - - -
2 changed files:
- debian/patches/distutils-deprecation.patch
- debian/patches/remove-six.patch
Changes:
=====================================
debian/patches/distutils-deprecation.patch
=====================================
@@ -1,292 +1,15 @@
-Description: migrate away from distutils.
- Following [PEP 632], the distutils module is deprecated. In bcbio.gff,
- this module is still in use for it's logging facility, so a
- contemporary approach would be to use the "logging" module instead of
- distutils. logging.warning behaves essentially the same way as
- distutils.log.warn; there was also a logging.warn function but it is
- deprecated in favor of warning, thus this patch does not attempt to do
- something smart with things allowed by the import semantics.
- .
- [PEP 632]: https://peps.python.org/pep-0632/
-
+Description: stop importing distribute_setup bootstrap
Author: Étienne Mollier <emollier at debian.org>
-Forwarded: https://github.com/chapmanb/bcbb/pull/146
-Last-Update: 2024-11-05
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- python-bcbio-gff.orig/distribute_setup.py
-+++ python-bcbio-gff/distribute_setup.py
-@@ -21,8 +21,7 @@
- import tempfile
- import tarfile
- import optparse
--
--from distutils import log
-+import logging
-
- try:
- from site import USER_SITE
-@@ -69,7 +68,7 @@
- def _install(tarball, install_args=()):
- # extracting the tarball
- tmpdir = tempfile.mkdtemp()
-- log.warn('Extracting in %s', tmpdir)
-+ logging.warning('Extracting in %s', tmpdir)
- old_wd = os.getcwd()
- try:
- os.chdir(tmpdir)
-@@ -80,13 +79,13 @@
- # going in the directory
- subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
- os.chdir(subdir)
-- log.warn('Now working in %s', subdir)
-+ logging.warning('Now working in %s', subdir)
-
- # installing
-- log.warn('Installing Distribute')
-+ logging.warning('Installing Distribute')
- if not _python_cmd('setup.py', 'install', *install_args):
-- log.warn('Something went wrong during the installation.')
-- log.warn('See the error message above.')
-+ logging.warning('Something went wrong during the installation.')
-+ logging.warning('See the error message above.')
- # exitcode will be 2
- return 2
- finally:
-@@ -97,7 +96,7 @@
- def _build_egg(egg, tarball, to_dir):
- # extracting the tarball
- tmpdir = tempfile.mkdtemp()
-- log.warn('Extracting in %s', tmpdir)
-+ logging.warning('Extracting in %s', tmpdir)
- old_wd = os.getcwd()
- try:
- os.chdir(tmpdir)
-@@ -108,17 +107,17 @@
- # going in the directory
- subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
- os.chdir(subdir)
-- log.warn('Now working in %s', subdir)
-+ logging.warning('Now working in %s', subdir)
-
- # building an egg
-- log.warn('Building a Distribute egg in %s', to_dir)
-+ logging.warning('Building a Distribute egg in %s', to_dir)
- _python_cmd('setup.py', '-q', 'bdist_egg', '--dist-dir', to_dir)
-
- finally:
- os.chdir(old_wd)
- shutil.rmtree(tmpdir)
- # returning the result
-- log.warn(egg)
-+ logging.warning(egg)
- if not os.path.exists(egg):
- raise IOError('Could not build the egg.')
-
-@@ -207,7 +206,7 @@
- src = dst = None
- if not os.path.exists(saveto): # Avoid repeated downloads
- try:
-- log.warn("Downloading %s", url)
-+ logging.warning("Downloading %s", url)
- src = urlopen(url)
- # Read/write all in one block, so we don't create a corrupt file
- # if the download is interrupted.
-@@ -254,9 +253,9 @@
- f.close()
- if existing_content == content:
- # already patched
-- log.warn('Already patched.')
-+ logging.warning('Already patched.')
- return False
-- log.warn('Patching...')
-+ logging.warning('Patching...')
- _rename_path(path)
- f = open(path, 'w')
- try:
-@@ -277,14 +276,14 @@
-
- def _rename_path(path):
- new_name = path + '.OLD.%s' % time.time()
-- log.warn('Renaming %s to %s', path, new_name)
-+ logging.warning('Renaming %s to %s', path, new_name)
- os.rename(path, new_name)
- return new_name
-
-
- def _remove_flat_installation(placeholder):
- if not os.path.isdir(placeholder):
-- log.warn('Unkown installation at %s', placeholder)
-+ logging.warning('Unkown installation at %s', placeholder)
- return False
- found = False
- for file in os.listdir(placeholder):
-@@ -292,10 +291,10 @@
- found = True
- break
- if not found:
-- log.warn('Could not locate setuptools*.egg-info')
-+ logging.warning('Could not locate setuptools*.egg-info')
- return
-
-- log.warn('Moving elements out of the way...')
-+ logging.warning('Moving elements out of the way...')
- pkg_info = os.path.join(placeholder, file)
- if os.path.isdir(pkg_info):
- patched = _patch_egg_dir(pkg_info)
-@@ -303,7 +302,7 @@
- patched = _patch_file(pkg_info, SETUPTOOLS_PKG_INFO)
-
- if not patched:
-- log.warn('%s already patched.', pkg_info)
-+ logging.warning('%s already patched.', pkg_info)
- return False
- # now let's move the files out of the way
- for element in ('setuptools', 'pkg_resources.py', 'site.py'):
-@@ -311,7 +310,7 @@
- if os.path.exists(element):
- _rename_path(element)
- else:
-- log.warn('Could not find the %s element of the '
-+ logging.warning('Could not find the %s element of the '
- 'Setuptools distribution', element)
- return True
-
-@@ -319,28 +318,28 @@
-
-
- def _after_install(dist):
-- log.warn('After install bootstrap.')
-+ logging.warning('After install bootstrap.')
- placeholder = dist.get_command_obj('install').install_purelib
- _create_fake_setuptools_pkg_info(placeholder)
-
-
- def _create_fake_setuptools_pkg_info(placeholder):
- if not placeholder or not os.path.exists(placeholder):
-- log.warn('Could not find the install location')
-+ logging.warning('Could not find the install location')
- return
- pyver = '%s.%s' % (sys.version_info[0], sys.version_info[1])
- setuptools_file = 'setuptools-%s-py%s.egg-info' % \
- (SETUPTOOLS_FAKED_VERSION, pyver)
- pkg_info = os.path.join(placeholder, setuptools_file)
- if os.path.exists(pkg_info):
-- log.warn('%s already exists', pkg_info)
-+ logging.warning('%s already exists', pkg_info)
- return
-
-- log.warn('Creating %s', pkg_info)
-+ logging.warning('Creating %s', pkg_info)
- try:
- f = open(pkg_info, 'w')
- except EnvironmentError:
-- log.warn("Don't have permissions to write %s, skipping", pkg_info)
-+ logging.warning("Don't have permissions to write %s, skipping", pkg_info)
- return
- try:
- f.write(SETUPTOOLS_PKG_INFO)
-@@ -348,7 +347,7 @@
- f.close()
-
- pth_file = os.path.join(placeholder, 'setuptools.pth')
-- log.warn('Creating %s', pth_file)
-+ logging.warning('Creating %s', pth_file)
- f = open(pth_file, 'w')
- try:
- f.write(os.path.join(os.curdir, setuptools_file))
-@@ -365,7 +364,7 @@
- pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
- if os.path.exists(pkg_info):
- if _same_content(pkg_info, SETUPTOOLS_PKG_INFO):
-- log.warn('%s already patched.', pkg_info)
-+ logging.warning('%s already patched.', pkg_info)
- return False
- _rename_path(path)
- os.mkdir(path)
-@@ -382,7 +381,7 @@
-
-
- def _before_install():
-- log.warn('Before install bootstrap.')
-+ logging.warning('Before install bootstrap.')
- _fake_setuptools()
-
-
-@@ -405,12 +404,12 @@
-
-
- def _fake_setuptools():
-- log.warn('Scanning installed packages')
-+ logging.warning('Scanning installed packages')
- try:
- import pkg_resources
- except ImportError:
- # we're cool
-- log.warn('Setuptools or Distribute does not seem to be installed.')
-+ logging.warning('Setuptools or Distribute does not seem to be installed.')
- return
- ws = pkg_resources.working_set
- try:
-@@ -424,43 +423,43 @@
- )
-
- if setuptools_dist is None:
-- log.warn('No setuptools distribution found')
-+ logging.warning('No setuptools distribution found')
- return
- # detecting if it was already faked
- setuptools_location = setuptools_dist.location
-- log.warn('Setuptools installation detected at %s', setuptools_location)
-+ logging.warning('Setuptools installation detected at %s', setuptools_location)
-
- # if --root or --preix was provided, and if
- # setuptools is not located in them, we don't patch it
- if not _under_prefix(setuptools_location):
-- log.warn('Not patching, --root or --prefix is installing Distribute'
-+ logging.warning('Not patching, --root or --prefix is installing Distribute'
- ' in another location')
- return
-
- # let's see if its an egg
- if not setuptools_location.endswith('.egg'):
-- log.warn('Non-egg installation')
-+ logging.warning('Non-egg installation')
- res = _remove_flat_installation(setuptools_location)
- if not res:
- return
- else:
-- log.warn('Egg installation')
-+ logging.warning('Egg installation')
- pkg_info = os.path.join(setuptools_location, 'EGG-INFO', 'PKG-INFO')
- if (os.path.exists(pkg_info) and
- _same_content(pkg_info, SETUPTOOLS_PKG_INFO)):
-- log.warn('Already patched.')
-+ logging.warning('Already patched.')
- return
-- log.warn('Patching...')
-+ logging.warning('Patching...')
- # let's create a fake egg replacing setuptools one
- res = _patch_egg_dir(setuptools_location)
- if not res:
- return
-- log.warn('Patching complete.')
-+ logging.warning('Patching complete.')
- _relaunch()
-
-
- def _relaunch():
-- log.warn('Relaunching...')
-+ logging.warning('Relaunching...')
- # we have to relaunch the process
- # pip marker to avoid a relaunch bug
- _cmd1 = ['-c', 'install', '--single-version-externally-managed']
-@@ -525,7 +524,7 @@
- install_args = []
- if options.user_install:
- if sys.version_info < (2, 6):
-- log.warn("--user requires Python 2.6 or later")
-+ logging.warning("--user requires Python 2.6 or later")
- raise SystemExit(1)
- install_args.append('--user')
- return install_args
+Last-Update: 2026-09-29
+
+--- a/setup.py
++++ b/setup.py
+@@ -1,8 +1,6 @@
+ #!/usr/bin/env python
+ """Python setup file for Blue Collar Bioinformatics scripts and modules.
+ """
+-from distribute_setup import use_setuptools
+-use_setuptools()
+ from setuptools import setup, find_packages
+
+ __version__ = "Undefined"
=====================================
debian/patches/remove-six.patch
=====================================
@@ -35,7 +35,7 @@ Forwarded: no
need_close = True
--- a/setup.py
+++ b/setup.py
-@@ -18,5 +18,5 @@
+@@ -16,5 +16,5 @@
description="Read and write Generic Feature Format (GFF) with Biopython integration.",
url="https://github.com/chapmanb/bcbb/tree/master/gff",
packages=find_packages(),
View it on GitLab: https://salsa.debian.org/med-team/python-bcbio-gff/-/commit/3527a3f42b5bf1a4c8f7de316d8cc8019f739f83
--
View it on GitLab: https://salsa.debian.org/med-team/python-bcbio-gff/-/commit/3527a3f42b5bf1a4c8f7de316d8cc8019f739f83
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20260923/6ee9d853/attachment-0001.htm>
More information about the debian-med-commit
mailing list