Skip to content

Commit f07c7c3

Browse files
committed
Replaced cleanup
Previous post-processing cleanup was breaking editable installs Instead, this manual `setup.py clean` command is provided as convenience
1 parent c47c998 commit f07c7c3

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

setup.py

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -478,18 +478,30 @@ def run(self):
478478
config.download_to_dest()
479479

480480

481+
class LibzimClean(Command):
482+
user_options = []
483+
484+
def initialize_options(self):
485+
...
486+
487+
def finalize_options(self):
488+
...
489+
490+
def run(self):
491+
config.cleanup()
492+
493+
481494
if len(sys.argv) == 2 and sys.argv[1] in config.buildless_commands:
482495
ext_modules = None
483496
else:
484497
config.check_platform()
485498
ext_modules = get_cython_extension()
486499

487-
try:
488-
setup(
489-
cmdclass={"build_ext": LibzimBuildExt, "download_libzim": DownloadLibzim},
490-
ext_modules=ext_modules,
491-
)
492-
except Exception as exc:
493-
raise exc
494-
finally:
495-
config.cleanup()
500+
setup(
501+
cmdclass={
502+
"build_ext": LibzimBuildExt,
503+
"download_libzim": DownloadLibzim,
504+
"clean": LibzimClean,
505+
},
506+
ext_modules=ext_modules,
507+
)

0 commit comments

Comments
 (0)