From 4cd4fb6280433f301ad9159f7473dc32ceb063d6 Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Mon, 30 May 2022 21:05:26 -0700 Subject: setup.py: Migrate from deprecated distutils to setuptools Gentoo-bug-url: https://bugs.gentoo.org/841131 Signed-off-by: Brian Dolbec --- setup.py | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/setup.py b/setup.py index 5571711..7c4165c 100755 --- a/setup.py +++ b/setup.py @@ -6,13 +6,10 @@ from __future__ import print_function import re import sys -from distutils import core, log -from distutils.command.sdist import sdist -from distutils.core import Command - import os import io import unittest +from setuptools import setup, Command __version__ = os.getenv('VERSION', default=os.getenv('PVR', default='9999')) @@ -38,7 +35,7 @@ manpage = [os.path.join(cwd, path) for path in ( )] -class set_version(core.Command): +class set_version(Command): """Set python version to our __version__.""" description = "hardcode scripts' version using VERSION from environment" user_options = [] # [(long_name, short_name, desc),] @@ -70,18 +67,6 @@ class set_version(core.Command): sub(manpage, man_re) -class x_sdist(sdist): - """sdist defaulting to archive files owned by root.""" - - def finalize_options(self): - if self.owner is None: - self.owner = 'root' - if self.group is None: - self.group = 'root' - - sdist.finalize_options(self) - - class TestCommand(Command): user_options = [] @@ -105,7 +90,7 @@ test_data = { ] } -core.setup( +setup( name='mirrorselect', version=__version__, description='Tool for selecting Gentoo source and rsync mirrors.', @@ -125,7 +110,6 @@ core.setup( ), cmdclass={ 'test': TestCommand, - 'sdist': x_sdist, 'set_version': set_version, }, ) -- cgit v1.2.3-65-gdbad