Skip to content

Commit ded2d7f

Browse files
abravalherisebastinas
authored andcommitted
Avoid patching the original build class attribute
1 parent 925b733 commit ded2d7f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import subprocess
77

88
from setuptools import setup
9-
from setuptools.command.build import build
9+
from setuptools.command.build import build as _orig_build
1010

1111
try:
1212
from babel.messages import frontend as babel
@@ -122,6 +122,11 @@ def git_describe_to_python_version(version):
122122
vf.write(f'__version__ = "{version}"\n')
123123

124124

125+
class build(_orig_build):
126+
# Avoid patching the original class' attribute (more robust customisation)
127+
sub_commands = _orig_build.sub_commands[:]
128+
129+
125130
cmdclass = {"build": build}
126131

127132
translations_dir = os.path.join("bpython", "translations")

0 commit comments

Comments
 (0)