From ffd5b5f80453a609b76e050d6d4e8309c540c28e Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Sat, 15 May 2021 11:35:18 -0400 Subject: Very selectively fix some PEP 8 issues with profiles --- profiles/xorg.py | 1 + 1 file changed, 1 insertion(+) (limited to 'profiles/xorg.py') diff --git a/profiles/xorg.py b/profiles/xorg.py index 19ca92d7..e7cf00d0 100644 --- a/profiles/xorg.py +++ b/profiles/xorg.py @@ -7,6 +7,7 @@ is_top_level_profile = True __packages__ = ['dkms', 'xorg-server', 'xorg-xinit', 'nvidia-dkms', 'xorg-server', *archinstall.lib.hardware.__packages__] + def _prep_function(*args, **kwargs): """ Magic function called by the importing installer -- cgit v1.2.3-54-g00ecf From acb754ff2edee96d3dc0c6ca29abd0c60a1a5ace Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Sat, 15 May 2021 11:42:32 -0400 Subject: Try to remove some unused imports --- profiles/deepin.py | 2 +- profiles/desktop.py | 2 +- profiles/i3.py | 2 +- profiles/kde.py | 2 +- profiles/minimal.py | 2 -- profiles/server.py | 2 +- profiles/xorg.py | 1 - 7 files changed, 5 insertions(+), 8 deletions(-) (limited to 'profiles/xorg.py') diff --git a/profiles/deepin.py b/profiles/deepin.py index a4778b0d..ebe730e2 100644 --- a/profiles/deepin.py +++ b/profiles/deepin.py @@ -1,6 +1,6 @@ # A desktop environment using "Deepin". -import archinstall, os +import archinstall is_top_level_profile = False diff --git a/profiles/desktop.py b/profiles/desktop.py index 84c1ac06..67514a97 100644 --- a/profiles/desktop.py +++ b/profiles/desktop.py @@ -1,6 +1,6 @@ # A desktop environment selector. -import archinstall, os +import archinstall is_top_level_profile = True diff --git a/profiles/i3.py b/profiles/i3.py index 1972ba59..418749c0 100644 --- a/profiles/i3.py +++ b/profiles/i3.py @@ -1,6 +1,6 @@ # Common package for i3, lets user select which i3 configuration they want. -import archinstall, os +import archinstall is_top_level_profile = False diff --git a/profiles/kde.py b/profiles/kde.py index 66625074..cdb6a41a 100644 --- a/profiles/kde.py +++ b/profiles/kde.py @@ -1,6 +1,6 @@ # A desktop environment using "KDE". -import archinstall, os +import archinstall is_top_level_profile = False diff --git a/profiles/minimal.py b/profiles/minimal.py index 8af06a3a..13cfd05a 100644 --- a/profiles/minimal.py +++ b/profiles/minimal.py @@ -1,7 +1,5 @@ # Used to do a minimal install -import archinstall, os - is_top_level_profile = True diff --git a/profiles/server.py b/profiles/server.py index 36bfd3ab..ff7b2179 100644 --- a/profiles/server.py +++ b/profiles/server.py @@ -1,6 +1,6 @@ # Used to select various server application profiles on top of a minimal installation. -import archinstall, os, logging +import archinstall, logging is_top_level_profile = True diff --git a/profiles/xorg.py b/profiles/xorg.py index e7cf00d0..34599468 100644 --- a/profiles/xorg.py +++ b/profiles/xorg.py @@ -1,6 +1,5 @@ # A system with "xorg" installed -import os import archinstall is_top_level_profile = True -- cgit v1.2.3-54-g00ecf From d93ef24e8e080ab4c71366bfba0340d16f17524b Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Sat, 15 May 2021 11:51:06 -0400 Subject: A couple more small fixes --- profiles/enlightenment.py | 2 +- profiles/server.py | 3 ++- profiles/xorg.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'profiles/xorg.py') diff --git a/profiles/enlightenment.py b/profiles/enlightenment.py index 4c5a7999..cfb97836 100644 --- a/profiles/enlightenment.py +++ b/profiles/enlightenment.py @@ -1,6 +1,6 @@ # A desktop environment using "Enlightenment". -import archinstall, os +import archinstall is_top_level_profile = False diff --git a/profiles/server.py b/profiles/server.py index ff7b2179..3ccc9715 100644 --- a/profiles/server.py +++ b/profiles/server.py @@ -1,6 +1,7 @@ # Used to select various server application profiles on top of a minimal installation. -import archinstall, logging +import archinstall +import logging is_top_level_profile = True diff --git a/profiles/xorg.py b/profiles/xorg.py index 34599468..a5a50697 100644 --- a/profiles/xorg.py +++ b/profiles/xorg.py @@ -36,4 +36,4 @@ if __name__ == 'xorg': else: archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit {' '.join(_gfx_driver_packages)}") except: - archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit") # Prep didn't run, so there's no driver to install \ No newline at end of file + archinstall.storage['installation_session'].add_additional_packages("xorg-server xorg-xinit") # Prep didn't run, so there's no driver to install \ No newline at end of file -- cgit v1.2.3-54-g00ecf From e111dd9bc1ac1c27efa14f89a2cb1464f135c0da Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Sat, 15 May 2021 13:04:18 -0400 Subject: Final whitespace changes I think --- examples/unattended.py | 3 ++- profiles/52-54-00-12-34-56.py | 1 + profiles/kde.py | 1 + profiles/server.py | 3 ++- profiles/xorg.py | 1 + setup.py | 3 ++- 6 files changed, 9 insertions(+), 3 deletions(-) (limited to 'profiles/xorg.py') diff --git a/examples/unattended.py b/examples/unattended.py index bb854a70..f1ed4c94 100644 --- a/examples/unattended.py +++ b/examples/unattended.py @@ -1,6 +1,7 @@ -import archinstall import time +import archinstall + archinstall.storage['UPSTREAM_URL'] = 'https://archlinux.life/profiles' archinstall.storage['PROFILE_DB'] = 'index.json' diff --git a/profiles/52-54-00-12-34-56.py b/profiles/52-54-00-12-34-56.py index 758a4cc2..e1361073 100644 --- a/profiles/52-54-00-12-34-56.py +++ b/profiles/52-54-00-12-34-56.py @@ -1,4 +1,5 @@ import archinstall + # import json # import urllib.request diff --git a/profiles/kde.py b/profiles/kde.py index cdb6a41a..451704b9 100644 --- a/profiles/kde.py +++ b/profiles/kde.py @@ -6,6 +6,7 @@ is_top_level_profile = False __packages__ = ["plasma-meta", "konsole", "kate", "dolphin", "sddm", "plasma-wayland-session", "egl-wayland"] + # TODO: Remove hard dependency of bash (due to .bash_profile) diff --git a/profiles/server.py b/profiles/server.py index 3ccc9715..afc37776 100644 --- a/profiles/server.py +++ b/profiles/server.py @@ -1,8 +1,9 @@ # Used to select various server application profiles on top of a minimal installation. -import archinstall import logging +import archinstall + is_top_level_profile = True available_servers = ["cockpit", "docker", "httpd", "lighttpd", "mariadb", "nginx", "postgresql", "sshd", "tomcat"] diff --git a/profiles/xorg.py b/profiles/xorg.py index a5a50697..3351e4e5 100644 --- a/profiles/xorg.py +++ b/profiles/xorg.py @@ -22,6 +22,7 @@ def _prep_function(*args, **kwargs): return True + # Ensures that this code only gets executed if executed # through importlib.util.spec_from_file_location("xorg", "/somewhere/xorg.py") # or through conventional import xorg diff --git a/setup.py b/setup.py index 8b95d978..68a125d1 100644 --- a/setup.py +++ b/setup.py @@ -1,2 +1,3 @@ -import setuptools # type: ignore +import setuptools # type: ignore + setuptools.setup() -- cgit v1.2.3-54-g00ecf