Revert "Fixed the --version command when installed from source (#344)"
This reverts commit d2dba2fc31
.
This commit is contained in:
parent
000ccf04fb
commit
3a4beb34c5
|
@ -12,7 +12,6 @@ import time
|
|||
import click
|
||||
import warnings
|
||||
import configparser
|
||||
import pkg_resources
|
||||
from math import isclose
|
||||
from pathlib import Path
|
||||
from shutil import which
|
||||
|
@ -112,7 +111,7 @@ except PermissionError:
|
|||
# display running version of auto-cpufreq
|
||||
def app_version():
|
||||
|
||||
print("auto-cpufreq version: ", end="")
|
||||
print("auto-cpufreq version:")
|
||||
|
||||
# snap package
|
||||
if os.getenv("PKG_MARKER") == "SNAP":
|
||||
|
@ -121,13 +120,19 @@ def app_version():
|
|||
elif dist_name in ["arch", "manjaro", "garuda"]:
|
||||
aur_pkg_check = call("pacman -Qs auto-cpufreq > /dev/null", shell=True)
|
||||
if aur_pkg_check == 1:
|
||||
print(pkg_resources.require("auto-cpufreq")[0].version)
|
||||
print(
|
||||
"Git commit:",
|
||||
check_output(["git", "describe", "--always"]).strip().decode(),
|
||||
)
|
||||
else:
|
||||
print(getoutput("pacman -Qi auto-cpufreq | grep Version"))
|
||||
else:
|
||||
# source code (auto-cpufreq-installer)
|
||||
try:
|
||||
print(pkg_resources.require("auto-cpufreq")[0].version)
|
||||
print(
|
||||
"Git commit:",
|
||||
check_output(["git", "describe", "--always"]).strip().decode(),
|
||||
)
|
||||
except Exception as e:
|
||||
print(repr(e))
|
||||
pass
|
||||
|
|
6
setup.py
6
setup.py
|
@ -15,11 +15,7 @@ def read(name):
|
|||
|
||||
setup(
|
||||
name="auto-cpufreq",
|
||||
version_config={
|
||||
"template": "{tag}.{sha}",
|
||||
"dev_template": "{tag}.{sha}"
|
||||
},
|
||||
setup_requires=["setuptools-git-versioning"],
|
||||
version="1.0",
|
||||
description="Automatic CPU speed & power optimizer for Linux",
|
||||
long_description=readme,
|
||||
author="Adnan Hodzic",
|
||||
|
|
Loading…
Reference in New Issue