Skip to content

Commit a15cb72

Browse files
committed
Update initialization and installation script
Unhook version dependencies with changelog-generator
1 parent e24e446 commit a15cb72

File tree

6 files changed

+39
-25
lines changed

6 files changed

+39
-25
lines changed

gen_docs.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ set -e
55

66
branch="$(git rev-parse --abbrev-ref HEAD)"
77
checker=$(git diff --name-only `git merge-base $branch HEAD`)
8-
if [[ ! $checker =~ "__init__.py" ]]; then
9-
echo -e "\n********************************************************************ERROR********************************************************************"
10-
echo "Docs generation was ABORTED since module version was not bumped!! Changelog generator requires the commit number and package version in sync."
11-
echo -e "*********************************************************************************************************************************************\n"
12-
exit 255
13-
fi
14-
158
if [[ ! $checker =~ "release_notes.rst" ]]; then
169
echo -e "\n********************************************************************ERROR**********************************************************"
1710
echo "Docs generation was ABORTED since release notes was not updated!! Changelog generator requires the release notes to be in sync."

jarvis_ui/__init__.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
import os
22

3-
from pynotification import pynotifier
3+
version = "0.7"
44

5-
version = "0.5.4"
5+
install_script = os.path.join(os.path.dirname(__file__), 'lib', 'install.sh')
66

77
try:
8-
import pvporcupine # noqa
9-
import pyaudio # noqa
8+
import pvporcupine # noqa: F401
9+
import pyaudio # noqa: F401
10+
import pynotification # noqa: F401
1011
except ImportError as error:
11-
pynotifier(title="First time user?", dialog=True,
12-
message=f"Please run\n\n{os.path.join(os.path.dirname(__file__), 'lib', 'install.sh')}")
13-
raise UserWarning(f"{error.__str__()}\n\nPlease run\n\n"
14-
f"{os.path.join(os.path.dirname(__file__), 'lib', 'install.sh')}")
12+
try:
13+
pynotification.pynotifier(title="First time user?", dialog=True, message=f"Please run\n\n{install_script}")
14+
except NameError:
15+
pass
16+
raise UserWarning(f"{error.__str__()}\n\nPlease run\n\n{install_script}\n\n"
17+
"Note: Shell script will quit for any non-zero exit status, "
18+
"so it might have to be triggered twice.")
1519
else:
16-
from .main import start
17-
start.count = 0
20+
from .main import start # noqa: F401

jarvis_ui/lib/install.sh

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,24 @@ os_independent_packages() {
2525
}
2626

2727
if [[ "$OSName" == "Darwin" ]]; then
28-
xcode-select --install
29-
# Looks for brew installation and installs only if brew is not found in /usr/local/bin
28+
# Looks for xcode installation and installs only if xcode is not found already
29+
which xcodebuild > tmp_xcode && xcode_check=$(cat tmp_xcode) && rm tmp_xcode
30+
if [[ "$xcode_check" == "/usr/bin/xcodebuild" ]] || [[ $HOST == "/*" ]] ; then
31+
xcode_version=$(pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version)
32+
echo "xcode $xcode_version"
33+
else
34+
echo "Installing xcode"
35+
xcode-select --install
36+
fi
37+
38+
# Looks for brew installation and installs only if brew is not found
3039
brew_check=$(which brew)
31-
brew_condition="/usr/local/bin/brew"
32-
if [[ "$brew_check" != "$brew_condition" ]]; then
40+
if [[ "$brew_check" == "/usr/local/bin/brew" ]] || [[ "$brew_check" == "/usr/bin/brew" ]]; then
41+
brew -v > tmp_brew && brew_version=$(head -n 1 tmp_brew) && rm tmp_brew
42+
echo "$brew_version"
43+
else
3344
echo "Installing Homebrew"
3445
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
35-
else echo "Found Homebrew, skipping installation"
3646
fi
3747
brew install portaudio
3848
python -m pip install PyAudio==0.2.13

jarvis_ui/lib/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
packaging==23.0
22
SpeechRecognition==3.8.1 # Do not upgrade, no functional upgrade in latest version
33
pyttsx3==2.90
4-
inflect==6.0.2
4+
inflect==6.0.4
55
requests>=2.28.2
66
pydantic[dotenv,email]==1.10.7
77
PyYAML

jarvis_ui/main.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ def start():
5555
"""
5656
# Import within a function to be called repeatedly
5757
from jarvis_ui.modules.models import env
58-
logger.info(f"Restart set to {time_converter(second=env.restart_timer)}")
58+
logger.info(f"Restart timer set to {time_converter(second=env.restart_timer)}")
5959
status_manager = Manager().dict()
6060
status_manager["LOCKED"] = False # Instantiate DictProxy
6161
process = Process(target=initiator, args=(status_manager,))
6262
process.name = pathlib.Path(__file__).stem
6363
process.start()
64-
logger.info(f"Initiating as {process.name}[{process.pid}]")
64+
logger.info(f"Initiating as {process.name} [{process.pid}]")
6565
start_time = time.time()
6666
while True:
6767
if start_time + env.restart_timer <= time.time():
@@ -89,3 +89,6 @@ def start():
8989
break
9090
time.sleep(0.5)
9191
start()
92+
93+
94+
start.count = 0

release_notes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Release Notes
22
=============
33

4+
0.5.5 (04/10/2023)
5+
------------------
6+
- Update initialization and installation script
7+
- Unhook version dependencies with changelog-generator
8+
49
0.5.4 (03/22/2023)
510
------------------
611
- Fix interactive mode on Windows OS

0 commit comments

Comments
 (0)