Tip: easy_install / pip    Posted:


With all of the exciting updates to Mercurial recently, I've been on a rampage, updating various boxes everywhere I go. I'm in the habit of using easy_install and/or pip to install most of my Python-related packages. It's pretty easy to install packages that are in well-known locations (like PyPI or on Google Code, for example). It's also pretty easy to update packages using either utility. Both take a -U parameter, which, to my knowledge, tells it to actually check for updates and install the latest version.

That's all fine and dandy, but what happens when you want to install an "unofficial" version of some package? I mean, what if your favorite project all of the sudden includes some feature that you will die unless you can have access to it and the next official version is weeks or months in the future? There are typically a few avenues you can take to satisfy your needs, but I wanted to bring up something that I think not many people are aware of: easy_install and pip can both understand URLs to installable Python packages.

What do I mean by that, you ask? Well, when you get down to the basics of what both utilities do, they just take care of downloading some Python package and installing it with the setup.py file contained therein. In many cases, these utilities will search various package repositories, such as PyPI, to download whatever package you specify. If the package is found, it will be downloaded and extracted.

In most cases, you can do all of that yourself:

$ wget http://pypi.python.org/someproject/somepackage.tar.gz
$ tar zxf somepackage.tar.gz
$ cd somepackage
$ python setup.py install

Both easy_install and pip obviously do a lot of other magic, but that is perhaps the most basic way to understand what they do. To answer that last question, you can help your utility of choice out by specifying the exact URL to the specific package you want it to install for you:

$ easy_install http://pypi.python.org/someproject/somepackage.tar.gz
$ pip install http://pypi.python.org/someproject/somepackage.tar.gz

For me, this feature comes in very handy with projects that are hosted on BitBucket, for example, because you can always get any revision of the project in a tidy .tar.gz file. So when I'm updating Mercurial installations, I can do this to get the latest stable revision:

$ easy_install http://selenic.com/repo/hg-stable/archive/tip.tar.gz

It's pretty slick. Here's a full example:

[user@web ~]$ hg version
Mercurial Distributed SCM (version 1.2.1)

Copyright (C) 2005-2009 Matt Mackall <mpm@selenic.com> and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[user@web ~]$ easy_install http://selenic.com/repo/hg-stable/archive/tip.tar.gz
Downloading http://selenic.com/repo/hg-stable/archive/tip.tar.gz
Processing tip.tar.gz
Running Mercurial-stable-branch--8bce1e0d2801/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Gnk2c9/Mercurial-stable-branch--8bce1e0d2801/egg-dist-tmp--2VAce
zip_safe flag not set; analyzing archive contents...
mercurial.help: module references __file__
mercurial.templater: module references __file__
mercurial.extensions: module references __file__
mercurial.i18n: module references __file__
mercurial.lsprof: module references __file__
Removing mercurial unknown from easy-install.pth file
Adding mercurial 1.4.1-4-8bce1e0d2801 to easy-install.pth file
Installing hg script to /home/user/bin

Installed /home/user/lib/python2.5/mercurial-1.4.1_4_8bce1e0d2801-py2.5-linux-i686.egg
Processing dependencies for mercurial==1.4.1-4-8bce1e0d2801
Finished processing dependencies for mercurial==1.4.1-4-8bce1e0d2801
[user@web ~]$ hg version
Mercurial Distributed SCM (version 1.4.1+4-8bce1e0d2801)

Copyright (C) 2005-2009 Matt Mackall <mpm@selenic.com> and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Notice the version change from 1.2.1 to 1.4.1+4-8bce1e0d2801. w00t.

Edit: devov pointed out that pip is capable of installing packages directly from its repository. I've never used this functionality, but I'm interested in trying it out sometime! Thanks devov!

Comments

Programmers Are Tiny Gods    Posted:


I stumbled across this article in my daily RSS feeding ritual. The article itself it quite short and to the point--only 9 brief paragraphs. The author brings up some valid points and uses the metaphor of programmers being "tiny" gods. Here's my favorite paragraph.

Like designers, if you give a programmer a problem with parameters, they’ll apply every bit of genius they have to solve it in the best possible way. If you tell them how to do it, you’ll suffer the wrath of an angry God.

"...be ye therefore wise..."....

The article: http://powazek.com/posts/1655

Comments

The Teton Dam    Posted:


Ported From Blogger

The following post was ported from my old blogger account.

Yesterday Mindy and I went to check out the Teton dam since it began to rain. We had previously planned on playing a game called trackball, but I don't think it would have been any fun at all if it were raining the whole time. Mindy had never been to the Teton dam before, so I figured it might be a good activity.

I was surprised to find out that my little Honda Civic could make it all the way down to the bottom and then back up the steep road that goes down to the bottom of the valley. Mindy and I just played around near the water for a while, skipping stones and talking... Eventually we decided that it was time to go back to Rexburg.

We stopped by Jamba Juice to get some tasty beverages, after which we went up to Mindy's place to get the trackball game. The rain had cleared out pretty well, and the sun started to shine again. We finally got to play trackball. heh... so yeah, we walked on down to the park where we wanted to play.

Right as we entered the park, we saw a couple laying on a blanket having what seemed to be a very enjoyable time together. Both Mindy and I just thought, "GET A ROOM!!!" Anyhow, we sat under a tree not too far away from them to enjoy the company and the beverages. At a certain point in time, we both looked over at the couple on the blanket. Come to find out that we're both quite familiar with the two individuals. We just laughed at them for a while and then took off to the other side of the park to play. I found it to be a rather humorous situation, personally.

Trackball is actually pretty fun, if you have the wind going the direction you have to throw anyway. Each player has a little whatchamacallit that looks like a lacrosse, only it has a much shorter handle. One player will lob a plastic ball towards another player, and they are to catch the ball in the whatchamacallit. The process continues indefinitely. It's great fun. I found that I'm not very good at the lobbing part, no matter which direction the wind is blowing. Mindy is pretty dang good at trackball, and I kinda feel bad that my nerdiness overpowers my physical activity now. hah

After playing trackball for a while, we found another pleasant tree to chill under. We talked about a lot of things. Life is absolutely beautiful with Mindy in my arms. Ahh..

Comments

Is It Real?!?    Posted:


Ported From Blogger

The following post was ported from my old blogger account.

Ok, I have to say that I had suspicions of what I last posted about being a dream. Honestly! I was not quite sure that it had actually happened, since it's not exactly an everyday occurrence. Somehow it just seemed like one of those dreams that are so pleasant when you experience them but that are also just temporary. I'm pretty sure it wasn't a dream now, but there are still suspicions lingering (it all just seems too good to be true!)...

So last night, I had the opportunity to see Mindy again. At first, it appeared as though it was all my imagination driving me crazy. Nothing seemed to really be different than before the previous night's dream. Then we started talking a bit and we talked about a few things we had discussed the night before (or in the previous dream). That's what comforted me--that she was conscious of the evening before (perhaps it wasn't just in my head after all).

We went for a nice stroll again, and we ended up at the campus stadium. We hiked up to the very top and just chilled for a while. It was nice to be able to just chat as we did. She started to get shivers, so I started thinking of things that we could do to warm up a bit. Mindy loves to dance. It is her most favorite thing to do, according to another conversation that we had. With that in mind, I asked if she wanted to dance a bit. Heh...you should have seen the confused look on her face. It was classic! Anyway, when she saw that I was serious, she agreed to dance a bit. Now, you all have to understand that I do not know how to dance worth beans. Lucky for me, Mindy knows how and actually likes to teach people how to dance. I'm afraid I may be a lost cause though. Mindy tried to teach me how to do a simple waltz on top of the stadium...aahh brotha. Let me tell you... As simple as it may seem, it sure did confuse me. Perhaps I just need a little more practice (I hope).

Eventually the chilliness of the evening breeze became a bit too much, so we walked back to Mindy's place. Once there, we happened upon our good buddies Matt and Kara. They seemed to be having a jolly time together, but Mindy and I thought it more appropriate not to interrupt their bliss for too long, so we took off again. This time we went to a nice park thinger away from all of the city lights and looked at the stars until the cold became too much again. We got to see a fabulous shooting star or possibly even a meteor. That was Mindy's first time to see a shooting star, and it was probably the most amazing one I've ever seen. It was rather large and not exactly fast-moving. There wasn't a tail on it until after we both saw it. Then the tail grew to be pretty long until it all disappeared. It was fantastic!

That is about the time that we walked back to Mindy's pad and said good night. I also seem to remember setting up a time and place for us to meet a bit later today. I suppose that if Mindy is actually there then all of my suspicions of these experiences will be put to rest. I will then accept the idea that it's not just my whacky imagination playing sick and drawn-out tricks on my mind. For all I know I'm actually just dozing off at work right now and dreaming that I am writing all of this. Weird.

Comments

Yes, I am a happy man.    Posted:


Ported From Blogger

The following post was ported from my old blogger account.

It appears that the dates that Matt and I went on with Kara and Mindy have good effects! Mindy was gone most of this past weekend at a wedding. She returned home last night and said that we (Matt and I) could come over and hang out if we wanted to. I figured that it would be good to give her a little bit of time to unwind after all the travelling she had been through, but she didn't seem to need it.

So we went over to their pad and right as the door opened and we stepped inside, Mindy comes up to me and hugs me! I was like, "Wow...that's cool. I can deal with that." It was a little unexpected but definitely welcomed. Anyway, we had some good times playing card games and making cookies and whatnot. They even let me use their 'scrumptious'-smelling soap that they bought from Bath and Body Works on our first date. Amazing.

The card games were getting a bit involved, so we decided to move it outdoors. Mindy's knees were bothering her from sitting down as long as she had been that day, so we went for a nice stroll around campus. I quite enjoyed it. Eventually, the others (Matt, Kara, Cyndra, and Athena) decided to join us in a pleasant walk, but we were devious and decided to go our own way.

Mindy and I took a nice walk in the gardens on campus and we found a nice spot to chill. We talked about a lot of things, but eventually we started talking about more serious matters. All I have to say about that to the world is, "Yes, I am a happy man." As we walked back to Mindy's place we had a nice, cosy chat. I repeat, "Yes, I am a happy man."

When I got home, I came across Matt at his computer. He seemed to be having a blast! He was chatting with Kara online and things seemed to be going well with them. Matt was a little confused when he decided to go back to our apartment, but his little conversation with Kara afterwards cleared things up quite a bit. I guess the actual condition of their relationship is still pending, but it's looking pretty good. I'm sure Matt would join me in proclaiming, "Yes, I am a happy man."

And this is what becomes of a surprise date for all but one involved. Grand, isn't it?

Comments