diff --git a/.gitignore b/.gitignore index 8d2e3d3..e3a3e63 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ /liquidctl-v1.7.1.tar.gz /liquidctl-v1.7.2.tar.gz /liquidctl-v1.8.0.tar.gz +/liquidctl-1.9.0.tar.gz diff --git a/liquidctl.spec b/liquidctl.spec index cb9f2c2..93cbde1 100644 --- a/liquidctl.spec +++ b/liquidctl.spec @@ -1,12 +1,20 @@ -Name: liquidctl +Name: liquidctl +%global pypi_name %{name} + Summary: Tool for controlling liquid coolers, case fans and RGB LED strips License: GPLv3+ -Version: 1.8.0 +Version: 1.9.0 Release: 1%{?dist} URL: https://github.com/jonasmalacofilho/liquidctl -Source0: %{URL}/archive/v%{version}/%{name}-v%{version}.tar.gz +Source0: %{pypi_source} + +# Starting with v1.9.0, liquidctl switched to using a PEP 517 build. +# However, on F35/34, not all of the dependencies needed to make this work +# are available. As such, we add a setup.py file (lifted straight from v1.8.0) +# and use the old build & install method instead. +Source10: setup.py BuildArch: noarch BuildRequires: python3-colorlog @@ -16,9 +24,12 @@ BuildRequires: python3-docopt # but the test suite fails with 0.7.99.post20 BuildRequires: python3-hidapi >= 0.9.0 BuildRequires: python3-i2c-tools +BuildRequires: python3-pip BuildRequires: python3-pytest BuildRequires: python3-pyusb BuildRequires: python3-setuptools +BuildRequires: python3-setuptools_scm +BuildRequires: python3-wheel BuildRequires: systemd-rpm-macros # i2c-tools are unavailable on s390{,x} @@ -57,9 +68,23 @@ Suggests: %{name}-udev = %{version}-%{release} - NZXT Kraken Z53, Z63, Z73 \ %global supported_devices_experimental \ +- ASUS Strix GTX 1050 OC, 1050 Ti OC \ +- ASUS Strix GTX 1060, 1060 OC \ +- ASUS Strix GTX 1070, 1070 Ti, 1070 Ti Advanced \ +- ASUS Strix GTX 1080 Ti, 1080 Ti OC \ +- ASUS Strix GTX 1650 Super OC \ +- ASUS Strix GTX 1660 Super OC, 1660 Ti OC \ +- ASUS Strix GTX 2060 Evo, 2060 Evo OC, 2060 OC \ +- ASUS Strix GTX 2060 Super Advanced, Super Evo Advanced, Super OC \ +- ASUS Strix GTX 2070 Advanced, 2070 OC \ +- ASUS Strix GTX 2070 Super Advanced, Super OC \ +- ASUS Strix GTX 2080 OC, 2080 Super Advanced, 2080 Super OC, 2080 Ti \ +- ASUS TUF RTX 3060 Ti OC \ - Corsair Commander Core \ - Corsair Hydro GT/GTX H80i, H100i, H110i \ - Corsair iCUE Elite Capellix H100i, H115i, H150i \ +- EVGA GTX 1070 FTW, 1070 FTW DT Gaming, 1070 FTW Hybrid \ +- EVGA GTX 1070 Ti FTW2 \ - NZXT Kraken X40, X60 \ %description @@ -99,6 +124,7 @@ when ran by an unprivileged user. %prep %setup -q -n %{name}-%{version} +cp -a %{SOURCE10} ./ %build @@ -129,7 +155,7 @@ XDG_RUNTIME_DIR=$(pwd)/test-run-dir pytest-3 %files -%doc CHANGELOG.md README.md +%doc CHANGELOG.md FUNDING.md README.md %doc docs/ %{_bindir}/%{name} %{_mandir}/man8/%{name}.* @@ -145,6 +171,10 @@ XDG_RUNTIME_DIR=$(pwd)/test-run-dir pytest-3 %changelog +* Tue Apr 05 2022 Artur Frenszek-Iwicki - 1.9.0-1 +- Update to v1.9.0 +- Switch to downloading sources from PyPi + * Thu Jan 06 2022 Artur Frenszek-Iwicki - 1.8.0-1 - Update to v1.8.0 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..df0a097 --- /dev/null +++ b/setup.py @@ -0,0 +1,115 @@ +import os +import subprocess +import sys + +import setuptools +from setuptools.command.develop import develop + + +def get_static_version(): + """Read manually attributed version number. + + Note: the version number only changes when releases are made.""" + with open('liquidctl/version.py', 'r') as fv: + vals = {} + exec(fv.read(), vals) + return vals['__version__'] + + +def make_pypi_long_description(doc_url): + """Generate custom long description for PyPI.""" + with open('README.md', 'r', encoding='utf-8') as fh: + continuation = ('For which devices are supported, installation instructions, ' + 'a guide to the CLI and device specific details, check the ' + 'complete [Documentation]({}).').format(doc_url) + long_description = (fh.read().split('', 1)[0] + + continuation) + return long_description + + +def get_git_version(): + """Check that `git` is accessible and return its version.""" + try: + return subprocess.check_output(['git', '--version']).strip().decode() + except: + return None + + +def make_extraversion(editable=False): + """Compile extra version information for use at runtime. + + Additional information will include: + - values of DIST_NAME and DIST_PACKAGE environment variables + - whether the installation is running in develop/editable mode + - git HEAD commit hash and whether the tree is dirty + """ + extra = {} + extra['dist_name'] = os.getenv('DIST_NAME') + extra['dist_package'] = os.getenv('DIST_PACKAGE') + extra['editable'] = editable + if get_git_version() and os.path.isdir('.git'): + rev_parse = subprocess.check_output(['git', 'rev-parse', 'HEAD']).strip().decode() + describe = subprocess.check_output(['git', 'describe', '--always', '--dirty']).strip().decode() + extra['commit'] = rev_parse + extra['dirty'] = describe.endswith('-dirty') + with open('liquidctl/extraversion.py', 'w') as fv: + fv.write('__extraversion__ = {!r}'.format(extra)) + + +class custom_develop(develop): + def run(self): + make_extraversion(editable=True) + super().run() + + +HOME = 'https://github.com/liquidctl/liquidctl' +VERSION = get_static_version() +SUPPORTED_URL = '{}/tree/v{}#supported-devices'.format(HOME, VERSION) +DOC_URL = '{}/tree/v{}#liquidctl--liquid-cooler-control'.format(HOME, VERSION) +CHANGES_URL = '{}/blob/v{}/CHANGELOG.md'.format(HOME, VERSION) + +make_extraversion() + +install_requires = ['docopt', 'pyusb', 'hidapi', 'colorlog'] + +if sys.platform == 'linux': + install_requires.append('smbus') + +setuptools.setup( + name='liquidctl', + cmdclass={'develop': custom_develop}, + version=VERSION, + author='Jonas Malaco', + author_email='jonas@protocubo.io', + description='Cross-platform tool and drivers for liquid coolers and other devices', + long_description=make_pypi_long_description(DOC_URL), + long_description_content_type='text/markdown', + url=HOME, + packages=setuptools.find_packages(), + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: End Users/Desktop', + 'Intended Audience :: Developers', + 'Topic :: System :: Hardware :: Hardware Drivers', + 'Operating System :: OS Independent', + 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + ], + keywords='cross-platform cli driver corsair evga nzxt liquid-cooler fan-controller ' + 'power-supply led-controller kraken smart-device hue2 gigabyte', + project_urls={ + 'Supported devices': SUPPORTED_URL, + 'Documentation': DOC_URL, + 'Changelog': CHANGES_URL, + }, + install_requires=install_requires, + python_requires='>=3.7', + entry_points={ + 'console_scripts': [ + 'liquidctl=liquidctl.cli:main', + ], + }, +) diff --git a/sources b/sources index 4b87b91..babb069 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (liquidctl-v1.8.0.tar.gz) = 80970b1d9efe37235ec7934f960819caf0ea23bd815f1466a130895c699094a75268a99a9bbcfa356bae7c1410945fa1251f3a98819a48f5eef72898a8c33c3b +SHA512 (liquidctl-1.9.0.tar.gz) = 7651a24878a49ee659fa7ee59b197a3e50bb44ee3cf1d41cb2144219e206f55ff5220efd87e2ca5092fa89e0b1a5f154a2a824d52e676400eb71b8c50439a44f