Skip to content

Commit

Permalink
Revert "Fixed the --version command when installed from source (#344)"
Browse files Browse the repository at this point in the history
This reverts commit d2dba2f.
  • Loading branch information
AdnanHodzic committed Jan 8, 2022
1 parent 000ccf0 commit 3a4beb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
13 changes: 9 additions & 4 deletions auto_cpufreq/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import click
import warnings
import configparser
import pkg_resources
from math import isclose
from pathlib import Path
from shutil import which
Expand Down Expand Up @@ -112,7 +111,7 @@ def get_config(config_file=""):
# 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":
Expand All @@ -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
Expand Down
6 changes: 1 addition & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 3a4beb3

Please sign in to comment.