Skip to content

Commit 401e97f

Browse files
Falldogmartyanov
authored andcommitted
fix: installation should clear old build, avoid use cached pw
Falldog#73 [why] `python setup.py install` will create `build/` folder including `pyconcretexxx.o`, the password will be cached inside [how] execute clean command before installation
1 parent 3eb3ffd commit 401e97f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

setup.py

+9
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from distutils.dist import Distribution
2323
from distutils.command.build import build
2424
from distutils.command.build_ext import build_ext
25+
from distutils.command.clean import clean
2526
from distutils.command.install import install
2627
from src.config import TEST_DIR, SRC_DIR, EXT_SRC_DIR, EXE_SRC_DIR, SECRET_HEADER_PATH
2728

@@ -209,7 +210,15 @@ def finalize_options(self):
209210
self.set_undefined_options('build',
210211
('build_scripts', 'build_scripts'))
211212

213+
def _clean_build(self):
214+
c = clean(self.distribution)
215+
c.all = True
216+
c.finalize_options()
217+
c.run()
218+
212219
def run(self):
220+
self._clean_build()
221+
213222
self.pre_process()
214223
ret = install.run(self)
215224
self.install_exe()

0 commit comments

Comments
 (0)