Skip to content
This repository was archived by the owner on Jul 23, 2025. It is now read-only.

Commit 28655bd

Browse files
authored
Merge pull request #70 from t0xic0der/pyproject-packaging
PyProject Packaging
2 parents 35ba712 + 84c235b commit 28655bd

File tree

5 files changed

+71
-94
lines changed

5 files changed

+71
-94
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ This mode installs all the above packages. (Not been implemented yet)
5252
- **`sudo nvautoinstall --cheksu`**
5353
This mode allows you to check the current user privilege level. You can use this tool effectively only when you have logged in as a root or sudo user.
5454
- **`sudo nvautoinstall --compat`**
55-
This mode allows you to check your hardware and host compatiblity. The tool would check your hardware and host and tell if your device is supported by the tool or not.
55+
This mode allows you to check your hardware and host compatibility. The tool would check your hardware and host and tell if your device is supported by the tool or not.
56+
- **`sudo nvautoinstall --primec`**
57+
This mode allows you to toggle the PRIME offloading to render all display elements using the discrete card. This has only been tested on Workstation variant of Fedora.
5658
- **`sudo nvautoinstall --version`**
5759
This mode would show the tool version and exit out.
5860
- **`sudo nvautoinstall --help`**
@@ -67,14 +69,14 @@ This mode would show the help message and exit out.
6769
* Only tested on 9XX/10XX/20XX series discrete cards.
6870
* Use discretion while installing with older cards.
6971
* No additional configuration is required for Optimus setups.
72+
* Native support for PRIME configuration on Optimus.
7073

7174
## Coming soon
7275
* CLI "Launch using Dedicated Graphics Card" option.
7376
* Intuitive mode switching for hybrid graphics.
7477
* Distinct mode for using integrated or discrete GPU.
7578
* Experimental support for RHEL 8 and CentOS 8.
7679
* Support for older cards by active querying at NVIDIA.
77-
* Native support for PRIME configuration on Optimus.
7880

7981
## Disclaimer
8082
This tool has been tried and tested multiple times and is expected to work flawlessly in Fedora Workstation 32 or above. It has not been tested on any of the spins yet so proceed with caution. While the chances of things going wrong is pretty slim but still you would want to make backups, should things do not go as expected. As always, you are choosing to use this tool at your will and you cannot hold me responsible for any mishap there may occur due to the misuse of this tool.

TODO.md

Lines changed: 0 additions & 57 deletions
This file was deleted.

nvautoinstall.spec

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
%global srcname nvidia-auto-installer-for-fedora
22

33
Name: nvautoinstall
4-
Version: 0.3.8
5-
Release: 0%{?dist}
4+
Version: 0.3.9
5+
Release: 1%{?dist}
66
Summary: NVIDIA Auto Installer for Fedora
77

88
License: GPLv3
@@ -12,47 +12,54 @@ Source0: https://github.com/t0xic0der/%{srcname}/releases/download/v%{version}/%
1212
BuildArch: noarch
1313

1414
BuildRequires: python3-devel
15-
BuildRequires: python3-setuptools
15+
16+
Requires: dnf-plugins-core
1617

1718
%description
1819
A CLI tool which lets you install proprietary NVIDIA drivers and much more
1920

2021
%prep
2122
%autosetup
2223

24+
%generate_buildrequires
25+
%pyproject_buildrequires -r
26+
2327
%build
24-
%py3_build
28+
%pyproject_wheel
2529

2630
%install
27-
%py3_install
31+
%pyproject_install
32+
%pyproject_save_files nvautoinstall
2833

29-
#-- FILES ---------------------------------------------------------------------#
30-
%files
34+
%files -f %{pyproject_files}
3135
%doc README.md
3236
%license LICENSE
3337
%{_bindir}/nvautoinstall
34-
%{python3_sitelib}/%{name}-*.egg-info/
35-
%{python3_sitelib}/%{name}/
3638

37-
#-- CHANGELOG -----------------------------------------------------------------#
3839
%changelog
3940

40-
* Mon Aug 02 2021 Akashdeep Dhar <[email protected]>
41+
* Thu Aug 12 2021 Akashdeep Dhar <[email protected]> - 0.3.9-1
42+
- v0.3.9
43+
- Reworked RPM specfile with pyproject directives
44+
- Removed dependency on python3-setuptools for build
45+
- Added dnf-plugins-core in the list of runtime dependencies
46+
47+
* Mon Aug 02 2021 Akashdeep Dhar <[email protected]> - 0.3.8-0
4148
- v0.3.8
4249
- Replaced ping with curl for checking availability of RPM Fusion servers
4350
- Replaced ping with curl for checking availability of NVIDIA Developer servers
4451

45-
* Sat May 22 2021 Akashdeep Dhar <[email protected]>
52+
* Sat May 22 2021 Akashdeep Dhar <[email protected]> - 0.3.7-0
4653
- v0.3.7
4754
- Added option to enable/disable PRIME support on Optimus-supported devices
4855
- Added other miscellaneous changes for ease of maintenance
4956

50-
* Sun May 09 2021 Akashdeep Dhar <[email protected]>
57+
* Sun May 09 2021 Akashdeep Dhar <[email protected]> - 0.3.6-0
5158
- v0.3.6
5259
- Reworked installation method for CUDA repo compatibility
5360
- Minor patch leading to a version bump
5461

55-
* Thu Apr 29 2021 Akashdeep Dhar <[email protected]>
62+
* Thu Apr 29 2021 Akashdeep Dhar <[email protected]> - 0.3.5-0
5663
- v0.3.5
5764
- Corrected unicode escape sequences for colors
5865
- Changed CUDA repository to the most recent F33 remote install
@@ -61,7 +68,7 @@ A CLI tool which lets you install proprietary NVIDIA drivers and much more
6168
- Made compliance related changes here and there
6269
- Tested and confirmed the tool to be working in F34 Workstation
6370

64-
* Thu Jun 04 2020 Akashdeep Dhar <[email protected]>
71+
* Thu Jun 04 2020 Akashdeep Dhar <[email protected]> - 0.3.0-0
6572
- v0.3.0
6673
- Combined RPM Fusion pinging, checking, installing into a single module
6774
- Combined driver installer and existing package checking into a single module
@@ -81,13 +88,13 @@ A CLI tool which lets you install proprietary NVIDIA drivers and much more
8188
- Added network availability check before pinging respective repo servers
8289
- Improved handling of interrupt. halt and suspend system calls for tool
8390

84-
* Mon Jun 01 2020 Akashdeep Dhar <[email protected]>
91+
* Mon Jun 01 2020 Akashdeep Dhar <[email protected]> - 0.2.6-0
8592
- v0.2.6
8693
- Fixed broken repository addition module
8794
- Added installation of fedora-workstation-repositories first
8895
- Added enabling of repository after the install is complete
8996

90-
* Sun May 31 2020 Akashdeep Dhar <[email protected]>
97+
* Sun May 31 2020 Akashdeep Dhar <[email protected]> - 0.2.5-0
9198
- v0.2.5
9299
- Removed mandatory sleep for kernel module load
93100
- Removed dependency on kernel module loader
@@ -97,7 +104,7 @@ A CLI tool which lets you install proprietary NVIDIA drivers and much more
97104
- Fixed boolean choices in package check
98105
- Fixed prompt colors for custom-themed terminals
99106

100-
* Wed May 27 2020 Akashdeep Dhar <[email protected]>
107+
* Wed May 27 2020 Akashdeep Dhar <[email protected]> - 0.2.0-0
101108
- v0.2.0
102109
- Cleaned up repeated code using class implemented decorator calls
103110
- Enforced root access for whole operation instead of sudo implementation
@@ -109,7 +116,7 @@ A CLI tool which lets you install proprietary NVIDIA drivers and much more
109116
- Fixed confirmation choice during package check
110117
- Fixed typo in RPM Fusion mentions throughout the tool interface
111118

112-
* Fri May 22 2020 Akashdeep Dhar <[email protected]>
119+
* Fri May 22 2020 Akashdeep Dhar <[email protected]> - 0.1.0-0
113120
- v0.1.0
114121
- Added host detection with display of system details and hostname
115122
- Added GPU compatibility check for detecting active NVIDIA GPU

setup.py

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,35 @@
1-
import setuptools, codecs, os.path
1+
"""
2+
##########################################################################
3+
*
4+
* Copyright © 2019-2021 Akashdeep Dhar <[email protected]>
5+
*
6+
* This program is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
18+
*
19+
##########################################################################
20+
"""
21+
22+
import codecs
23+
import os.path
24+
import setuptools
25+
226

3-
# get __version__ from a file
427
def read(rel_path):
528
here = os.path.abspath(os.path.dirname(__file__))
629
with codecs.open(os.path.join(here, rel_path), 'r') as fp:
730
return fp.read()
831

32+
933
def get_version(rel_path):
1034
for line in read(rel_path).splitlines():
1135
if line.startswith('__version__'):
@@ -14,6 +38,7 @@ def get_version(rel_path):
1438
else:
1539
raise RuntimeError("Unable to find version string.")
1640

41+
1742
# setuptools configuration
1843
setuptools.setup(
1944
name='nvautoinstall',
@@ -29,26 +54,26 @@ def get_version(rel_path):
2954
version=get_version("src/nvautoinstall/__init__.py"),
3055
# tell distutils packages are under src directory
3156
package_dir={
32-
'': 'src',
57+
'': 'src',
3358
},
3459
packages=setuptools.find_packages('src'),
3560
install_requires=[
36-
'click',
37-
'distro',
61+
'click',
62+
'distro',
3863
],
3964
# automatically create console scripts
4065
entry_points={
41-
'console_scripts': ['nvautoinstall=nvautoinstall.MainFunction:clim'],
66+
'console_scripts': ['nvautoinstall=nvautoinstall.MainFunction:clim'],
4267
},
4368
classifiers=[
44-
'Development Status :: 4 - Beta',
45-
'Environment :: Console',
46-
'Intended Audience :: End Users/Desktop',
47-
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
48-
'Natural Language :: English',
49-
'Programming Language :: Python :: 3',
50-
'Operating System :: POSIX :: Linux',
51-
'Topic :: System :: Hardware :: Hardware Drivers',
52-
'Topic :: Utilities',
69+
'Development Status :: 4 - Beta',
70+
'Environment :: Console',
71+
'Intended Audience :: End Users/Desktop',
72+
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
73+
'Natural Language :: English',
74+
'Programming Language :: Python :: 3',
75+
'Operating System :: POSIX :: Linux',
76+
'Topic :: System :: Hardware :: Hardware Drivers',
77+
'Topic :: Utilities',
5378
],
5479
)

src/nvautoinstall/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
##########################################################################
2020
"""
2121

22-
__version__ = "0.3.8"
22+
__version__ = "0.3.9"

0 commit comments

Comments
 (0)