From 6df9ed508fc9b144206bdf1ff283a98c449f998c Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Thu, 29 Feb 2024 23:01:30 +0100 Subject: [PATCH] fix --- setup.py | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/setup.py b/setup.py index 15fda81..8411062 100755 --- a/setup.py +++ b/setup.py @@ -20,13 +20,9 @@ import os import subprocess +import setuptools.command.install from setuptools import Command, setup -# Setuptools replaces the `distutils` module in `sys.modules`. -# pylint: disable=wrong-import-order -import distutils.command.build # isort:skip, pylint: disable=deprecated-module -import distutils.command.clean # isort:skip, pylint: disable=deprecated-module - HOOKS = ["hooks/disable-units", "hooks/enable-units"] MAN_PAGES = ["bdebstrap.1"] @@ -51,7 +47,7 @@ def run(self): subprocess.check_call(command) -class BuildCommand(distutils.command.build.build): +class BuildCommand(setuptools.command.install.install): """Custom build command (calling doc beforehand).""" def run(self): @@ -59,17 +55,6 @@ def run(self): super().run() -class CleanCommand(distutils.command.clean.clean): - """Custom clean command (removing generated man pages).""" - - def run(self): - for man_page in MAN_PAGES: - if os.path.exists(man_page): - self.announce(f"removing {man_page}", level=logging.INFO) - os.remove(man_page) - distutils.command.clean.clean.run(self) - - if __name__ == "__main__": with open("README.md", "r", encoding="utf-8") as fh: LONG_DESCRIPTION = fh.read() @@ -97,7 +82,7 @@ def run(self): "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", ], - cmdclass={"doc": DocCommand, "build": BuildCommand, "clean": CleanCommand}, + cmdclass={"doc": DocCommand, "build": BuildCommand}, install_requires=["ruamel.yaml"], scripts=["bdebstrap"], py_modules=[],