Commit Graph

105 Commits (6afadbed4c481fb435bf4c9e9e15db41e61941c3)

Author SHA1 Message Date
Åke 8a82168168 Install pep8 check as pre-commit hook (#1994)
* Install pep8 check as pre-commit hook

If no pre-commit hook exists the scripts/pre-commit will be installed as a pre-commit hook checking for PEP8 issues when making a commit. It will also allow overwriting the pre-commit hook installed by previous dev_setups.

* Ask before installation of the pre-commit hook.
2019-03-27 01:28:29 -05:00
Åke Forslund 50e5df100a Set a default locale when running dev_setup.sh
System Localisation could break the maximum-used-cores calculation when mimic is built. This sets it to a default (C) locale ensuring a reliable run.
2019-03-06 16:39:22 +01:00
Åke Forslund 811e7e37e8 Move sudo check to beginning of script
The sudo command check was performed only when packages were installed and not before the interactve portion leaving $SUDO unset when trying to create the /opt/mycroft folder.
2019-02-02 23:15:50 +01:00
Åke 2c858fba48 Add python version option to dev_setup.sh (#1952)
-p arg or --python arg allows the user to select which installed python version is used in the mycroft virtualenv.
2019-01-31 01:53:35 -06:00
Alistair Francis 50463d22f9 dev_setup: Don't abort if we don't have sudo but are running as root
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-01-22 10:43:47 -08:00
Alistair Francis 67fdc4ea10 dev_setup.sh: Use SUDO variable for all sudo commands
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-01-22 10:43:33 -08:00
Åke Forslund e24b898d09 Exit setup if pip installation fails. 2019-01-03 19:25:59 +01:00
Steve Penrod 8fe127bd5d Improve setup and start-mycroft scripts (#1924)
Improved the dev_setup.sh in several ways:
* Add 'wizard' that walks new users through setup
  - Option to put the mycroft-core/bin folder in the path
  - Option to change to 'master' instead of 'dev' branch.  This is
    usually desirable for users who only run Mycroft, not developers.
  - Option to auto-update when running Mycroft
  - Add soft link <mycroft-core>/skills to the /opt/mycroft/skills
    directory

Improve the start-mycroft.sh script
* Unify some duplicated code under init-once() function
* Add support for "auto-update", which attempts a git pull at startup
* Add require-process() function which doesn't restart already
  running services
* Add require-process for messagebus and skills services when running
  the CLI
* Tweak the --help message
2018-12-31 14:05:09 +01:00
Steve Penrod d39d049af0 Add option to skip mimic build in dev_setup.sh
Add a -sm "Skip mimic" option to dev_setup.sh which
will always prevent the download and complile of
the original Mimic.  By default, we still want to
do this all the time, but there are situations where
it is convenient to skip this time-consuming step.
2018-12-27 20:33:09 +01:00
Thomas Castleman 29063df83c bugfix/issue-1913 fixed bug with new flag (#1914)
* bugfix/issue-1913 fixed bug with new flag

- `--no-error` can be used to disable exit-on-error behaviour
- improved print out in function show_help() to take a little less time and take up a little less space by using only one `echo` command, should work the exact same otherwise.
2018-12-26 10:47:07 +01:00
Åke 1a7cb0a177 Feature/rhel (#1856)
* Add test separating centOS and Fedora

Use /etc/os-release scanning for the ID present in os-release. Which is
supported by most modern linux distributions.

* Add Redhat Enterprise Linux
2018-10-19 15:37:18 -05:00
Åke e3c26b76dc Add test separating centOS and Fedora (#1852)
Use /etc/os-release scanning for the ID present in os-release. Which is
supported by most modern linux distributions.
2018-10-19 15:18:05 -05:00
Åke Forslund 1a609159eb Checkout specific commit
Use the specific commit this has been verified with
2018-10-10 17:34:41 +02:00
jarbasal cf62dde877 Build fann from source 2018-10-10 17:34:41 +02:00
jarbasal 93d18311ed centos support 2018-10-10 17:34:33 +02:00
Åke Forslund b8373ada86 Workaround for get-pip issue
Use last version (3.3) of get-pip instead of the latest.
2018-10-06 18:04:55 +02:00
Matthew D. Scholefield bc4dfedec6
Merge branch 'dev' into feature/clean-requirements 2018-09-25 17:30:16 -05:00
Åke af1023e7a5
Merge branch 'dev' into opensuse-update 2018-09-24 09:38:59 +02:00
Steve Penrod ee685088d5
Update Arch (pacman) install for Python 3 (#1798)
Installation under Arch Linux wasn't working for many because the dependencies
hadn't been updated for Python 3.  Mycroft would only work if all of the needed
components were already installed on the user's system.

Thanks to community member Chowbok for the help straightening this out!
2018-09-18 14:39:21 -05:00
Åke Forslund 923ea9f532 Install the set pip version direct.
use get_pip.py to install the specific version of pip instead of using easy_install
2018-09-17 19:59:41 +02:00
Åke Forslund 8167d79ed8 Update packages for OpenSuse
This installs dependencies needed for running the latest version of
mycroft-core on OpenSuse
2018-09-16 15:12:48 +02:00
Steve Penrod 5e6c1773e4
Unify the command line experience across platforms (#1784)
* Unify the command line experience across platforms

Interacting with Mycroft was slightly different on different platforms
(Mark 1, Github, Picroft), which resulted in confusion and the beginnings of a
documentation/support nightmare.  This moves several of the common commands
into a mycroft-core/bin folder instead of being build in packaging or part
of the Picroft package only.

This required a small changes to the common scripts, in addition to adding
the new scripts.  Here are details:
* dev_setup.sh
  - Stubbed out a setup wizard (TODO)
  - Jumped to latest version of pip (18.0)
  - Set execution flags for new scripts
* start-mycroft.sh
  - Allow auto-execution of dev_setup.sh
  - De-sourced the stop-mycroft.sh calls (not needed)
  - Add quotes to better handle paths with spaces
* stop-mycroft.sh
  - Return exit code to show if a service was stopped or killed
  - Extend the time to wait for a gently shutdown from 2 secs to 5
  - Changed to say "messagebus.service" instead of just "service" to be more clear (the name "service" means nothing to users, but "bus does")
* venv-activate.sh
  - Added help
  - Added -q or --quiet mode
  - Added toggled availability of 'mycroft-venv-activate' and 'mycroft-venv-deactivate' aliases.  Only one is available at any given time.

New scripts:
* mycroft-cli-client: start up the CLI
* mycroft-help: shows hints on using mycroft
* mycroft-mic-test: runs the basic record/playback, playing nicely with a running Mycroft by stopping and restarting services as appropriate
* mycroft-pip: manage the venv via pip
* mycroft-say-to: send utterances, like a user spoke them
* mycroft-speak:  speaks the given phrase using Mycroft
* mycroft-skill-testrunner: invoke the single-skill test runner

All of these scripts are easy to discover by typing "mycroft-" then
hitting the TAB key.

==== INSTALLER NOTES ====
* We no longer need to create mycroft-cli-client and mycroft-pip in the Debian packages.
* mycroft-core/bin should be added to the path

* Corrections after review

Several minor corrections, plus added wrappers for the 'msm' and 'msk'
utilities.

* Set executable flag on script files in bin/

The scripts in the bin/ folder needed to be changed to executable within
git to prevent looking dirty after dev_setup.sh has been run.

* Add executable flag to one more script
2018-09-09 16:55:01 -05:00
Matthew Scholefield f5ea525d4d Skip mimic build by default
It's much more common to skip it than build it
Now, -fm forces mimic to build in contrast to the previous -sm forcing it to skip
2018-09-05 00:58:43 -05:00
Steve Penrod 1c82945576 Move logs to /var/log/mycroft/ directory
Simplifies permissions and future log-rotations to have all logs
under a single folder instead of having to give permissions to each.
2018-08-02 23:57:13 -05:00
Steve Penrod f329051743 Move logs to /var/log in all cases
Previously, the location of the log files changed depending
on whether you were running on a Mark1/Picroft or under a
"Github" install.  Now they are always under the same directory
at /var/log/mycroft-*.log

This also updates the CLI to pull from that location always.

Additionally:
* Removed the nonfunctional 'wifi' option from start-mycroft.sh
* Made the validation for dev_setup.sh exit instead of just show
  a warning message in start-mycroft.sh
* Added code to allow dev_setup.sh to be run from different
  directories successfully
2018-08-02 21:21:30 -05:00
Julien Kassar ed556b09df Standardize shell scripts (#1711)
* Standardize shebangs
* Standardize spaces
* Standardize functions declaration
* Standardize conditional constructs
* Standardize double quotes
* Standardize command substitution
* Standardize sed command
2018-08-02 14:48:47 -05:00
jwallace00 ccf52f7ace MAXCORES bug fix in dev_setup.sh (#1684)
* Ensure number of  CORES is set to 1 at a minimum when building mimic in dev_setup.sh
2018-07-16 07:10:04 +02:00
Michael P. Scherer a46c9e5671 Fixed dev_setup.sh for dnf users for python3 update (#1615)
* Fixed dev_setup.sh for dnf users for python3 update
2018-06-12 08:33:10 +02:00
Matthew D. Scholefield aa3839b24e Don't fail in dev_setup.sh if mimic fails to check version 2018-06-01 17:19:09 -05:00
Matthew D. Scholefield 1205217e25 Re-add checking of dependencies when running start-mycroft.sh 2018-05-22 11:37:17 -05:00
Åke Forslund f91a34ba82 Install test-requirements by default 2018-05-21 15:51:08 +02:00
Åke Forslund 51c21d87ad Fix not upgraded python packages 2018-05-11 16:31:04 -05:00
Åke Forslund 8c5911ecf0 Fix code standard issues
- dev_setup.sh - replace `` with $()
- mycroft/skills/core.py remove remove redundant imports
- mycroft/tts/__init__.py remove remove redundant imports
2018-05-03 12:32:21 +02:00
Matthew D. Scholefield f7f55546f3 Check for bin/activate when deciding to install venv 2018-04-27 09:14:11 -05:00
Matthew D. Scholefield de6a8f3ade Fix venv on Ubuntu 2018-04-27 09:12:17 -05:00
Åke Forslund 0b0919e542 Fix dev_setup issues
- venv is CAN be setup in custom directory
- restore package installation
- set correct package for python3-venv
2018-04-27 08:57:48 -05:00
Åke Forslund 8673f9cbb9 Replace virtualenv with python3 venv
TODO msm
2018-04-27 08:56:47 -05:00
Åke Forslund ba8cfcab30 Update dev_setup.sh to install python3
This also adds the possibility to set the environment variable MYCROFT_VENV to separate the virtual env for python3 from the stable version.

Example:
export MYCROFT_VENV=mycroft-18.02
./dev_setup.sh
./start-mycroft.sh all
2018-04-27 08:50:46 -05:00
Åke Forslund 560e4a3fef Update python-gobject-dev to python-gobject-2-dev 2018-04-18 11:04:58 -05:00
Åke Forslund 3644bfdf08 Remove s3_cmd from dev_setup
s3_cmd is only used for packaging and shouldn't be installed in
dev_setup
2018-04-18 11:04:58 -05:00
Ceda EI 9655c65686 Change libfann to fann in Arch install. 2018-04-13 15:55:57 -05:00
Greg Cowan 1fbae064cf
Fix install script for renamed module
This fixes a problem where if "mycroft-core" was already in the
virtualenv path file, but the actual name of the module wasn't,
then the dev_setup.sh would succeed but start-mycroft.sh would
fail with "No module named mycroft.version". Now dev_setup.sh
actually checks for the $TOP variable in the virtualenv path,
instead of hardcoded "mycroft-core".

==== Fixed Issues ====
Might fix issue #1419 for some rare cases.

====  Documentation Notes ====
Slightly improves the durability of the install script.
2018-03-29 23:47:30 -04:00
Åke Forslund 6f62dc2186 Add support for installing on openSuse
- Use Zypper to install packages
- use group of current user when changing owner of /opt/mycroft
2018-03-28 15:39:03 -05:00
Åke 53919d9ea6
Merge pull request #1406 from Ceda-EI/dev
Update developer setup script for arch, adding proper install of libfann
2018-02-15 09:56:16 +01:00
Ceda EI df5e9c1708 Added --noconfirm to makepkg and pacman. 2018-02-15 13:00:15 +05:30
Matthew D. Scholefield 955ed1810f
Upgrade pip version
This should resolve dependency incompatibilities and from testing still works fine
2018-02-07 12:12:52 -06:00
Ceda EI f760928264 Added installation for libfann on archlinux by building the pkgfile. Firsts checks whether libfann is installed. If libfann is not found, clones the repository, runs makepkg -srci inside and removes it 2018-02-03 18:26:46 +05:30
Matthew D. Scholefield ed00b3d666
Add build essential to Debian dependencies
Fixes #1265
2017-12-14 10:39:20 -06:00
Matthew D. Scholefield ca3874dd30 Add g++ to native dependencies (#1150) 2017-10-26 18:58:12 -04:00
Steve Penrod fef914f771 Read default MSM skills from mycroft-skills repo
Remove the hardcoded DEFAULT_SKILLS list from MSM, instead read it
from the https://github.com/MycroftAI/mycroft-skills/DEFAULT-SKILLS
list.

Additionally, a platform-specific list will also be loaded, allowing
platforms like KDE, etc. to have different defaults.  These are also
loaded from the mycroft-skills repo from a file named like:
DEFAULT-SKILLS.platform

Also began the work to support a custom local skill folder location,
specified in the /etc/mycroft/mycroft.conf.

==== Fixed Issues ====
A failed requirements.sh run would not send an install failure
notification on the messagebus.

====  Documentation Notes ====
NONE - description of a new feature or notes on behavior changes

==== Localization Notes ====
NONE - point to new strings, language specific functions, etc.

==== Environment Notes ====
MSM now uses the 'jq' utility.  This should already be installed on
a Picroft/Mark 1, but I added it to the dev_setup.sh also.
2017-10-26 15:20:42 -07:00