diff --git a/README.md b/README.md index fde2928e..85998297 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ Example of `auto-cpufreq --stats` CLI output * [Snap store](#snap-store) * [AUR package (Arch/Manjaro Linux)](#aur-package-archmanjaro-linux) * [NixOS](#nixos) + * [For developers](#installation-development-mode-only) * [Post Installation](#post-installation) * [Configuring auto-cpufreq](#configuring-auto-cpufreq) * [1: power_helper.py script (Snap package install only)](#1-power_helperpy-script-snap-package-install-only) @@ -204,6 +205,26 @@ services.auto-cpufreq.enable = true; ``` +### Installation (Development mode only) + +- If you have the poetry installed on you + ```bash + git clone https://github.com/AdnanHodzic/auto-cpufreq.git + cd auto-cpufreq + poetry install + poetry run auto-cpufreq --help + ``` + +- Alternatively, we can use editable pip install for development purposes + ```bash + git clone https://github.com/AdnanHodzic/auto-cpufreq.git + cd auto-cpufreq + # Setup your Virtual Environment (Instructions left here for brevity) + pip3 install -e . + auto-cpufreq + ``` +- Regularly run `poetry update` if you get any inconsistent lock file issues. + ## Post Installation After installation `auto-cpufreq` will be available as a binary and you can refer to [auto-cpufreq modes and options](https://github.com/AdnanHodzic/auto-cpufreq#auto-cpufreq-modes-and-options) for more information on how to run and configure `auto-cpufreq`. diff --git a/auto-cpufreq-installer b/auto-cpufreq-installer index 459628ab..72091714 100755 --- a/auto-cpufreq-installer +++ b/auto-cpufreq-installer @@ -55,12 +55,11 @@ function setup_venv { source "${venv_dir}/bin/activate" python3 -m pip install --upgrade pip wheel - python3 -m pip install -r requirements.txt } # tool install function install { - pip3 install . + python -m pip install . mkdir -p /usr/local/share/auto-cpufreq/ cp -r scripts/ /usr/local/share/auto-cpufreq/ cp -r images/ /usr/local/share/auto-cpufreq/ @@ -119,7 +118,7 @@ function manual_install { ----- - python3 setup.py install --record files.txt + pip3 install . mkdir -p /usr/local/share/auto-cpufreq/ cp -r scripts/ /usr/local/share/auto-cpufreq/ @@ -208,7 +207,7 @@ fi } function tool_remove { - files="files.txt" + # files="files.txt" share_dir="/usr/local/share/auto-cpufreq/" srv_install="/usr/local/bin/auto-cpufreq-install" @@ -249,7 +248,7 @@ function tool_remove { fi # remove auto-cpufreq and all its supporting files - [ -f $files ] && cat $files | xargs sudo rm -rf && rm -f $files + # [ -f $files ] && cat $files | xargs sudo rm -rf && rm -f $files [ -d $share_dir ] && rm -rf $share_dir # files cleanup diff --git a/requirements.txt b/requirements.txt deleted file mode 100755 index f492cac7..00000000 --- a/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -setuptools -psutil -click -distro -requests -PyGObject \ No newline at end of file diff --git a/setup.old.py b/setup.old.py deleted file mode 100644 index a643b173..00000000 --- a/setup.old.py +++ /dev/null @@ -1,44 +0,0 @@ -import os - -from setuptools import setup - -with open("README.md") as readme_file: - readme = readme_file.read() - -this = os.path.dirname(os.path.realpath(__file__)) - - -def read(name): - with open(os.path.join(this, name)) as f: - return f.read() - -# Used for the tar.gz/snap releases -VERSION = "2.0.0" - -setup( - name="auto-cpufreq", - setuptools_git_versioning={ - "starting_version": VERSION, - "template": "{tag}+{sha}", - "dev_template": "{tag}+{sha}", - "dirty_template": "{tag}+{sha}.post{ccount}.dirty" - }, - setup_requires=["setuptools-git-versioning"], - description="Automatic CPU speed & power optimizer for Linux", - long_description=readme, - author="Adnan Hodzic", - author_email="adnan@hodzic.org", - url="https://github.com/AdnanHodzic/auto-cpufreq", - packages=["auto_cpufreq", "auto_cpufreq/gui"], - install_requires=read("requirements.txt"), - include_package_data=True, - zip_safe=True, - license="GPLv3", - keywords="linux cpu speed power frequency turbo optimzier auto cpufreq", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "Operating System :: POSIX :: Linux" "Environment :: Console" "Natural Language :: English", - ], - scripts=["bin/auto-cpufreq", "bin/auto-cpufreq-gtk"], -)