danpoltawski / homebrew-mdk

A homebrew tap for Moodle MDK
5 stars 3 forks source link

Update paths to bash completion and requirements.txt #5

Open FMCorz opened 9 years ago

FMCorz commented 9 years ago

Brew info does not report the right path for the requirements file.

Also, I do not think bash completion is properly set up any more.

Cheers!

danpoltawski commented 9 years ago

Please can you provide more info. I have tested on 10.10 and 10.11 beta and can't reproduce either issue.

Brew info does not report the right path for the requirements file.

It works for me, perhaps I should be using brew --prefix but its kinda ugly in the info output and didn't think think anyone uses anything but /usr/local.

$ brew info mdk
[...]
You will need to install the some pip depdencies for example, keyring. To do this run:
    $ sudo pip install -r /usr/local/opt/moodle-sdk/libexec/moodle-sdk/requirements.txt
[...]

$  cat  /usr/local/opt/moodle-sdk/libexec/moodle-sdk/requirements.txt
keyring>=3.5
jenkinsapi==0.2.25
MySQL-python>=1.2.3
psycopg2>=2.4.5
requests>=2.2.1
watchdog>=0.8.0

Also, I do not think bash completion is properly set up any more.

Again this is working for me, with the exception of https://github.com/FMCorz/mdk/issues/39

Do you have bash-completion installed through brew and setup correctly in your bash profile (see brew info bash-completion)?

FMCorz commented 9 years ago

Thanks Dan,

I had not tried this myself, but here is the output after an install on my machine (ignore the symlink error as I have mdk manually installed). The problems I described were encountered on some other people Mac computers.

$ brew install moodle-sdk
==> Installing moodle-sdk from danpoltawski/homebrew-mdk
==> Downloading https://github.com/FMCorz/mdk/archive/v1.5.1.zip
######################################################################## 100.0%
==> Caveats
You will need to install the some pip depdencies for example, keyring. To do this run:
  $ sudo pip install -r /usr/local/opt/moodle-sdk/libexec/moodle-sdk/requirements.txt

Check for missing depencies by running:
  $ mdk doctor --dependencies

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/mdk
Target /usr/local/bin/mdk
already exists. You may want to remove it:
  rm '/usr/local/bin/mdk'

To force the link and overwrite all conflicting files:
  brew link --overwrite moodle-sdk

To list all files that would be deleted:
  brew link --overwrite --dry-run moodle-sdk

Possible conflicting files are:
/usr/local/bin/mdk -> /Users/fmc/code/python/mdk/mdk.py
==> Summary
🍺  /usr/local/Cellar/moodle-sdk/1.5.1: 62 files, 532K, built in 4 seconds
$ ls -al /usr/local/opt/moodle-sdk/libexec/moodle-sdk
ls: /usr/local/opt/moodle-sdk/libexec/moodle-sdk: No such file or directory
$ ls -al /usr/local/opt/moodle-sdk/libexec
ls: /usr/local/opt/moodle-sdk/libexec: No such file or directory
$ ls -al /usr/local/opt/moodle-sdk
ls: /usr/local/opt/moodle-sdk: No such file or directory

I did not find anything in bash completion, but maybe that's part of the way Brew does things...

danpoltawski commented 9 years ago

Run brew doctor and come back when its clean ;-)

danpoltawski commented 9 years ago

The symlink issue is completely related as far as I can tell, so when it fails on other peoples computers I am suspicious for the same.

FMCorz commented 9 years ago

The symlink is just because I had already symlinked myself to my local install of MDK. Damyon recently installed MDK on his Mac and faced the same issues than the ones I described.

danpoltawski commented 9 years ago

I did too and did not. So need the brew doctor output.

danpoltawski commented 9 years ago

Is it possible to get the brew doctor output from @damyon?

FMCorz commented 9 years ago

This is the mail @damyon sent me:

1 - I didn't want to replace the default mysql install - I won't really be using mysql so didn't want to mess with it. 2 - mdk init gives the wrong path to the default config "Use /usr/local/Cellar/moodle-sdk/1.5.1/libexec/moodle-sdk/mdk/commands/config-dist.json as documentation." 3 - had to comment the mysql import because of 1 4 - concerned about mdk using global paths to less recess shifter etc - because composer could install different versions for different branches - it would be better for mdk to run "npm install" in each git repo and then use full path to the locally installed node binaries 5 - had to do sudo easy_install pip 6 - why doesn't mac have EDITOR set ? 7 - I had some things installed before I started - brew, git, postgres, all the php extensions needed (via brew) - but would be nice to list these in the docs 8 - My internet sucks - can I have NBN please? 9 - An mdk cd "name" command would be nice to jump to instances 10 - Because this requires xcode + xcode command line tools (for brew) etc - that should be installed ahead of time

Obviously not all of it is relevant to this repo.

Bash completion is not installed on his machine.

danpoltawski commented 9 years ago

I installed on El Cap today. I had some issues with system python which I guess is related to system integrity protection, so installed the brew version and seemed ok.

$ brew tap danpoltawski/homebrew-mdk
==> Tapping danpoltawski/mdk
Cloning into '/usr/local/Library/Taps/danpoltawski/homebrew-mdk'...
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 5 (delta 0), reused 3 (delta 0), pack-reused 0
Unpacking objects: 100% (5/5), done.
Checking connectivity... done.
Tapped 1 formula (28 files, 116K)
$ brew doctor
Your system is ready to brew.
$ brew install moodle-sdk
==> Installing moodle-sdk from danpoltawski/homebrew-mdk
==> Downloading https://github.com/FMCorz/mdk/archive/v1.5.1.zip
==> Downloading from https://codeload.github.com/FMCorz/mdk/zip/v1.5.1
######################################################################## 100.0%
==> Caveats
You will need to install the some pip depdencies for example, keyring. To do this run:
  $ sudo pip install -r /usr/local/opt/moodle-sdk/libexec/moodle-sdk/requirements.txt

Check for missing depencies by running:
  $ mdk doctor --dependencies

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/moodle-sdk/1.5.1: 62 files, 532K, built in 7 seconds
$ sudo pip install -r /usr/local/opt/moodle-sdk/libexec/moodle-sdk/requirements.txt
sudo: pip: command not found
$ sudo easy_install pip
 [snip]
$ sudo pip install -r /usr/local/opt/moodle-sdk/libexec/moodle-sdk/requirements.txt
[Shedloads of output, eventually giving up with the system version of python. ]

$ brew install python
==> Installing dependencies for python: pkg-config, sqlite, gdbm
==> Installing python dependency: pkg-config
==> Downloading https://homebrew.bintray.com/bottles/pkg-config-0.28.el_capitan.bottle.2.tar.gz
######################################################################## 100.0%
==> Pouring pkg-config-0.28.el_capitan.bottle.2.tar.gz
🍺  /usr/local/Cellar/pkg-config/0.28: 10 files, 600K
==> Installing python dependency: sqlite
==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.8.11.1.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring sqlite-3.8.11.1.el_capitan.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.

OS X provides an older sqlite3.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/sqlite/lib
    CPPFLAGS: -I/usr/local/opt/sqlite/include

==> Summary
🍺  /usr/local/Cellar/sqlite/3.8.11.1: 9 files, 2.8M
==> Installing python dependency: gdbm
==> Downloading https://homebrew.bintray.com/bottles/gdbm-1.11.el_capitan.bottle.2.tar.gz
######################################################################## 100.0%
==> Pouring gdbm-1.11.el_capitan.bottle.2.tar.gz
🍺  /usr/local/Cellar/gdbm/1.11: 17 files, 524K
==> Installing python
==> Downloading https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
######################################################################## 100.0%
==> Downloading https://bugs.python.org/file30805/issue10910-workaround.txt
######################################################################## 100.0%
==> Downloading https://bugs.python.org/file40479/xcode-stubs-2.7.patch
######################################################################## 100.0%
==> Patching
patching file Include/pyport.h
Hunk #1 succeeded at 713 (offset 14 lines).
Hunk #2 succeeded at 736 (offset 14 lines).
patching file Lib/distutils/ccompiler.py
patching file Lib/distutils/unixccompiler.py
==> ./configure --prefix=/usr/local/Cellar/python/2.7.10_2 --enable-ipv6 --datarootdir=/usr/local/Cellar/python/2.7.10_2/share --datadir=/usr/local/Cellar/python/2.7.10_2/share --enable-frame
==> make
==> make install PYTHONAPPSDIR=/usr/local/Cellar/python/2.7.10_2
==> make frameworkinstallextras PYTHONAPPSDIR=/usr/local/Cellar/python/2.7.10_2/share/python
==> Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-18.3.1.tar.gz
######################################################################## 100.0%
==> Downloading https://pypi.python.org/packages/source/p/pip/pip-7.1.2.tar.gz
######################################################################## 100.0%
==> Downloading https://pypi.python.org/packages/source/w/wheel/wheel-0.26.0.tar.gz
######################################################################## 100.0%
==> /usr/local/Cellar/python/2.7.10_2/bin/python -s setup.py --no-user-cfg install --force --verbose --single-version-externally-managed --record=installed.txt --install-scripts=/usr/local/Ce
==> /usr/local/Cellar/python/2.7.10_2/bin/python -s setup.py --no-user-cfg install --force --verbose --single-version-externally-managed --record=installed.txt --install-scripts=/usr/local/Ce
==> /usr/local/Cellar/python/2.7.10_2/bin/python -s setup.py --no-user-cfg install --force --verbose --single-version-externally-managed --record=installed.txt --install-scripts=/usr/local/Ce
==> Caveats
Pip and setuptools have been installed. To update them
  pip install --upgrade pip setuptools

You can install Python packages with
  pip install <package>

They will install into the site-package directory
  /usr/local/lib/python2.7/site-packages

See: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Homebrew-and-Python.md

.app bundles were installed.
Run `brew linkapps python` to symlink these to /Applications.
==> Summary
🍺  /usr/local/Cellar/python/2.7.10_2: 6194 files, 97M, built in 109 seconds

$ pip install -r /usr/local/opt/moodle-sdk/libexec/moodle-sdk/requirements.txt
Requirement already satisfied (use --upgrade to upgrade): keyring>=3.5 in /Library/Python/2.7/site-packages (from -r /usr/local/opt/moodle-sdk/libexec/moodle-sdk/requirements.txt (line 1))
Collecting jenkinsapi==0.2.25 (from -r /usr/local/opt/moodle-sdk/libexec/moodle-sdk/requirements.txt (line 2))
  Downloading jenkinsapi-0.2.25-py2-none-any.whl (47kB)
    100% |████████████████████████████████| 49kB 1.8MB/s 
Collecting MySQL-python>=1.2.3 (from -r /usr/local/opt/moodle-sdk/libexec/moodle-sdk/requirements.txt (line 3))
  Downloading MySQL-python-1.2.5.zip (108kB)
    100% |████████████████████████████████| 110kB 1.3MB/s 
Collecting psycopg2>=2.4.5 (from -r /usr/local/opt/moodle-sdk/libexec/moodle-sdk/requirements.txt (line 4))
  Downloading psycopg2-2.6.1.tar.gz (371kB)
    100% |████████████████████████████████| 372kB 1.5MB/s 
Requirement already satisfied (use --upgrade to upgrade): requests>=2.2.1 in /Library/Python/2.7/site-packages (from -r /usr/local/opt/moodle-sdk/libexec/moodle-sdk/requirements.txt (line 5))
Collecting watchdog>=0.8.0 (from -r /usr/local/opt/moodle-sdk/libexec/moodle-sdk/requirements.txt (line 6))
  Downloading watchdog-0.8.3.tar.gz (83kB)
    100% |████████████████████████████████| 86kB 3.9MB/s 
Collecting pytz>=2014.4 (from jenkinsapi==0.2.25->-r /usr/local/opt/moodle-sdk/libexec/moodle-sdk/requirements.txt (line 2))
  Downloading pytz-2015.6-py2.py3-none-any.whl (475kB)
    100% |████████████████████████████████| 475kB 1.1MB/s 
Collecting PyYAML>=3.10 (from watchdog>=0.8.0->-r /usr/local/opt/moodle-sdk/libexec/moodle-sdk/requirements.txt (line 6))
  Downloading PyYAML-3.11.tar.gz (248kB)
    100% |████████████████████████████████| 249kB 1.3MB/s 
Collecting argh>=0.24.1 (from watchdog>=0.8.0->-r /usr/local/opt/moodle-sdk/libexec/moodle-sdk/requirements.txt (line 6))
  Downloading argh-0.26.1.tar.gz
Collecting pathtools>=0.1.1 (from watchdog>=0.8.0->-r /usr/local/opt/moodle-sdk/libexec/moodle-sdk/requirements.txt (line 6))
  Downloading pathtools-0.1.2.tar.gz
Building wheels for collected packages: MySQL-python, psycopg2, watchdog, PyYAML, argh, pathtools
  Running setup.py bdist_wheel for MySQL-python
  Stored in directory: /Users/danp/Library/Caches/pip/wheels/8c/0d/11/d654cad764b92636ce047897dd2b9e1b0cd76c22f813c5851a
  Running setup.py bdist_wheel for psycopg2
  Stored in directory: /Users/danp/Library/Caches/pip/wheels/e2/9a/5e/7b620848bbc7cfb9084aafea077be11618c2b5067bd532f329
  Running setup.py bdist_wheel for watchdog
  Stored in directory: /Users/danp/Library/Caches/pip/wheels/93/93/cf/e7a7eee3227b2720bc95e96fe35562c08224814a3adfe8e447
  Running setup.py bdist_wheel for PyYAML
  Stored in directory: /Users/danp/Library/Caches/pip/wheels/fa/db/f6/dee55793d344f1706dc4a5a693298f0115241d1085cc212364
  Running setup.py bdist_wheel for argh
  Stored in directory: /Users/danp/Library/Caches/pip/wheels/e4/96/31/ed4151f32f78e2ebec318bc7081d65077c6c1512b561d1b263
  Running setup.py bdist_wheel for pathtools
  Stored in directory: /Users/danp/Library/Caches/pip/wheels/97/d9/56/198cec194e02660d647417d4ad60f100fffc390fb46d243be5
Successfully built MySQL-python psycopg2 watchdog PyYAML argh pathtools
Installing collected packages: pytz, jenkinsapi, MySQL-python, psycopg2, PyYAML, argh, pathtools, watchdog
Successfully installed MySQL-python-1.2.5 PyYAML-3.11 argh-0.26.1 jenkinsapi-0.2.25 pathtools-0.1.2 psycopg2-2.6.1 pytz-2015.6 watchdog-0.8.3
$ mdk doctor --dependencies 
Checking dependencies
  The path to 'php' is invalid: /usr/local/bin/php
  The path to 'recess' is invalid: /usr/local/bin/recess
  The path to 'lessc' is invalid: /usr/local/bin/lessc
  The path to 'shifter' is invalid: /usr/local/bin/shifter
  The path to 'yuidoc' is invalid: /usr/local/bin/yuidoc
FMCorz commented 9 years ago

What is the most surprising is the installation of MySQL-Python and psycopg2 lol.

I'm guessing that was not a fresh install of Mac OS

danpoltawski commented 9 years ago

it was

FMCorz commented 9 years ago

OMG so great that PIP works so easily out of the box!

danpoltawski commented 9 years ago

It did not.. I installed home-brew.