From 62ae7f0fd1c81b94e295dbe8899297531d190045 Mon Sep 17 00:00:00 2001 From: Ashvith Shetty <113123021+Ashvith10@users.noreply.github.com> Date: Wed, 11 Feb 2026 15:06:10 +0530 Subject: [PATCH] Migrate to setuptools (PEP 621) Remove requirements.txt, move project files inside `src` --- pyproject.toml | 21 +++++++++++++++++++++ requirements.txt | 3 --- src/throttled/__init__.py | 1 + mmio.py => src/throttled/mmio.py | 0 throttled.py => src/throttled/throttled.py | 2 +- 5 files changed, 23 insertions(+), 4 deletions(-) delete mode 100644 requirements.txt create mode 100644 src/throttled/__init__.py rename mmio.py => src/throttled/mmio.py (100%) rename throttled.py => src/throttled/throttled.py (99%) diff --git a/pyproject.toml b/pyproject.toml index 20ea122..8811cfb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,24 @@ +[build-system] +requires = ["setuptools>=82.0.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "throttled" +version = "0.11" +description = "Fix Intel CPU throttling on Linux" +readme = "README.md" +requires-python = ">=3.8" +dependencies = [ + "dbus-python>=1.3.2", + "pygobject>=3.48.2", +] + +[project.scripts] +throttled = "throttled:main" + +[tool.setuptools.packages.find] +where = ["src"] + [tool.black] line-length = 120 skip-string-normalization = true diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 8c6da3f..0000000 --- a/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -configparser==7.0.0 -dbus-python==1.3.2 -PyGObject==3.48.2 diff --git a/src/throttled/__init__.py b/src/throttled/__init__.py new file mode 100644 index 0000000..08dd5b3 --- /dev/null +++ b/src/throttled/__init__.py @@ -0,0 +1 @@ +from .throttled import main diff --git a/mmio.py b/src/throttled/mmio.py similarity index 100% rename from mmio.py rename to src/throttled/mmio.py diff --git a/throttled.py b/src/throttled/throttled.py similarity index 99% rename from throttled.py rename to src/throttled/throttled.py index dcd474d..aa3462c 100755 --- a/throttled.py +++ b/src/throttled/throttled.py @@ -22,7 +22,7 @@ from time import time import dbus from dbus.mainloop.glib import DBusGMainLoop from gi.repository import GLib -from mmio import MMIO, MMIOError +from .mmio import MMIO, MMIOError DEFAULT_SYSFS_POWER_PATH = '/sys/class/power_supply/AC*/online' VOLTAGE_PLANES = {'CORE': 0, 'GPU': 1, 'CACHE': 2, 'UNCORE': 3, 'ANALOGIO': 4}