Remove check for sphinx and pylint modules (#3353)

This commit is contained in:
codefiles 2025-04-06 22:23:11 -04:00 committed by GitHub
parent f985da6f9a
commit 5b06ec7c37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 16 additions and 12 deletions

View File

@ -38,15 +38,6 @@ debug(f"Graphics devices detected: {SysInfo._graphics_devices().keys()}")
debug(f"Disk states before installing:\n{disk_layouts()}") debug(f"Disk states before installing:\n{disk_layouts()}")
if 'sphinx' not in sys.modules and 'pylint' not in sys.modules:
if '--help' in sys.argv or '-h' in sys.argv:
arch_config_handler.print_help()
exit(0)
if os.getuid() != 0:
print(_("Archinstall requires root privileges to run. See --help for more."))
exit(1)
# @archinstall.plugin decorator hook to programmatically add # @archinstall.plugin decorator hook to programmatically add
# plugins in runtime. Useful in profiles_bck and other things. # plugins in runtime. Useful in profiles_bck and other things.
def plugin(f, *args, **kwargs) -> None: # type: ignore[no-untyped-def] def plugin(f, *args, **kwargs) -> None: # type: ignore[no-untyped-def]
@ -77,12 +68,20 @@ def _check_new_version() -> None:
time.sleep(3) time.sleep(3)
def main() -> None: def main() -> int:
""" """
This can either be run as the compiled and installed application: python setup.py install This can either be run as the compiled and installed application: python setup.py install
OR straight as a module: python -m archinstall OR straight as a module: python -m archinstall
In any case we will be attempting to load the provided script to be run from the scripts/ folder In any case we will be attempting to load the provided script to be run from the scripts/ folder
""" """
if '--help' in sys.argv or '-h' in sys.argv:
arch_config_handler.print_help()
return 0
if os.getuid() != 0:
print(_("Archinstall requires root privileges to run. See --help for more."))
return 1
if not arch_config_handler.args.offline: if not arch_config_handler.args.offline:
_fetch_arch_db() _fetch_arch_db()
@ -95,12 +94,15 @@ def main() -> None:
# by loading the module we'll automatically run the script # by loading the module we'll automatically run the script
importlib.import_module(mod_name) importlib.import_module(mod_name)
return 0
def run_as_a_module() -> None: def run_as_a_module() -> None:
rc = 0
exc = None exc = None
try: try:
main() rc = main()
except Exception as e: except Exception as e:
exc = e exc = e
finally: finally:
@ -118,7 +120,9 @@ def run_as_a_module() -> None:
) )
warn(text) warn(text)
exit(1) rc = 1
exit(rc)
__all__ = [ __all__ = [