Sublime Text 2 build with Grunt v0.4.0 - build

I'm trying to setup Sublime build process to run Grunt (v0.4)
This is my build snippet:
{
"cmd": ["grunt", "--no-color"],
"selector": ["Gruntfile.js"],
"path": "/usr/local/bin",
"working_dir": "${project_path}",
"osx": {
"cmd": ["grunt", "--no-color"]
}
}
When I hit Command-B I get the following error:
grunt-cli: The grunt command line interface. (v0.1.6)
Fatal error: Unable to find local grunt.
If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project. For more information about
installing and configuring grunt, please see the Getting Started guide:
http://gruntjs.com/getting-started
[Finished in 0.2s with exit code 99]
When I run grunt from the terminal everything is working.
Any ideas?

It's a "bug" of Sublime Text. When you hit Ctrl+B, it will call the build command with the first open folder as the working directory. So if you haven't opened the folder, it cannot find the build file (Makefile, or in your case Gruntfile).
So in order to build successfully, you need to put your Gruntfile in the folder as the working directory, and then open the folder in Sublime Text and hit Ctrl+B.

Before running GruntJS, you need to install it with:
npm install grunt --save-dev
In the new version of GruntJS, 'grunt' is not installed globally, so in every project you can use different versions of GruntJS.

Enter which grunt from the command line, then put the full path in the "cmd" section - for example, "cmd": ["/opt/local/bin/grunt", "--no-color"]. The $PATH for ST2 can be different from the one in your CLI environment.

Related

include sympy library into chaquo

include sympy python packages into Chaquopy:
I started with the example python provided by Chaquopy available at github (https://github.com/chaquo/chaquopy) for Android studio 3.0.1.
Than I created 2 wheel files from the sympy source () files, based on python 3.6.3, see the below files that wheel generated:
"mpmath-1.0.0-py3-none-any.whl"
"sympy-1.1.1-py3-none-any.whl"
I tried to install the above files into the build.gradle of the demo example from 1., for testing purposes I tried some of there own wheel files (that process succeeded), but could not install my own wheel files.
I am fairly certain that the local wheel files that I generated are placed in the proper directory, because if I change the directory in the gradle file it complains that it cannot find the file.
I included the wheel files in the build.gradle(Module:app) file as follows:
python {
// Enable and edit the following line if "python" is not on your PATH.
// buildPython "C:/Python27/python.exe"
version "3.6.3"
// Android UI demo
pip {
install "Pygments==2.2.0" // Also used in Java API demo
}
pip {
install "wheels/mpmath-1.0.0-py3-none-any.whl"
// install "wheels/sympy-1.1.1-py3-none-any.whl"
// install "numpy==1.9.2"
// install "numpy==1.14.0"
}
When created the build gradle generates the following error:
sympy-1.1.1-py3-none-any.whl is not a supported wheel on this platform.
Exit status 1
:app:generatePy2DebugPythonRequirements FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:generatePy2DebugPythonRequirements'.
Process 'command 'python'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 2s
7 actionable tasks: 1 executed, 6 up-to-date
Does anyone have an idea what could be wrong?
sympy and mpmath have now been added to the Chaquopy wheel repository (https://github.com/chaquo/chaquopy/issues/20), so you don't need to build your own anymore.
Did some further investigation and did see that I somehow compiled for Py2, while my wheel files where version 3 changing this resulted in a correct executable.
It did run into a different issue, while the mpmath module could be imported into the interactive python console (part of the demo app), the sympy module gave an error:
ModuleNotFoundError: no module named 'distutils'
Let me know if anyone ran into a similar problem!

How can I call Django's manage.py from GNOME Builder?

I have GNOME Builder installed on 3.24.1 installed on Ubuntu 17.04. I have a functional Django project and an associated virtualenv. (Django 1.11, Python 3)
How can I configure Builder, so that when I click Run it invokes manage.py runserver in the virtualenv? (Ideally I'd like to be able to run other manage.py functions too, like manage.py collectstatic.)
This is not really possible as Gnome-Builder works tightly integrated with flatpak. As far as I know the "hostsystem buildsystem" only supports auto detected run targets and only one of those.
However if you create a flatpak json manifest you can set the command to be run in the command variable of the json manifest - though probably not everything you want. As this means the application runs in a flatpak sandbox.
Setup
To do that you can create a new python gnome application with gnome-builder called djangoproj. This will generate a Project that uses the meson buildsystem and a org.gnome.djangoproj.json. The next thing would be to remove the gnome application - or you just ignore it and add your Django dependencies.
Add the required modules before the native modules. For just Django this is:
[…]
"modules" : [
{
"name": "python3-Django",
"buildsystem": "simple",
"build-commands": [
"pip3 install --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} Django"
],
"sources": [
{
"type": "file",
"url": "https://pypi.python.org/packages/1b/50/4cdc62fc0753595fc16c8f722a89740f487c6e5670c644eb8983946777be/pytz-2018.3.tar.gz",
"sha256": "410bcd1d6409026fbaa65d9ed33bf6dd8b1e94a499e32168acfc7b332e4095c0"
},
{
"type": "file",
"url": "https://pypi.python.org/packages/54/59/4987ae4a4a8be8507af1b213e75a449c05939ab1e0f62b5e90ccea2b51c3/Django-2.0.3.tar.gz",
"sha256": "769f212ffd5762f72c764fa648fca3b7f7dd4ec27407198b68e7c4abf4609fd0"
}
]
},
{
"name" : "djangoproj",
"buildsystem" : "meson",
[…]
If you have additional dependencies there is a handy tool to generate the necessary json lines: https://github.com/flatpak/flatpak-builder-tools/tree/master/pip
Now you can add the Django project files using the host system.
django-admin startproject sample
Meson needs to know about the new files so just add subdir('sample') to the root meson directory and create new meson files in the subdirectories. The meson.build in the sample directory looks like this for me. for the sample/sample directory you'd need to adjust the moduledir and the djangoproj_sources
pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
moduledir = join_paths(pkgdatadir, 'djangoproj')
python3 = import('python3')
conf = configuration_data()
conf.set('PYTHON', python3.find_python().path())
conf.set('VERSION', meson.project_version())
conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir')))
conf.set('pkgdatadir', pkgdatadir)
subdir('sample')
djangoproj_sources = [
'manage.py',
]
install_data(djangoproj_sources, install_dir: moduledir)
Now you can set the command in the org.gnome.Djangoproj.json to bash and after pressing launch in the window where otherwise the logs of the program appear there is an interactive shell. There you can explore your newly created flatpak with Django included in the /app/ directory. If you want to run the Django app you'd do:
$ python3 /app/share/djangoproj2/djangoproj2/manage.py runserver
you can also write this command in the command variable of the json file to launch it directly when pressing the "play"-button.
All the other commands do work too- however keep in mind that the environment is in a flatpak and recreated on every rebuild... So nothing that needs to persist can be saved in the flatpak directory.

Minko error building SDK

I am trying to compile the Minko framework on Windows 10 targeted at HTML. However, I'm hitting an error running the build_html5.bat script.
I've followed the instructions and completed all the steps (except for moving from the main branch to the dev branch, which is listed as optional). I cloned the source, set the new Environment Variable, ran the install_emscripten.bat file, and ran the specified commands in the emscripten command prompt.
However, when I try to run the build_html5.bat script, I get the following error:
I've looked in the MINKO_HOME directory and was able to find the jsoncpp.cpp file, but the jsoncpp.o file is not where in the directory specified in the command being called. The only file in MINKO_HOME/framework/obj/html5/release is a file named 'linker.rsp'.
I tried pulling down the dev branch into a different directory and updating the MINKO_HOME variable accordingly. I couldn't find the tool directory, but I was able to run the script scripts/solution_gmake_full.bat, after my first error trying to run build_html5_full.bat. When trying to run build_html5_full.bat, however, I get a different error:
Am I missing something here? Any help would be appreciated!
Sincerely,
Alex

Installing Django "open file with" message when using the "setup.py install" command

I installed the latest version of Django from here: https://www.djangoproject.com/, unzipped the file and moved it to my desktop. Took note of the file path, opened the command prompt and changed the directory to that file path and then typed 'setup.py install' it first said 'open with' and I picked to open with python.exe (the python command line) and now it says 'error: no commands supplied'.. If I try 'python setup.py install' it says "python' is not recognized as an internal or external command, operable program or batch file". Any idea why?
You need to add the python.exe file to your system PATH.
Heres a quick link on how to set/update your path on windows http://www.computerhope.com/issues/ch000549.htm
Once you have that python.exe file added to your path you can run python from the command line.

PHPUnit Extension warning in Yii

I am setting up unit testing to work with the Yii framework. Apart from Yii, my PHPUnit works great. But along with Yii when I try to test it, it gives me the following warning every time.
Warning: include(PHPUnit_Extensions_Story_TestCase.php): failed to open stream:
No such file or directory in D:\xampp\htdocs\yii1112\framework\YiiBase.php on li
ne 423
Warning: include(): Failed opening 'PHPUnit_Extensions_Story_TestCase.php' for i
nclusion (include_path='.;D:\xampp\htdocs\sms_dev\protected\extensions\yii-mail;
D:\xampp\htdocs\sms_dev\protected\extensions\giix-components;D:\xampp\htdocs\sms
_dev\protected\components;D:\xampp\htdocs\sms_dev\protected\models;D:\xampp\php\
PEAR') in D:\xampp\htdocs\yii1112\framework\YiiBase.php on line 423
I have searched a lot and have also asked in the Yii forum, but nothing seems to be working out.
Does anyone have any idea what this warning means? How can I get rid of it?
The file PHPUnit_Extensions_Story_TestCase.php is part of the package PHPUnit_Story, which can be installed with:
pear install phpunit/PHPUnit_Story
See also: PHPUnit can't find PHPUnit_Extensions_Story_TestCase. What package is missing?
The protected/tests directory is not in your include path. I would suggest moving your protected directory from any public location, and just add the protected folder to the include path. so d:\xampp\htdocs\sms_dev\protected\ instead of listing each directory seperately.
Either this is the problem or the file doesn't exist and you have to check your code.
With pear install dependencies [ Now pear packages are not updated better install with composer ]
sudo pear channel-discover pear.phpunit.de
sudo pear install phpunit/PHPUnit_Story
sudo pear install phpunit/PHP_Selenium
Better if you install phpunit with composer these errors will not come
step 1:
Create a composer.json file in your project root:
{
"require-dev": {
"phpunit/phpunit": "4.6.*",
"phpunit/phpunit-selenium": ">=1.4",
"phpunit/dbunit": ">=1.3",
"phpunit/phpunit-story": "*",
"phpunit/php-invoker": "*"
},
"autoload": {
"psr-0": {"": "src"}
},
"config": {
"bin-dir": "bin/"
}
}
step 2:
Install composer into your project using:
curl -sS https://getcomposer.org/installer | php
Ensure composer is executable:
chmod +x composer.phar
Let composer install the dependencies:
./composer.phar install --dev
Check you have a project specific phpunit version installed:
bin/phpunit --version
the above specified is a softlink
ls -la bin/phpunit
bin/phpunit -> ../vendor/phpunit/phpunit/phpunit
Afterwords you can make softlink of 'phpunit' from vendor directory into directory of php in use.
This will remove all warnings related to
PHP Warning: include(classes/PHPUnit_Extensions_Story_TestCase.php)
PHP Warning: include(): Failed opening 'classes/PHPUnit_Extensions_Story_TestCase.php'
PHP Warning: include(classes/Composer\Autoload\ClassLoader.php)