After looking at the new stuff available in unit tests:
http://docs.python.org/library/unittest.html
I am really sold! At a mere glance I can already see two things that would be supremely useful in cleaning up my tests which is:
doCleanups
and
assert*Equal
Especially the assertTupleEqual and assertListEqual is really really nice where in the difference of the two sets are compared and the diff included in the failed message. We are using Ubuntu on all of our tests machines so I really hope that the stock Python that comes with the next version of Ubuntu is the 2.7.x branch. The assertAlmostEqual seems a bit dodgy to me but then again I still haven't really gone in depth with the docs yet.
What would be a nice addition for me would be 'assertTextFileEqual' or something to that end. This would be a great shortcut for me as I do a lot of text file reading and asserting in my tests.
All in all kudos to the changes made in the unit test module of Python and I like the direction that it's heading.
Sunday, October 9, 2011
Thursday, September 22, 2011
Where is that missing recursive chown for Python
A question from a colleague of mine prompted me on a week long search for a recursive chown for Python. Initially I just thought that it was due to his inexperience that he was unable to find an answer as a recursive chown sounds too easy of a function for Python not to have. Alas, however after on and off scouring the net I found that the closest (and the best) answer to what he was looking for is actually This stack overflow question. Ruby has their built into the Fileutils library which really prompted this post.
Also on a less cursory glance I notice that the ruby standard lib has some functions which I really wished Python has which would make a probably transition from my bunch of work horse bash script to a Ruby platform that much easier. They have cp, cp_r and even a diff! Nice!
Has there been any attempt of making this easier in Python? If someone knows better please enlighten me, as this just seems too easy for Python not to have.
Labels:
python
Tuesday, June 14, 2011
Finally! 2.6.38-9 is it!
It took 9 revisions but as of kernel 2.6.38-9, my arch box can now reboot and halt fine (just need to put 'rmmod e1000e' in /etc/rc.local.shutdown) and I can live with it for now. For the longest time (about 2 months) after upgrading to 2.6.38 my box just would not reboot or poweroff without hanging and I was actually toying around with idea of replacing my Arch with Fedora 15.
The relevant posts:
1. Arch Forums
2. Kernel bugzilla
I wonder what magicks was sprinkled on this latest stable kernel. Wish there was like someway to read changelogs for revisions on the command line just before I do a 'pacman -Syu', or is there really a changelog maintained for the kernel? From the looks on the kernel bugzilla, it doesn't seem to be moving at all at the moment.
The relevant posts:
1. Arch Forums
2. Kernel bugzilla
I wonder what magicks was sprinkled on this latest stable kernel. Wish there was like someway to read changelogs for revisions on the command line just before I do a 'pacman -Syu', or is there really a changelog maintained for the kernel? From the looks on the kernel bugzilla, it doesn't seem to be moving at all at the moment.
Labels:
archlinux
Friday, June 10, 2011
systemd for opensuse
As a guy who use openSuSE daily for my work, I like the direction that openSuSE has been treading in the past and now. I am not that intune with the community but then the direction they always take seem to walk the fine line between bring in the latest and greatest changes and maintaining a stability that allow for the majority of the users being able to use it for work. While guys like Fedora and Arch seems to throw caution to the wind bring in the changes with seemingly little regard for stability, openSuSE in my books have always been successful at the almost impossible task of maintaining a stable environment with the slew of changes coming from all directions. One thing that comes to my mind when writing this is their decision to maintain kde3 together with kde4 when kde4 was born to aid the transition 4.x.
With this in mind I look forward to the systemd integration into OpenSuSE planned for 12.1. Looks like there are a lot of overwhelming wins using systemd compared to the old systems. I was beginning to think that the OpenSuSE camp was a bit quiet compared to Ubuntu opting for upstart and Fedora going the Plymouth way. The only downside I can see for this is that untypical of something that is usually brought into the OpenSuSE, systemd seems to be the youngest of all the projects and I envision a lot of work ahead to stabilize it down for the future. This is something that I am definitely looking forward to in the Roadmap for openSuSE.
With this in mind I look forward to the systemd integration into OpenSuSE planned for 12.1. Looks like there are a lot of overwhelming wins using systemd compared to the old systems. I was beginning to think that the OpenSuSE camp was a bit quiet compared to Ubuntu opting for upstart and Fedora going the Plymouth way. The only downside I can see for this is that untypical of something that is usually brought into the OpenSuSE, systemd seems to be the youngest of all the projects and I envision a lot of work ahead to stabilize it down for the future. This is something that I am definitely looking forward to in the Roadmap for openSuSE.
Labels:
opensuse
Tuesday, April 12, 2011
Packaging python packages in opensuse
While getting one of my packages rejected for inclusion into the python lang repo for openSuSE, the comments made by the reviewer pointed me to find the package: py2pack.
This package made the packaging of Python packages on OpenSuSE brain dead easy by doing all of the heavy lifting, creating a sample spec file that really needs very little editing. Install py2pack, and follow this guide, http://en.opensuse.org/openSUSE:Packaging_Python#The_fast_and_automated_way and put that together with the great openSuSE build service and you will have a great time packaging which is usually a thankless job no one wants to do.
Update:
Wow the ruby packaging method is about the same too: http://en.opensuse.org/openSUSE:Packaging_Ruby
This package made the packaging of Python packages on OpenSuSE brain dead easy by doing all of the heavy lifting, creating a sample spec file that really needs very little editing. Install py2pack, and follow this guide, http://en.opensuse.org/openSUSE:Packaging_Python#The_fast_and_automated_way and put that together with the great openSuSE build service and you will have a great time packaging which is usually a thankless job no one wants to do.
Update:
Wow the ruby packaging method is about the same too: http://en.opensuse.org/openSUSE:Packaging_Ruby
Sunday, March 13, 2011
opensuse 11.4 a quick disappointed look... part2
I will just add closure to this story. After the upgrade botched up, I reluctantly tried to reinstall my server leaving the home volume untouched. That turned out to be a pleasant surprise because of a few things:
1. 'import setup' of partitioning. Love that! Allowed me to copy over my old partition settings. Saves a whole lot of pain.
2. Seamless update after that X worked and everything else worked 'out of the box'.
The only draw back probably is to reinstall a few of the application I have running on the box that is not in the stock install. I am going to put back a few of the points I took away the day before when the upgrade fuched up.
So if you are upgrading from 11.3 to 11.4 you might want to use the reinstall path. It might turned out to be better and smoother.
1. 'import setup' of partitioning. Love that! Allowed me to copy over my old partition settings. Saves a whole lot of pain.
2. Seamless update after that X worked and everything else worked 'out of the box'.
The only draw back probably is to reinstall a few of the application I have running on the box that is not in the stock install. I am going to put back a few of the points I took away the day before when the upgrade fuched up.
So if you are upgrading from 11.3 to 11.4 you might want to use the reinstall path. It might turned out to be better and smoother.
Labels:
opensuse
Saturday, March 12, 2011
opensuse 11.4 a quick disappointed look...
On the upfront, openSuSE's upgrade has always impressed me with it's smoothness. While others falter, openSuSE's upgrade process just chugs along and everything is up and running at the end of it. I did the online upgrade with one of my boxes while the other used the DVD method with 11.3 and both went without a hitch.
Along came 11.4 and I did not hesitate based on my past experiences, but boy was I wrong. Right after the upgrade my box booted up to no Xdisplay, no sax2 (wtf ! I know I should have read the release notes, but then no alternatives ?!). The no display I can deal with but the next bit really took me for a doozer. The network did not start up even though it was in runlevel 5. Initially I thought it was because my network card was left un configured but configuration and 6 reboots later did not solve the problem. I resigned myself to a putting 'rcnetwork start' to /etc/rc.d/boot.local.
I did not find other people with the same problem querying uncle google, but for the life of me I can't get it to work. It would just boot up and say that it has reached runlevel 3 or 5 but then I have to manually start up networking using 'rcnetwork start'. These problems really surprised me as openSuSE prior to this has always good to me and upgrades works right from version 10.3 to 11.3 without problems. I guess I got to stop boasting to people how good openSuSE is ... :(
Along came 11.4 and I did not hesitate based on my past experiences, but boy was I wrong. Right after the upgrade my box booted up to no Xdisplay, no sax2 (wtf ! I know I should have read the release notes, but then no alternatives ?!). The no display I can deal with but the next bit really took me for a doozer. The network did not start up even though it was in runlevel 5. Initially I thought it was because my network card was left un configured but configuration and 6 reboots later did not solve the problem. I resigned myself to a putting 'rcnetwork start' to /etc/rc.d/boot.local.
I did not find other people with the same problem querying uncle google, but for the life of me I can't get it to work. It would just boot up and say that it has reached runlevel 3 or 5 but then I have to manually start up networking using 'rcnetwork start'. These problems really surprised me as openSuSE prior to this has always good to me and upgrades works right from version 10.3 to 11.3 without problems. I guess I got to stop boasting to people how good openSuSE is ... :(
Labels:
opensuse
Subscribe to:
Posts (Atom)