Make TortoiseHG use my Python installation - mercurial

I created some python hooks for Mercurial that use some external libraries (namely jira-python). In Linux, I install the packages using pip. In Windows, however, Mercurial comes with a bundled version of Python. My hooks fail when I run them because the external packages are not installed.
I want to make Mercurial / TortoiseHG use my Python installation so I can control its environment. How can I do that?

You can install Mercurial package for Python:
Mercurial 2.4 Python 2.7 package - x86 Windows
Mercurial 2.4 Python 2.7 package - x64 Windows
For TortoiseHG-specific details I can suggest to inspect %TortoiseHg%\library.zip - it contains (some? all?) needed for TortoiseHG|Mercurial Python's modules, which list you can (try) to extend: "in Where is the Python path for TortoiseHG?" topic Steve Borho wrote:
TortoiseHg's entire python environment is contained within the library.zip that comes packaged
with it.
What I suspect you can do is add a line or two to the top of your reviewboard extension file to add your installed python path to sys.path before trying to import simplejson
Hint for adding python path to sys.path is applicable for you too
Recommendation from Convert Extension page
you'll need to use a Mercurial installed on top of a stand-alone Python, and you may also need to do something like
set HG=python c:\Python25\Scripts\hg
to override the default Win32 binaries if you have those installed also

I have Mercurial installed through pip, and I also have TortoiseHg. My system path selects the Python version first.
I renamed C:\Program Files\TortoiseHg\hg.exe to something else, and then ran TortoiseHg. Everything still worked, but I haven't got a good way of verifying it does what you want. You can give it a shot.

Related

Octave - How to install packages on Windows

Question
Due to the issue in Fix for Octave urlread causing Peer certificate cannot be authenticated with given CA certificates, I cannot install Octave packages on Windows.
Please suggest other ways to install. Particularly I would like to go through Gradients, Gradient Plots and Tangent Planes which requires Symbolic package.
EDIT: this bug is no longer present in Octave v4.2.1, and the issue described in the Question should no longer occur.
Yes, there appears to be a known issue logged on the bug tracker with the current release version of Octave (4.2.0) on windows being unable to connect to https due to the curl issue you identified in the linked discussions/questions. That bug report and the original help list discussion summarize the certificate issue and problem verification. It should be fixed in the next Octave release.
This, however, does not prevent you from installing packages. It only prevents you from using the program to go fetch packages to be installed. You are still able to go to the Octave Forge package site, manually download a package file, and then as described in the Octave manual and help for pkg run the install command.
E.g., you could download symbolic-2.4.0.tar.gz and save it to your current working directory. Then within octave, issue the following from the command line:
pkg install symbolic-2.4.0.tar.gz
NOTE: symbolic currently requires Python and Sympy installed. If you don't already have this on your Windows machine, the package maintainer has a separate self-contained package for Windows that can be obtained from the author's github repository. In this case you would download the package and run the command:
pkg install symbolic-win-py-bundle-2.4.0.zip
Another more tedious option would be for you to compile your own copy from development sources, as the fix has supposedly been pushed to the mxe-octave repository.

phpstorm cannot find class ZMQContext

Hi I'm creating project according to Tutorial on Ratchet website.
I installed zeromq version 0.3.0 through composer in phpstorm.(I checked if I installed right zeromq with phpinfo() and also with php-m in terminal)
In file post.php I cannot create new object of class ZMQContext(). - php storm cannot find this class.
I found the same issue on stackoverflow but solution is for linux.I'm using win.
When I want to use this in code: use React\ZMQ. - I don't see there class ZMQContext
Thanks for answer.
You can get PHPStorm to auto-complete code that uses the ZMQ PHP extension.
Save this stub file: https://gist.github.com/Mikulas/c22e44a918c7af5de5e6
I saved it (on OSX) under /Applications/PhpStorm EAP.app/Contents/plugins/php/lib/extensions/zmq.php
Then go to PHPStorm > Preferences > Languages & Frameworks > PHP > include path and add that extensions folder.
Now go back to your file and you'll see PHPStorm auto-completing stuff from the ZMQ extension.
Have fun! I hope you'll find this useful.
It looks like you've installed the PHP PECL extension. You also need to install the ZeroMQ library on your system that ext-zmq will use. If you're an a Debian based system try sudo apt-get install libzmq-dev or a RH based system sudo yum install zeromq zeromq-devel.

how to build hxselect with mingw?

I downloaded html-xml-utils-6.5.tar.gz and started compiling hxselect.c with mingw. I need a makefile, but the package is designed to generate the makefile. The build instructions are in a configure script, config.h.in file and makefile.in.
Is there a mingw-compatible tool to help generate the makefile? I am considering making a linux machine so I can run the configuration to get the generic makefile, and then bring that back for mingw to start chewing on...
Is there an easier way?
Thanks !
Assuming you've downloaded and installed mingw from [1], launch the MinGW Shell
from the start menu and then cd to directory containing the configure script and proceed as you typically do with autotools based projects:
./configure
make
make install
The purpose of MinGW is in fact to make available to Windows a minimalistic GNU environment (meaning shell and other tools) which allow you to work (mostly) as you would in an operating system with a full-fledged GNU userland (such as GNU/Linux). Occasionally it seems that MinGW is used to denote the windows port of the gcc compiler, but it should be empathized that MinGW actually denotes the Windows port of a (minimalistic) GNU environment.
[1] http://www.mingw.org/

nuget package restore with MonoDevelop

I have a solution that is primarily developed in Visual Studio 2012. I would like to develop in MonoDevelop without major incompatibilities.
Thus far, I have installed mrward's nuget addin for MonoDevelop and things work if I manually add each package in packages.config through that interface. However, this is highly onerous. This addin doesn't have support for automated package restore as of this writing.
I downloaded nuget.exe from CodePlex ("NuGet command line utility", as it's labeled). I use a simple find/xargs combination to install all required packages:
find . -name packages.config | xargs -I '{}' mono nuget.exe install '{}'
This creates several dozen directories in the directory from which it is run instead of putting things under packages/ as expected, and it also doesn't touch the project files so MonoDevelop still thinks that it should be looking for package references in the directory from which MonoDevelop was started.
I therefore opened MonoDevelop from the working directory that contains all of these package folders, and I still get invalid references. I think this is probably because the project is looking for package_name/ reference, but the folders are name package_name.version/ in the working directory.
Any suggestions for a sane, simple way to interact with this solution? I'm next going to try modifying my shell command so that it automatically drops to project/packages and runs nuget from that directory.
Did you try using the -o command line parameter with NuGet.exe? You can use that to get the packages to install into a particular packages folder.
The NuGet addin for MonoDevelop supports package restore from version 0.6 or above. Right click your project and select Restore Packages. This will download all the packages defined in your packages.config for all projects in the solution. It uses NuGet.exe to do this.
Another way to get this working is to use the custom NuGet MSBuild target so the package restore happens at build time when using xbuild. It would require some manual editing of project files though. Under the covers the custom MSBuild target just uses NuGet.exe with a similar command line to what you have already just with the output directory option specified. So I would try the command line approach since that will be less work.
You would have to get the following files from the NuGet repository on codeplex:
NuGet.exe
NuGet.targets
NuGet.config
Put these in a directory somewhere. Typically these are put in a .nuget directory in the same directory as your solution file. Then you need to edit your project files to include the NuGet.targets file and also define the SolutionDir property. So something like this:
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" />
You will also need to enable package restore on your machine. You can do this using the NuGet addin for MonoDevelop in the Options dialog. Under Linux this is available from the Edit menu under Preferences. Then look in the NuGet - General options and there is a checkbox for enabling package restore.
There is an example project on GitHub created by Jonathan Channon which uses package restore and works when building with xbuild inside MonoDevelop. There is also an issue on GitHub about using NuGet restore on Linux which might be helpful.
Update: 2014-05-14: NuGet addin for MonoDevelop now supports package restore.

location of octave header files

I am trying to use Octave as an external solver in my C/C++ code.
I read here that one needs to include the octave/oct.h header file. However I am not able to find it on my computer. I have searched everywhere including the octave root directory version 3.0.5.
What should I do?
I found it in my Octave 3.2.2 installation in Windows: C:\Octave\3.2.2_gcc-4.3.0\include\octave-3.2.2\octave.
Are you using another operating system? If so, you may need to install the headers separately. For example, Ubuntu 10.10 has a separate octave3.2-headers package.
If you are using Windows and your Octave installation does not have the headers, you could try upgrading to 3.2.2 or greater. I got the Windows installer from Octave-Forge.
For newer versions on Ubuntu, e.g., Octave 3.8.1, the package you must install to get the headers is now called liboctave-dev
The include folder of the Octave 4.0.0 installed on Ubuntu can be found at /usr/include/octave-4.0.0/octave.