diff options
author | Alfred Wingate <parona@protonmail.com> | 2023-10-05 07:11:38 +0300 |
---|---|---|
committer | Alfred Wingate <parona@protonmail.com> | 2023-10-05 07:11:38 +0300 |
commit | df38dcc20748c99d4422010b46b1610300535538 (patch) | |
tree | 72456128c241745600c85e58cbb7af0663810959 | |
parent | setup.py: use logging over distutils.log (diff) | |
download | elogv-df38dcc20748c99d4422010b46b1610300535538.tar.gz elogv-df38dcc20748c99d4422010b46b1610300535538.tar.bz2 elogv-df38dcc20748c99d4422010b46b1610300535538.zip |
setup.py: Convert to setuptools
* Remove clean command as setuptools doesn't have equivalent target.
Signed-off-by: Alfred Wingate <parona@protonmail.com>
-rw-r--r-- | setup.py | 57 |
1 files changed, 5 insertions, 52 deletions
@@ -1,10 +1,9 @@ -from distutils.core import setup -from distutils.cmd import Command from distutils.file_util import copy_file -from distutils.dir_util import remove_tree -from distutils.command.build import build as _build -from distutils.command.install import install as _install -from distutils.command.clean import clean as _clean + +from setuptools import setup +from setuptools import Command +from setuptools.command.build import build as _build +from setuptools.command.install import install as _install import logging @@ -159,51 +158,6 @@ class install_messages(Command): copy_file(c, out_file) -class clean(_clean): - _clean.user_options.append( - ('build-messages=', None, - "build directory for messages (default: 'build.build-messages')")) - - def initialize_options(self): - _clean.initialize_options(self) - self.build_messages = None - - def finalize_options(self): - self.set_undefined_options('build', ('build_base', 'build_base'), - ('build_lib', 'build_lib'), - ('build_scripts', 'build_scripts'), - ('build_temp', 'build_temp'), - ('build_messages', 'build_messages')) - self.set_undefined_options('bdist', ('bdist_base', 'bdist_base')) - - def run(self): - # remove the build/temp.<plat> directory (unless it's already - # gone) - if os.path.exists(self.build_temp): - remove_tree(self.build_temp, dry_run=self.dry_run) - else: - logging.debug("'%s' does not exist -- can't clean it", self.build_temp) - - if self.all: - # remove build directories - for directory in (self.build_lib, self.bdist_base, - self.build_scripts, self.build_messages): - if os.path.exists(directory): - remove_tree(directory, dry_run=self.dry_run) - else: - logging.warn("'%s' does not exist -- can't clean it", - directory) - - # just for the heck of it, try to remove the base build directory: - # we might have emptied it right now, but if not we don't care - if not self.dry_run: - try: - os.rmdir(self.build_base) - logging.info("removing '%s'", self.build_base) - except OSError: - pass - - ## Class modified to add manpages command class install(_install): def has_messages(self): @@ -269,5 +223,4 @@ setup(name="elogv", 'install_messages': install_messages, 'install_manpages': install_manpages, 'install': install, - 'clean': clean }) |