Skip to content

Commit

Permalink
Merge pull request #81 from t0xic0der/poetry-restructuring
Browse files Browse the repository at this point in the history
Restructuring with Poetry + Modularity + Bug fixes
  • Loading branch information
gridhead authored Dec 16, 2021
2 parents 84727b4 + 5c6ac6f commit 0f31375
Show file tree
Hide file tree
Showing 44 changed files with 1,936 additions and 964 deletions.
432 changes: 386 additions & 46 deletions README.md

Large diffs are not rendered by default.

41 changes: 0 additions & 41 deletions SCREENSHOTS.md

This file was deleted.

23 changes: 17 additions & 6 deletions nvautoinstall.spec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
%global srcname nvidia-auto-installer-for-fedora
%global srcname nvidia-auto-installer-for-fedora-linux

Name: nvautoinstall
Version: 0.3.9
Release: 1%{?dist}
Summary: NVIDIA Auto Installer for Fedora
Version: 0.4.0
Release: 0%{?dist}
Summary: NVIDIA Auto Installer for Fedora Linux

License: GPLv3
License: GPLv3+
Url: https://github.com/t0xic0der/%{srcname}
Source0: https://github.com/t0xic0der/%{srcname}/releases/download/v%{version}/%{name}-%{version}.tar.gz

Expand All @@ -16,7 +16,7 @@ BuildRequires: python3-devel
Requires: dnf-plugins-core

%description
A CLI tool which lets you install proprietary NVIDIA drivers and much more
A CLI tool which lets you install proprietary NVIDIA drivers and much more easily on Fedora Linux (32 or above, ELN or Rawhide)

%prep
%autosetup
Expand All @@ -38,6 +38,17 @@ A CLI tool which lets you install proprietary NVIDIA drivers and much more

%changelog

* Thu Dec 16 2021 Akashdeep Dhar <[email protected]> - 0.4.0-0
- v0.4.0
- Restructured the project to make the codebase more modular
- Performed repository clean up and removal of static files
- Reworked the dependency management with the use of Poetry
- Deprecated COPR build updates for Mageia, EPEL and OpenSUSE
- Reimplimented CLI compositing to make use of commands over options
- Removed dedicated installation of x86 NVIDIA libraries due to inclusion
- Fixed RPM Fusion Non-free repo detection by force installation
- Updated official CUDA repositories to point to Fedora 34 or later

* Thu Aug 12 2021 Akashdeep Dhar <[email protected]> - 0.3.9-1
- v0.3.9
- Reworked RPM specfile with pyproject directives
Expand Down
33 changes: 33 additions & 0 deletions nvautoinstall/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""
NVIDIA Auto Installer for Fedora Linux
Copyright (C) 2019-2021 Akashdeep Dhar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""


from .interfaces.check_superuser_permissions import CheckSuperuserPermissions
from .interfaces.handle_compatibility_check import HandleCompatibilityCheck
from .interfaces.handle_drivers_installation import HandleDriverInstallation
from .interfaces.handle_prime_support import HandlePrimeSupport
from .interfaces.handle_rpmfusion_repositories import \
HandleRPMFusionRepositories
from .interfaces.install_cuda_support import InstallCudaSupport
from .interfaces.install_everything import InstallEverything
from .interfaces.install_ffmpeg_support import InstallFfmpegSupport
from .interfaces.install_nvidia_repositories import InstallNvidiaRepositories
from .interfaces.install_video_acceleration import InstallVideoAcceleration
from .interfaces.install_vulkan_support import InstallVulkanSupport

__version__ = "0.4.0"
20 changes: 20 additions & 0 deletions nvautoinstall/decoration/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
NVIDIA Auto Installer for Fedora Linux
Copyright (C) 2019-2021 Akashdeep Dhar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""


from .status import failure, general, section, success, warning
46 changes: 46 additions & 0 deletions nvautoinstall/decoration/status.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"""
NVIDIA Auto Installer for Fedora Linux
Copyright (C) 2019-2021 Akashdeep Dhar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""


from click import echo, style

PASS = style("[ \u2713 ]", fg="green", bold=True)
FAIL = style("[ \u2717 ]", fg="red", bold=True)
WARN = style("[ ! ]", fg="yellow", bold=True)
HEAD = style("[ \u2605 ]", fg="magenta", bold=True)
STDS = " "


def success(message):
echo(PASS + " " + message)


def failure(message):
echo(FAIL + " " + message)


def warning(message):
echo(WARN + " " + message)


def section(message):
echo(HEAD + " " + style(message, fg="magenta", bold=True))


def general(message):
echo(STDS + " " + message)
35 changes: 35 additions & 0 deletions nvautoinstall/interfaces/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""
NVIDIA Auto Installer for Fedora Linux
Copyright (C) 2019-2021 Akashdeep Dhar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""


from ..decoration import failure, general, section, success, warning
from ..operations import (CheckSuperuserPermissions, HandleCompatibilityCheck,
HandleCudaInstallation, HandleDriversInstallation,
HandlePrimeSupport, HandleRPMFusionRepositories,
InstallFfmpegSupport, InstallVideoAcceleration,
InstallVulkanSupport)

Objc_CheckSuperuserPermissions = CheckSuperuserPermissions()
Objc_HandlePrimeSupport = HandlePrimeSupport()
Objc_HandleCompatibilityCheck = HandleCompatibilityCheck()
Objc_HandleCudaInstallation = HandleCudaInstallation()
Objc_HandleRPMFusionRepositories = HandleRPMFusionRepositories()
Objc_InstallFfmpegSupport = InstallFfmpegSupport()
Objc_HandleDriversInstallation = HandleDriversInstallation()
Objc_InstallVideoAcceleration = InstallVideoAcceleration()
Objc_InstallVulkanSupport = InstallVulkanSupport()
36 changes: 36 additions & 0 deletions nvautoinstall/interfaces/check_superuser_permissions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""
NVIDIA Auto Installer for Fedora Linux
Copyright (C) 2019-2021 Akashdeep Dhar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""


import sys

from . import (Objc_CheckSuperuserPermissions, failure, general, section,
success)


class CheckSuperuserPermissions:
def __init__(self):
section("CHECKING SUPERUSER PERMISSIONS...")
if Objc_CheckSuperuserPermissions.main():
success("Superuser permission is available")
general("This tool is expected to work correctly here")
else:
failure("Superuser permission is not available")
general("This tool cannot be used here")
failure("Leaving installer")
sys.exit(0)
62 changes: 62 additions & 0 deletions nvautoinstall/interfaces/handle_compatibility_check.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
"""
NVIDIA Auto Installer for Fedora Linux
Copyright (C) 2019-2021 Akashdeep Dhar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""


import sys

from . import (Objc_HandleCompatibilityCheck, failure, general, section,
success, warning)


class HandleCompatibilityCheck:
def __init__(self):
section("CHECKING FOR GPU COMPATIBILITY...")
data = Objc_HandleCompatibilityCheck.gpuc()
warning("Compatibility infomation was obtained")
if data is False:
failure("No supported NVIDIA GPU was detected")
else:
success("One or more active NVIDIA GPUs were detected")
supprt = data["supprt"]
gpulst = data["gpulst"]
for indx in gpulst:
if indx != "":
general(indx)
if supprt == "single":
success("An single dedicated GPU setup was detected")
else:
success("An Optimus Dual GPU setup was detected")
section("GATHERING CURRENT HOST INFORMATION...")
data = Objc_HandleCompatibilityCheck.main()
warning("Host information was gathered")
for indx in data.keys():
general(indx + ": " + data[indx])
section("CHECKING FOR HOST COMPATIBILITY...")
data = Objc_HandleCompatibilityCheck.avbl()
if data is False:
failure("Unsupported OS detected")
general("This tool cannot be used here")
else:
if data == "full":
success("Supported OS detected")
general("This tool is expected to work correctly here")
elif data == "half":
warning("Minimally supported OS detected")
general("Discretion is advised while using this tool")
failure("Leaving installer")
sys.exit(0)
68 changes: 68 additions & 0 deletions nvautoinstall/interfaces/handle_drivers_installation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
"""
NVIDIA Auto Installer for Fedora Linux
Copyright (C) 2019-2021 Akashdeep Dhar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""


import sys

from . import (Objc_CheckSuperuserPermissions, Objc_HandleDriversInstallation,
Objc_HandleRPMFusionRepositories, failure, general, section,
success, warning)


class HandleDriverInstallation:
def __init__(self):
section("CHECKING SUPERUSER PERMISSIONS...")
if Objc_CheckSuperuserPermissions.main():
success("Superuser privilege acquired")
section("CHECKING AVAILABILITY OF RPM FUSION NVIDIA REPOSITORY...")
if Objc_HandleRPMFusionRepositories.avbl():
warning(
"RPM Fusion repository for Proprietary NVIDIA Driver was detected"
)
section("ATTEMPTING CONNECTION TO RPM FUSION SERVERS...")
if Objc_HandleRPMFusionRepositories.conn():
success("Connection to RPM Fusion servers was established")
section("LOOKING FOR EXISTING DRIVER PACKAGES...")
data = Objc_HandleDriversInstallation.avbl()
if data is False:
warning("No existing NVIDIA driver packages were detected")
section("INSTALLING PROPRIETARY DRIVERS...")
else:
qant = 0
for indx in data:
if indx != "":
qant += 1
general(indx)
warning(
"A total of " + str(qant) + " driver packages were detected"
)
section("REINSTALLING PROPRIETARY DRIVERS...")
if Objc_HandleDriversInstallation.main():
success("Driver package installation completed")
else:
failure("Proprietary drivers could not be installed")
else:
failure("Connection to RPM Fusion servers could not be established")
else:
failure(
"RPM Fusion repository for Proprietary NVIDIA Driver was not detected"
)
else:
failure("Superuser privilege could not be acquired")
failure("Leaving installer")
sys.exit(0)
Loading

0 comments on commit 0f31375

Please sign in to comment.